@streamplace/components 0.7.13 → 0.7.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/package.json +13 -16
  2. package/src/components/mobile-player/fullscreen.native.tsx +15 -20
  3. package/src/components/mobile-player/fullscreen.tsx +10 -2
  4. package/src/components/mobile-player/player.tsx +7 -1
  5. package/src/components/mobile-player/props.tsx +2 -0
  6. package/src/components/mobile-player/video.native.tsx +28 -11
  7. package/src/components/mobile-player/video.tsx +14 -3
  8. package/src/hooks/useLivestreamInfo.ts +6 -2
  9. package/src/lib/browser.ts +27 -0
  10. package/src/livestream-store/stream-key.tsx +1 -28
  11. package/src/streamplace-store/stream.tsx +51 -13
  12. package/dist/assets/emoji-data.json +0 -19371
  13. package/dist/components/chat/chat-box.js +0 -314
  14. package/dist/components/chat/chat-message.js +0 -87
  15. package/dist/components/chat/chat.js +0 -149
  16. package/dist/components/chat/emoji-suggestions.js +0 -35
  17. package/dist/components/chat/mention-suggestions.js +0 -42
  18. package/dist/components/chat/mod-view.js +0 -94
  19. package/dist/components/chat/system-message.js +0 -19
  20. package/dist/components/dashboard/chat-panel.js +0 -38
  21. package/dist/components/dashboard/header.js +0 -80
  22. package/dist/components/dashboard/index.js +0 -14
  23. package/dist/components/dashboard/information-widget.js +0 -234
  24. package/dist/components/dashboard/mod-actions.js +0 -71
  25. package/dist/components/dashboard/problems.js +0 -74
  26. package/dist/components/icons/bluesky-icon.js +0 -9
  27. package/dist/components/keep-awake.js +0 -7
  28. package/dist/components/keep-awake.native.js +0 -16
  29. package/dist/components/mobile-player/fullscreen.js +0 -74
  30. package/dist/components/mobile-player/fullscreen.native.js +0 -155
  31. package/dist/components/mobile-player/player.js +0 -94
  32. package/dist/components/mobile-player/props.js +0 -2
  33. package/dist/components/mobile-player/shared.js +0 -54
  34. package/dist/components/mobile-player/ui/countdown.js +0 -83
  35. package/dist/components/mobile-player/ui/index.js +0 -11
  36. package/dist/components/mobile-player/ui/input.js +0 -42
  37. package/dist/components/mobile-player/ui/metrics.js +0 -44
  38. package/dist/components/mobile-player/ui/report-modal.js +0 -90
  39. package/dist/components/mobile-player/ui/streamer-context-menu.js +0 -7
  40. package/dist/components/mobile-player/ui/streamer-loading-overlay.js +0 -104
  41. package/dist/components/mobile-player/ui/viewer-context-menu.js +0 -51
  42. package/dist/components/mobile-player/ui/viewer-loading-overlay.js +0 -49
  43. package/dist/components/mobile-player/ui/viewers.js +0 -23
  44. package/dist/components/mobile-player/use-webrtc.js +0 -243
  45. package/dist/components/mobile-player/video-retry.js +0 -29
  46. package/dist/components/mobile-player/video.js +0 -460
  47. package/dist/components/mobile-player/video.native.js +0 -276
  48. package/dist/components/mobile-player/webrtc-diagnostics.js +0 -110
  49. package/dist/components/mobile-player/webrtc-primitives.js +0 -27
  50. package/dist/components/mobile-player/webrtc-primitives.native.js +0 -8
  51. package/dist/components/share/sharesheet.js +0 -91
  52. package/dist/components/ui/button.js +0 -223
  53. package/dist/components/ui/dialog.js +0 -206
  54. package/dist/components/ui/dropdown.js +0 -172
  55. package/dist/components/ui/icons.js +0 -25
  56. package/dist/components/ui/index.js +0 -34
  57. package/dist/components/ui/info-box.js +0 -31
  58. package/dist/components/ui/info-row.js +0 -23
  59. package/dist/components/ui/input.js +0 -205
  60. package/dist/components/ui/loader.js +0 -10
  61. package/dist/components/ui/primitives/button.js +0 -125
  62. package/dist/components/ui/primitives/input.js +0 -206
  63. package/dist/components/ui/primitives/modal.js +0 -206
  64. package/dist/components/ui/primitives/text.js +0 -292
  65. package/dist/components/ui/resizeable.js +0 -121
  66. package/dist/components/ui/slider.js +0 -5
  67. package/dist/components/ui/text.js +0 -177
  68. package/dist/components/ui/textarea.js +0 -19
  69. package/dist/components/ui/toast.js +0 -175
  70. package/dist/components/ui/view.js +0 -252
  71. package/dist/hooks/index.js +0 -14
  72. package/dist/hooks/useAvatars.js +0 -35
  73. package/dist/hooks/useCameraToggle.js +0 -12
  74. package/dist/hooks/useKeyboard.js +0 -36
  75. package/dist/hooks/useKeyboardSlide.js +0 -14
  76. package/dist/hooks/useLivestreamInfo.js +0 -65
  77. package/dist/hooks/useOuterAndInnerDimensions.js +0 -30
  78. package/dist/hooks/usePlayerDimensions.js +0 -22
  79. package/dist/hooks/usePointerDevice.js +0 -71
  80. package/dist/hooks/useSegmentDimensions.js +0 -17
  81. package/dist/hooks/useSegmentTiming.js +0 -65
  82. package/dist/index.js +0 -34
  83. package/dist/lib/facet.js +0 -92
  84. package/dist/lib/system-messages.js +0 -101
  85. package/dist/lib/theme/atoms.js +0 -646
  86. package/dist/lib/theme/atoms.types.js +0 -6
  87. package/dist/lib/theme/index.js +0 -35
  88. package/dist/lib/theme/theme.js +0 -256
  89. package/dist/lib/theme/tokens.js +0 -659
  90. package/dist/lib/utils.js +0 -105
  91. package/dist/livestream-provider/index.js +0 -30
  92. package/dist/livestream-provider/websocket.js +0 -45
  93. package/dist/livestream-store/chat.js +0 -286
  94. package/dist/livestream-store/context.js +0 -5
  95. package/dist/livestream-store/index.js +0 -7
  96. package/dist/livestream-store/livestream-state.js +0 -2
  97. package/dist/livestream-store/livestream-store.js +0 -58
  98. package/dist/livestream-store/problems.js +0 -76
  99. package/dist/livestream-store/stream-key.js +0 -119
  100. package/dist/livestream-store/websocket-consumer.js +0 -94
  101. package/dist/player-store/context.js +0 -5
  102. package/dist/player-store/index.js +0 -9
  103. package/dist/player-store/player-provider.js +0 -57
  104. package/dist/player-store/player-state.js +0 -25
  105. package/dist/player-store/player-store.js +0 -199
  106. package/dist/player-store/single-player-provider.js +0 -121
  107. package/dist/streamplace-provider/context.js +0 -5
  108. package/dist/streamplace-provider/index.js +0 -20
  109. package/dist/streamplace-provider/poller.js +0 -49
  110. package/dist/streamplace-provider/xrpc.js +0 -0
  111. package/dist/streamplace-store/block.js +0 -65
  112. package/dist/streamplace-store/index.js +0 -6
  113. package/dist/streamplace-store/stream.js +0 -218
  114. package/dist/streamplace-store/streamplace-store.js +0 -47
  115. package/dist/streamplace-store/user.js +0 -52
  116. package/dist/streamplace-store/xrpc.js +0 -15
  117. package/dist/ui/index.js +0 -79
  118. package/node-compile-cache/v22.15.0-x64-efe9a9df-0/37be0eec +0 -0
  119. package/node-compile-cache/v22.15.0-x64-efe9a9df-0/56540125 +0 -0
  120. package/node-compile-cache/v22.15.0-x64-efe9a9df-0/67b1eb60 +0 -0
  121. package/node-compile-cache/v22.15.0-x64-efe9a9df-0/7c275f90 +0 -0
  122. package/tsconfig.tsbuildinfo +0 -1
@@ -1,223 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.buttonVariants = exports.Button = 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 tokens = tslib_1.__importStar(require("../../lib/theme/tokens"));
11
- const button_1 = require("./primitives/button");
12
- const text_1 = require("./primitives/text");
13
- // Button variants using class-variance-authority pattern
14
- const buttonVariants = (0, class_variance_authority_1.cva)("", {
15
- variants: {
16
- variant: {
17
- primary: "primary",
18
- secondary: "secondary",
19
- outline: "outline",
20
- ghost: "ghost",
21
- destructive: "destructive",
22
- success: "success",
23
- },
24
- size: {
25
- sm: "sm",
26
- md: "md",
27
- lg: "lg",
28
- xl: "xl",
29
- pill: "pill",
30
- },
31
- },
32
- defaultVariants: {
33
- variant: "primary",
34
- size: "md",
35
- },
36
- });
37
- exports.buttonVariants = buttonVariants;
38
- exports.Button = (0, react_1.forwardRef)(({ variant = "primary", size = "md", children, leftIcon, rightIcon, loading = false, loadingText, disabled, style, ...props }, ref) => {
39
- const { theme } = (0, theme_1.useTheme)();
40
- // Create dynamic styles based on theme
41
- const styles = (0, react_1.useMemo)(() => createStyles(theme), [theme]);
42
- // Get variant styles
43
- const buttonStyle = (0, react_1.useMemo)(() => {
44
- const variantStyle = styles[`${variant}Button`];
45
- const sizeStyle = styles[`${size}Button`];
46
- return [variantStyle, sizeStyle];
47
- }, [variant, size, styles]);
48
- // Get inner styles for button content
49
- const buttonInnerStyle = (0, react_1.useMemo)(() => {
50
- const sizeInnerStyle = styles[`${size}ButtonInner`];
51
- return sizeInnerStyle;
52
- }, [size, styles]);
53
- const textStyle = react_1.default.useMemo(() => {
54
- const variantTextStyle = styles[`${variant}Text`];
55
- const sizeTextStyle = styles[`${size}Text`];
56
- return [variantTextStyle, sizeTextStyle];
57
- }, [variant, size, styles]);
58
- const iconSize = react_1.default.useMemo(() => {
59
- switch (size) {
60
- case "sm":
61
- return 16;
62
- case "lg":
63
- return 20;
64
- case "xl":
65
- return 24;
66
- case "md":
67
- default:
68
- return 18;
69
- }
70
- }, [size]);
71
- const spinnerSize = (0, react_1.useMemo)(() => {
72
- switch (size) {
73
- case "sm":
74
- return "small";
75
- case "lg":
76
- case "xl":
77
- return "large";
78
- case "md":
79
- default:
80
- return "small";
81
- }
82
- }, [size]);
83
- const spinnerColor = (0, react_1.useMemo)(() => {
84
- switch (variant) {
85
- case "outline":
86
- case "ghost":
87
- return theme.colors.primary;
88
- case "secondary":
89
- return theme.colors.secondaryForeground;
90
- case "destructive":
91
- return theme.colors.destructiveForeground;
92
- default:
93
- return theme.colors.primaryForeground;
94
- }
95
- }, [variant, theme.colors]);
96
- return ((0, jsx_runtime_1.jsx)(button_1.ButtonPrimitive.Root, { ref: ref, disabled: disabled || loading, style: [buttonStyle, style], ...props, children: (0, jsx_runtime_1.jsxs)(button_1.ButtonPrimitive.Content, { style: buttonInnerStyle, children: [loading && !leftIcon ? ((0, jsx_runtime_1.jsx)(button_1.ButtonPrimitive.Icon, { position: "left", children: (0, jsx_runtime_1.jsx)(react_native_1.ActivityIndicator, { size: spinnerSize, color: spinnerColor }) })) : leftIcon ? ((0, jsx_runtime_1.jsx)(button_1.ButtonPrimitive.Icon, { position: "left", style: { width: iconSize, height: iconSize }, children: leftIcon })) : null, (0, jsx_runtime_1.jsx)(text_1.TextPrimitive.Root, { style: textStyle, children: loading && loadingText ? loadingText : children }), loading && rightIcon ? ((0, jsx_runtime_1.jsx)(button_1.ButtonPrimitive.Icon, { position: "right", children: (0, jsx_runtime_1.jsx)(react_native_1.ActivityIndicator, { size: spinnerSize, color: spinnerColor }) })) : rightIcon ? ((0, jsx_runtime_1.jsx)(button_1.ButtonPrimitive.Icon, { position: "right", style: { width: iconSize, height: iconSize }, children: rightIcon })) : null] }) }));
97
- });
98
- exports.Button.displayName = "Button";
99
- // Create theme-based styles
100
- function createStyles(theme) {
101
- return react_native_1.StyleSheet.create({
102
- // Variant styles
103
- primaryButton: {
104
- backgroundColor: theme.colors.primary,
105
- borderWidth: 0,
106
- ...theme.shadows.sm,
107
- },
108
- primaryText: {
109
- color: theme.colors.primaryForeground,
110
- fontWeight: "600",
111
- },
112
- secondaryButton: {
113
- backgroundColor: theme.colors.secondary,
114
- borderWidth: 0,
115
- },
116
- secondaryText: {
117
- color: theme.colors.secondaryForeground,
118
- fontWeight: "500",
119
- },
120
- outlineButton: {
121
- backgroundColor: "transparent",
122
- borderWidth: 1,
123
- borderColor: theme.colors.border,
124
- },
125
- outlineText: {
126
- color: theme.colors.foreground,
127
- fontWeight: "500",
128
- },
129
- ghostButton: {
130
- backgroundColor: "transparent",
131
- borderWidth: 0,
132
- },
133
- ghostText: {
134
- color: theme.colors.foreground,
135
- fontWeight: "500",
136
- },
137
- destructiveButton: {
138
- backgroundColor: theme.colors.destructive,
139
- borderWidth: 0,
140
- ...theme.shadows.sm,
141
- },
142
- destructiveText: {
143
- color: theme.colors.destructiveForeground,
144
- fontWeight: "600",
145
- },
146
- successButton: {
147
- backgroundColor: theme.colors.success,
148
- borderWidth: 0,
149
- ...theme.shadows.sm,
150
- },
151
- successText: {
152
- color: theme.colors.successForeground,
153
- fontWeight: "600",
154
- },
155
- pillButton: {
156
- paddingHorizontal: theme.spacing[2],
157
- paddingVertical: theme.spacing[1],
158
- borderRadius: tokens.borderRadius.full,
159
- minHeight: tokens.touchTargets.minimum / 2,
160
- },
161
- pillText: {
162
- color: theme.colors.primaryForeground,
163
- fontWeight: "400",
164
- },
165
- // Size styles
166
- smButton: {
167
- paddingHorizontal: theme.spacing[3],
168
- paddingVertical: theme.spacing[2],
169
- borderRadius: tokens.borderRadius.md,
170
- minHeight: tokens.touchTargets.minimum,
171
- gap: theme.spacing[1],
172
- },
173
- smButtonInner: {
174
- gap: theme.spacing[1],
175
- },
176
- smText: {
177
- fontSize: 14,
178
- lineHeight: 16,
179
- },
180
- mdButton: {
181
- paddingHorizontal: theme.spacing[4],
182
- paddingVertical: theme.spacing[3],
183
- borderRadius: tokens.borderRadius.md,
184
- minHeight: tokens.touchTargets.minimum,
185
- gap: theme.spacing[2],
186
- },
187
- mdButtonInner: {
188
- gap: theme.spacing[2],
189
- },
190
- mdText: {
191
- fontSize: 16,
192
- lineHeight: 18,
193
- },
194
- lgButton: {
195
- paddingHorizontal: theme.spacing[6],
196
- paddingVertical: theme.spacing[4],
197
- borderRadius: tokens.borderRadius.md,
198
- minHeight: tokens.touchTargets.comfortable,
199
- gap: theme.spacing[3],
200
- },
201
- lgButtonInner: {
202
- gap: theme.spacing[3],
203
- },
204
- lgText: {
205
- fontSize: 18,
206
- lineHeight: 20,
207
- },
208
- xlButton: {
209
- paddingHorizontal: theme.spacing[8],
210
- paddingVertical: theme.spacing[5],
211
- borderRadius: tokens.borderRadius.lg,
212
- minHeight: tokens.touchTargets.large,
213
- gap: theme.spacing[4],
214
- },
215
- xlButtonInner: {
216
- gap: theme.spacing[4],
217
- },
218
- xlText: {
219
- fontSize: 20,
220
- lineHeight: 24,
221
- },
222
- });
223
- }
@@ -1,206 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.dialogVariants = exports.DialogFooter = exports.DialogDescription = exports.DialogTitle = exports.Dialog = 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 lucide_react_native_1 = require("lucide-react-native");
8
- const react_1 = tslib_1.__importStar(require("react"));
9
- const react_native_1 = require("react-native");
10
- const theme_1 = require("../../lib/theme/theme");
11
- const icons_1 = require("./icons");
12
- const modal_1 = require("./primitives/modal");
13
- const ThemedX = (0, icons_1.createThemedIcon)(lucide_react_native_1.X);
14
- // Dialog variants using class-variance-authority pattern
15
- const dialogVariants = (0, class_variance_authority_1.cva)("", {
16
- variants: {
17
- variant: {
18
- default: "default",
19
- sheet: "sheet",
20
- fullscreen: "fullscreen",
21
- },
22
- size: {
23
- sm: "sm",
24
- md: "md",
25
- lg: "lg",
26
- xl: "xl",
27
- full: "full",
28
- },
29
- position: {
30
- center: "center",
31
- top: "top",
32
- bottom: "bottom",
33
- left: "left",
34
- right: "right",
35
- },
36
- },
37
- defaultVariants: {
38
- variant: "default",
39
- size: "md",
40
- position: "center",
41
- },
42
- });
43
- exports.dialogVariants = dialogVariants;
44
- exports.Dialog = (0, react_1.forwardRef)(({ variant = "left", size = "md", position = "center", children, title, description, dismissible = true, showCloseButton = true, onClose, open = false, onOpenChange, ...props }, ref) => {
45
- const { theme } = (0, theme_1.useTheme)();
46
- // Create dynamic styles based on theme
47
- const styles = react_1.default.useMemo(() => createStyles(theme), [theme]);
48
- const handleClose = react_1.default.useCallback(() => {
49
- if (onClose) {
50
- onClose();
51
- }
52
- if (onOpenChange) {
53
- onOpenChange(false);
54
- }
55
- }, [onClose, onOpenChange]);
56
- const presentationStyle = react_1.default.useMemo(() => {
57
- if (variant === "sheet" && react_native_1.Platform.OS === "ios") {
58
- return "pageSheet";
59
- }
60
- if (variant === "fullscreen") {
61
- return "fullScreen";
62
- }
63
- return react_native_1.Platform.OS === "ios"
64
- ? "pageSheet"
65
- : "fullScreen";
66
- }, [variant]);
67
- const animationType = react_1.default.useMemo(() => {
68
- if (variant === "sheet") {
69
- return "slide";
70
- }
71
- return "fade";
72
- }, [variant]);
73
- return ((0, jsx_runtime_1.jsx)(modal_1.ModalPrimitive.Root, { ref: ref, open: open, onOpenChange: onOpenChange, presentationStyle: presentationStyle, animationType: animationType, ...props, children: (0, jsx_runtime_1.jsx)(modal_1.ModalPrimitive.Overlay, { dismissible: dismissible, onDismiss: handleClose, style: styles.overlay, children: (0, jsx_runtime_1.jsxs)(modal_1.ModalPrimitive.Content, { position: position || "left", size: size || "md", style: [
74
- styles.content,
75
- styles[`${variant}Content`],
76
- styles[`${size}Content`],
77
- ], children: [(title || showCloseButton) && ((0, jsx_runtime_1.jsxs)(modal_1.ModalPrimitive.Header, { withBorder: variant !== "sheet", style: styles.header, children: [(0, jsx_runtime_1.jsx)(exports.DialogTitle, { children: title }), showCloseButton && ((0, jsx_runtime_1.jsx)(modal_1.ModalPrimitive.Close, { onClose: handleClose, style: styles.closeButton, children: (0, jsx_runtime_1.jsx)(DialogCloseIcon, {}) }))] })), (0, jsx_runtime_1.jsxs)(modal_1.ModalPrimitive.Body, { scrollable: variant !== "fullscreen", style: styles.body, children: [description && ((0, jsx_runtime_1.jsx)(exports.DialogDescription, { children: description })), children] })] }) }) }));
78
- });
79
- exports.Dialog.displayName = "Dialog";
80
- exports.DialogTitle = (0, react_1.forwardRef)(({ children, style, ...props }, ref) => {
81
- const { theme } = (0, theme_1.useTheme)();
82
- const styles = react_1.default.useMemo(() => createStyles(theme), [theme]);
83
- if (!children)
84
- return null;
85
- return ((0, jsx_runtime_1.jsx)(react_native_1.Text, { ref: ref, style: [styles.title, style], ...props, children: children }));
86
- });
87
- exports.DialogTitle.displayName = "DialogTitle";
88
- exports.DialogDescription = (0, react_1.forwardRef)(({ children, style, ...props }, ref) => {
89
- const { theme } = (0, theme_1.useTheme)();
90
- const styles = react_1.default.useMemo(() => createStyles(theme), [theme]);
91
- if (!children)
92
- return null;
93
- return ((0, jsx_runtime_1.jsx)(react_native_1.Text, { ref: ref, style: [styles.description, style], ...props, children: children }));
94
- });
95
- exports.DialogDescription.displayName = "DialogDescription";
96
- exports.DialogFooter = (0, react_1.forwardRef)(({ children, direction = "row", justify = "flex-end", withBorder = true, style, ...props }, ref) => {
97
- const { theme } = (0, theme_1.useTheme)();
98
- const styles = react_1.default.useMemo(() => createStyles(theme), [theme]);
99
- if (!children)
100
- return null;
101
- return ((0, jsx_runtime_1.jsx)(modal_1.ModalPrimitive.Footer, { ref: ref, withBorder: withBorder, direction: direction, justify: justify, style: [styles.footer, style], ...props, children: children }));
102
- });
103
- exports.DialogFooter.displayName = "DialogFooter";
104
- // Dialog Close Icon component (Lucide X)
105
- const DialogCloseIcon = () => {
106
- return (0, jsx_runtime_1.jsx)(ThemedX, { size: "md", variant: "default" });
107
- };
108
- // Create theme-aware styles
109
- function createStyles(theme) {
110
- return react_native_1.StyleSheet.create({
111
- overlay: {
112
- backgroundColor: "rgba(0, 0, 0, 0.5)",
113
- },
114
- content: {
115
- backgroundColor: theme.colors.card,
116
- borderRadius: theme.borderRadius.lg,
117
- ...theme.shadows.lg,
118
- maxHeight: "90%",
119
- maxWidth: "90%",
120
- },
121
- // Variant styles
122
- defaultContent: {
123
- // Default styles already applied in content
124
- },
125
- sheetContent: {
126
- borderTopLeftRadius: theme.borderRadius.xl,
127
- borderTopRightRadius: theme.borderRadius.xl,
128
- borderBottomLeftRadius: 0,
129
- borderBottomRightRadius: 0,
130
- marginTop: "auto",
131
- marginBottom: 0,
132
- maxHeight: "80%",
133
- width: "100%",
134
- maxWidth: "100%",
135
- },
136
- fullscreenContent: {
137
- width: "100%",
138
- height: "100%",
139
- maxWidth: "100%",
140
- maxHeight: "100%",
141
- borderRadius: 0,
142
- margin: 0,
143
- },
144
- // Size styles
145
- smContent: {
146
- minWidth: 300,
147
- minHeight: 200,
148
- },
149
- mdContent: {
150
- minWidth: 400,
151
- minHeight: 300,
152
- },
153
- lgContent: {
154
- minWidth: 500,
155
- minHeight: 400,
156
- },
157
- xlContent: {
158
- minWidth: 600,
159
- minHeight: 500,
160
- },
161
- fullContent: {
162
- width: "95%",
163
- height: "95%",
164
- maxWidth: "95%",
165
- maxHeight: "95%",
166
- },
167
- header: {
168
- paddingHorizontal: theme.spacing[6],
169
- paddingVertical: theme.spacing[4],
170
- flexDirection: "row",
171
- alignItems: "center",
172
- justifyContent: "space-between",
173
- },
174
- body: {
175
- paddingHorizontal: theme.spacing[6],
176
- paddingBottom: theme.spacing[6],
177
- flex: 1,
178
- },
179
- footer: {
180
- paddingHorizontal: theme.spacing[6],
181
- paddingVertical: theme.spacing[4],
182
- gap: theme.spacing[2],
183
- },
184
- title: {
185
- fontSize: 20,
186
- fontWeight: "600",
187
- color: theme.colors.text,
188
- flex: 1,
189
- lineHeight: 24,
190
- },
191
- description: {
192
- fontSize: 16,
193
- color: theme.colors.textMuted,
194
- lineHeight: 22,
195
- marginBottom: theme.spacing[4],
196
- },
197
- closeButton: {
198
- width: theme.touchTargets.minimum,
199
- height: theme.touchTargets.minimum,
200
- alignItems: "center",
201
- justifyContent: "center",
202
- borderRadius: theme.borderRadius.sm,
203
- marginLeft: theme.spacing[2],
204
- },
205
- });
206
- }
@@ -1,172 +0,0 @@
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.DropdownMenuContentWithoutPortal = 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) {
20
- // Use the primitives' context to know if open
21
- const { open, onOpenChange } = DropdownMenuPrimitive.useRootContext();
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,
25
- // why the heck is this 1-indexed
26
- index: open ? 3 : -1, snapPoints: snapPoints, enablePanDownToClose: true, enableDynamicSizing: true, enableContentPanningGesture: false, backdropComponent: ({ style }) => ((0, jsx_runtime_1.jsx)(react_native_1.Pressable, { style: [style, react_native_1.StyleSheet.absoluteFill], onPress: () => onOpenChange?.(false) })), 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"
31
- ? children({ pressed: true })
32
- : children }) }) }));
33
- });
34
- exports.DropdownMenuSubTrigger = (0, react_1.forwardRef)(({ inset, children, ...props }, ref) => {
35
- const { open } = DropdownMenuPrimitive.useSubContext();
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] }) })] }) }) }));
48
- });
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,
61
- ], ...props }));
62
- });
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,
66
- overlayStyle,
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,
78
- ], ...props }) }) }));
79
- });
80
- exports.DropdownMenuContentWithoutPortal = (0, react_1.forwardRef)(({ overlayStyle, ...props }, ref) => {
81
- return ((0, jsx_runtime_1.jsx)(DropdownMenuPrimitive.Overlay, { style: [
82
- react_native_1.Platform.OS !== "web" ? react_native_1.StyleSheet.absoluteFill : undefined,
83
- overlayStyle,
84
- ], children: (0, jsx_runtime_1.jsx)(DropdownMenuPrimitive.Content, { ref: ref, style: [
85
- { zIndex: 999999 },
86
- atoms_1.a.sizes.minWidth[32],
87
- atoms_1.a.sizes.maxWidth[64],
88
- atoms_1.a.overflow.hidden,
89
- atoms_1.a.radius.all.md,
90
- atoms_1.a.borders.width.thin,
91
- atoms_1.a.borders.color.gray[800],
92
- atoms_1.bg.gray[950],
93
- atoms_1.p[2],
94
- atoms_1.a.shadows.md,
95
- ], ...props }) }));
96
- });
97
- /// Responsive Dropdown Menu Content. On mobile this will render a *bottom sheet* that is **portaled to the root of the app**.
98
- /// Prefer passing scoped content in as **otherwise it may crash the app**.
99
- exports.ResponsiveDropdownMenuContent = (0, react_1.forwardRef)(({ children, ...props }, ref) => {
100
- const { width } = (0, react_native_1.useWindowDimensions)();
101
- // On web, you might want to always use the normal dropdown
102
- const isBottomSheet = react_native_1.Platform.OS !== "web" && width < 800;
103
- if (isBottomSheet) {
104
- return ((0, jsx_runtime_1.jsx)(exports.DropdownMenuBottomSheet, { ref: ref, ...props, children: children }));
105
- }
106
- return ((0, jsx_runtime_1.jsx)(exports.DropdownMenuContent, { ref: ref, ...props, children: children }));
107
- });
108
- exports.DropdownMenuItem = (0, react_1.forwardRef)(({ inset, disabled, style, children, ...props }, ref) => {
109
- 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: [
110
- atoms_1.a.layout.flex.row,
111
- atoms_1.a.layout.flex.alignCenter,
112
- atoms_1.a.radius.all.sm,
113
- atoms_1.py[1],
114
- atoms_1.pl[2],
115
- atoms_1.pr[2],
116
- ], children: typeof children === "function"
117
- ? children({ pressed: true })
118
- : children }) }) }));
119
- });
120
- exports.DropdownMenuCheckboxItem = (0, react_1.forwardRef)(({ children, checked, ...props }, ref) => {
121
- 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: [
122
- atoms_1.a.layout.flex.row,
123
- atoms_1.a.layout.flex.alignCenter,
124
- atoms_1.a.radius.all.sm,
125
- atoms_1.py[1],
126
- atoms_1.pl[2],
127
- atoms_1.pr[2],
128
- atoms_1.pr[8],
129
- ], 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] })) })] }) }));
130
- });
131
- exports.DropdownMenuRadioItem = (0, react_1.forwardRef)(({ children, ...props }, ref) => {
132
- 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: [
133
- atoms_1.a.layout.flex.row,
134
- atoms_1.a.layout.flex.alignCenter,
135
- atoms_1.a.radius.all.sm,
136
- atoms_1.py[1],
137
- atoms_1.pl[2],
138
- atoms_1.pr[1],
139
- ], 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] }) }));
140
- });
141
- exports.DropdownMenuLabel = (0, react_1.forwardRef)(({ inset, ...props }, ref) => {
142
- return ((0, jsx_runtime_1.jsx)(react_native_1.Text, { ref: ref, style: [
143
- atoms_1.px[2],
144
- atoms_1.py[2],
145
- atoms_1.a.textColors.gray[200],
146
- atoms_1.a.fontSize.base,
147
- inset && atoms_1.gap[2],
148
- ], ...props }));
149
- });
150
- exports.DropdownMenuSeparator = (0, react_1.forwardRef)((props, ref) => {
151
- return (0, jsx_runtime_1.jsx)(react_native_1.View, { ref: ref, style: [{ height: 0.5 }, atoms_1.bg.gray[800]], ...props });
152
- });
153
- function DropdownMenuShortcut(props) {
154
- return ((0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [
155
- atoms_1.ml.auto,
156
- atoms_1.a.textColors.gray[500],
157
- atoms_1.a.fontSize.sm,
158
- atoms_1.a.letterSpacing.widest,
159
- ], ...props }));
160
- }
161
- exports.DropdownMenuGroup = (0, react_1.forwardRef)((props, ref) => {
162
- const { inset, title, children, ...rest } = props;
163
- return ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: [atoms_1.pt[2], inset && atoms_1.gap[2]], 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: [
164
- atoms_1.bg.gray[900],
165
- react_native_1.Platform.OS === "web" ? [atoms_1.px[2], atoms_1.py[1]] : atoms_1.p[2],
166
- atoms_1.gap.all[1],
167
- { borderRadius: atoms_1.borderRadius.lg },
168
- ], children: children })] }));
169
- });
170
- exports.DropdownMenuInfo = (0, react_1.forwardRef)(({ description, ...props }, ref) => {
171
- 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 }));
172
- });
@@ -1,25 +0,0 @@
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");
6
- // Size mapping
7
- const sizeMap = {
8
- sm: 16,
9
- md: 20,
10
- lg: 24,
11
- xl: 32,
12
- };
13
- // HOC to create themed icons
14
- function createThemedIcon(IconComponent) {
15
- return ({ variant = "default", size = "md", color, ...restProps }) => {
16
- let theme = (0, theme_1.useTheme)(); // Ensure theme is available
17
- // Calculate size
18
- const iconSize = typeof size === "number" ? size : sizeMap[size];
19
- // Calculate color if not provided using atoms
20
- const iconColor = color ||
21
- theme.theme.colors[variant] ||
22
- theme.theme.colors.secondaryForeground;
23
- return ((0, jsx_runtime_1.jsx)(IconComponent, { size: iconSize, color: iconColor, ...restProps }));
24
- };
25
- }
@@ -1,34 +0,0 @@
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");
5
- // Export primitive components
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);
10
- // Export styled components
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("./info-box"), exports);
16
- tslib_1.__exportStar(require("./info-row"), exports);
17
- tslib_1.__exportStar(require("./input"), exports);
18
- tslib_1.__exportStar(require("./loader"), exports);
19
- tslib_1.__exportStar(require("./resizeable"), exports);
20
- tslib_1.__exportStar(require("./slider"), exports);
21
- tslib_1.__exportStar(require("./text"), exports);
22
- tslib_1.__exportStar(require("./textarea"), exports);
23
- tslib_1.__exportStar(require("./toast"), exports);
24
- tslib_1.__exportStar(require("./view"), exports);
25
- // Component collections for easy importing
26
- var button_1 = require("./primitives/button");
27
- Object.defineProperty(exports, "ButtonPrimitive", { enumerable: true, get: function () { return button_1.ButtonPrimitive; } });
28
- var input_1 = require("./primitives/input");
29
- Object.defineProperty(exports, "InputPrimitive", { enumerable: true, get: function () { return input_1.InputPrimitive; } });
30
- var modal_1 = require("./primitives/modal");
31
- Object.defineProperty(exports, "ModalPrimitive", { enumerable: true, get: function () { return modal_1.ModalPrimitive; } });
32
- var text_1 = require("./primitives/text");
33
- Object.defineProperty(exports, "TextPrimitive", { enumerable: true, get: function () { return text_1.TextPrimitive; } });
34
- tslib_1.__exportStar(require("../../lib/theme"), exports);