@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,31 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.InfoBox = InfoBox;
4
- const tslib_1 = require("tslib");
5
- const jsx_runtime_1 = require("react/jsx-runtime");
6
- const react_native_1 = require("react-native");
7
- const zero = tslib_1.__importStar(require("../../ui"));
8
- const { bg, r, p, text, layout, gap, flex } = zero;
9
- function InfoBox({ icon: Icon, label, value, status = "neutral", }) {
10
- const statusColors = {
11
- good: text.green[400],
12
- warning: text.yellow[400],
13
- error: text.red[400],
14
- neutral: text.white,
15
- };
16
- const statusColor = statusColors[status];
17
- return ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: [
18
- flex.values[1],
19
- layout.flex.column,
20
- layout.flex.spaceBetween,
21
- layout.flex.alignCenter,
22
- bg.neutral[700],
23
- r.sm,
24
- p[2],
25
- ], children: [(0, jsx_runtime_1.jsxs)(react_native_1.View, { style: [
26
- layout.flex.row,
27
- layout.flex.spaceBetween,
28
- gap.all[3],
29
- zero.w.percent[100],
30
- ], children: [(0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [text.gray[100], { fontSize: 13, fontWeight: "500" }], children: label }), (0, jsx_runtime_1.jsx)(Icon, { size: 16, color: "#9ca3af" })] }), (0, jsx_runtime_1.jsx)(react_native_1.View, { style: [layout.flex.align.end, zero.w.percent[100]], children: (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [statusColor, { fontSize: 26, fontWeight: "600" }], children: value }) })] }));
31
- }
@@ -1,23 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.InfoRow = InfoRow;
4
- const tslib_1 = require("tslib");
5
- const jsx_runtime_1 = require("react/jsx-runtime");
6
- const react_native_1 = require("react-native");
7
- const zero = tslib_1.__importStar(require("../../ui"));
8
- const { text, layout, py, gap } = zero;
9
- function InfoRow({ icon: Icon, label, value, status = "neutral", }) {
10
- const statusColors = {
11
- good: text.green[400],
12
- warning: text.yellow[400],
13
- error: text.red[400],
14
- neutral: text.white,
15
- };
16
- const statusColor = statusColors[status];
17
- return ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: [
18
- layout.flex.row,
19
- layout.flex.spaceBetween,
20
- layout.flex.alignCenter,
21
- py[2],
22
- ], children: [(0, jsx_runtime_1.jsxs)(react_native_1.View, { style: [layout.flex.row, layout.flex.alignCenter, gap.all[3]], children: [(0, jsx_runtime_1.jsx)(Icon, { size: 16, color: "#9ca3af" }), (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [text.gray[300], { fontSize: 13, fontWeight: "500" }], children: label })] }), (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [statusColor, { fontSize: 13, fontWeight: "600" }], children: value })] }));
23
- }
@@ -1,205 +0,0 @@
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)("", {
12
- variants: {
13
- variant: {
14
- default: "default",
15
- filled: "filled",
16
- underlined: "underlined",
17
- },
18
- size: {
19
- sm: "sm",
20
- md: "md",
21
- lg: "lg",
22
- },
23
- },
24
- defaultVariants: {
25
- variant: "default",
26
- size: "md",
27
- },
28
- });
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);
34
- // Create dynamic styles based on theme
35
- const styles = react_1.default.useMemo(() => createStyles(theme), [theme]);
36
- // Get variant and size styles
37
- const containerStyles = react_1.default.useMemo(() => {
38
- const variantStyle = styles[`${variant}Container`];
39
- const sizeStyle = styles[`${size}Container`];
40
- const focusStyle = isFocused ? styles.focusedContainer : null;
41
- return [variantStyle, sizeStyle, focusStyle];
42
- }, [variant, size, styles, isFocused]);
43
- const textStyles = react_1.default.useMemo(() => {
44
- const variantTextStyle = styles[`${variant}Input`];
45
- const sizeTextStyle = styles[`${size}Input`];
46
- return [variantTextStyle, sizeTextStyle];
47
- }, [variant, size, styles]);
48
- const handleFocus = react_1.default.useCallback((event) => {
49
- setIsFocused(true);
50
- if (props.onFocus) {
51
- props.onFocus(event);
52
- }
53
- }, [props.onFocus]);
54
- const handleBlur = react_1.default.useCallback((event) => {
55
- setIsFocused(false);
56
- if (props.onBlur) {
57
- props.onBlur(event);
58
- }
59
- }, [props.onBlur]);
60
- const handleContainerPress = react_1.default.useCallback(() => {
61
- if (inputRef.current && !disabled) {
62
- inputRef.current.focus();
63
- }
64
- }, [disabled]);
65
- const hasAddons = leftAddon || rightAddon;
66
- if (hasAddons) {
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) => {
68
- inputRef.current = node;
69
- if (ref) {
70
- if (typeof ref === "function") {
71
- ref(node);
72
- }
73
- else {
74
- ref.current = node;
75
- }
76
- }
77
- }, disabled: disabled, error: !!error, onFocus: handleFocus, onBlur: handleBlur, style: [
78
- textStyles,
79
- styles.inputInContainer,
80
- inputStyle,
81
- { outline: "none" },
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 })] }));
83
- }
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) => {
85
- inputRef.current = node;
86
- if (ref) {
87
- if (typeof ref === "function") {
88
- ref(node);
89
- }
90
- else {
91
- ref.current = node;
92
- }
93
- }
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 })] }));
95
- });
96
- exports.Input.displayName = "Input";
97
- // Create theme-aware styles
98
- function createStyles(theme) {
99
- return react_native_1.StyleSheet.create({
100
- // Variant styles for containers
101
- defaultContainer: {
102
- backgroundColor: theme.colors.background,
103
- borderWidth: 1,
104
- borderColor: theme.colors.border,
105
- borderRadius: theme.borderRadius.md,
106
- },
107
- filledContainer: {
108
- backgroundColor: theme.colors.muted,
109
- borderWidth: 0,
110
- borderRadius: theme.borderRadius.md,
111
- },
112
- underlinedContainer: {
113
- backgroundColor: "transparent",
114
- borderWidth: 0,
115
- borderBottomWidth: 1,
116
- borderBottomColor: theme.colors.border,
117
- borderRadius: 0,
118
- paddingHorizontal: 0,
119
- },
120
- // Variant styles for inputs
121
- defaultInput: {
122
- color: theme.colors.text,
123
- backgroundColor: "transparent",
124
- },
125
- filledInput: {
126
- color: theme.colors.text,
127
- backgroundColor: "transparent",
128
- },
129
- underlinedInput: {
130
- color: theme.colors.text,
131
- backgroundColor: "transparent",
132
- },
133
- // Size styles for containers
134
- smContainer: {
135
- paddingHorizontal: theme.spacing[3],
136
- paddingVertical: theme.spacing[2],
137
- minHeight: theme.touchTargets.minimum - 8,
138
- },
139
- mdContainer: {
140
- paddingHorizontal: theme.spacing[3],
141
- paddingVertical: theme.spacing[3],
142
- minHeight: theme.touchTargets.minimum,
143
- },
144
- lgContainer: {
145
- paddingHorizontal: theme.spacing[4],
146
- paddingVertical: theme.spacing[4],
147
- minHeight: theme.touchTargets.comfortable,
148
- },
149
- // Size styles for inputs
150
- smInput: {
151
- fontSize: 14,
152
- lineHeight: 18,
153
- ...react_native_1.Platform.select({
154
- ios: {
155
- paddingVertical: 0,
156
- },
157
- android: {
158
- paddingVertical: 0,
159
- textAlignVertical: "center",
160
- },
161
- }),
162
- },
163
- mdInput: {
164
- fontSize: 16,
165
- lineHeight: 20,
166
- ...react_native_1.Platform.select({
167
- ios: {
168
- paddingVertical: 0,
169
- },
170
- android: {
171
- paddingVertical: 0,
172
- textAlignVertical: "center",
173
- },
174
- }),
175
- },
176
- lgInput: {
177
- fontSize: 18,
178
- lineHeight: 22,
179
- ...react_native_1.Platform.select({
180
- ios: {
181
- paddingVertical: 0,
182
- },
183
- android: {
184
- paddingVertical: 0,
185
- textAlignVertical: "center",
186
- },
187
- }),
188
- },
189
- // Special style for inputs inside containers
190
- inputInContainer: {
191
- flex: 1,
192
- paddingHorizontal: 0,
193
- paddingVertical: 0,
194
- borderWidth: 0,
195
- backgroundColor: "transparent",
196
- minHeight: "auto",
197
- borderRadius: 0,
198
- },
199
- // Focus styles
200
- focusedContainer: {
201
- borderColor: theme.colors.primary,
202
- borderWidth: 1,
203
- },
204
- });
205
- }
@@ -1,10 +0,0 @@
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 });
10
- }
@@ -1,125 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ButtonPrimitive = exports.ButtonContent = exports.ButtonLoading = exports.ButtonIcon = exports.ButtonText = exports.ButtonRoot = void 0;
4
- const tslib_1 = require("tslib");
5
- const jsx_runtime_1 = require("react/jsx-runtime");
6
- const react_1 = tslib_1.__importStar(require("react"));
7
- const react_native_1 = require("react-native");
8
- // Button root primitive - handles all touch interactions
9
- exports.ButtonRoot = (0, react_1.forwardRef)(({ children, disabled = false, loading = false, onPress, onPressIn, onPressOut, onLongPress, accessibilityRole = "button", accessibilityLabel, accessibilityHint, accessibilityState, testID, style, activeOpacity = 0.7, ...props }, ref) => {
10
- const handlePress = react_1.default.useCallback((event) => {
11
- if (!disabled && !loading && onPress) {
12
- onPress(event);
13
- }
14
- }, [disabled, loading, onPress]);
15
- const handlePressIn = react_1.default.useCallback((event) => {
16
- if (!disabled && !loading && onPressIn) {
17
- onPressIn(event);
18
- }
19
- }, [disabled, loading, onPressIn]);
20
- const handlePressOut = react_1.default.useCallback((event) => {
21
- if (!disabled && !loading && onPressOut) {
22
- onPressOut(event);
23
- }
24
- }, [disabled, loading, onPressOut]);
25
- const handleLongPress = react_1.default.useCallback((event) => {
26
- if (!disabled && !loading && onLongPress) {
27
- onLongPress(event);
28
- }
29
- }, [disabled, loading, onLongPress]);
30
- return ((0, jsx_runtime_1.jsx)(react_native_1.TouchableOpacity, { ref: ref, onPress: handlePress, onPressIn: handlePressIn, onPressOut: handlePressOut, onLongPress: handleLongPress, disabled: disabled || loading, activeOpacity: disabled || loading ? 1 : activeOpacity, accessibilityRole: accessibilityRole, accessibilityLabel: accessibilityLabel, accessibilityHint: accessibilityHint, accessibilityState: {
31
- disabled: disabled || loading,
32
- busy: loading,
33
- ...accessibilityState,
34
- }, testID: testID, style: [
35
- primitiveStyles.button,
36
- (disabled || loading) && primitiveStyles.disabled,
37
- style,
38
- ], ...props, children: children }));
39
- });
40
- exports.ButtonRoot.displayName = "ButtonRoot";
41
- exports.ButtonText = (0, react_1.forwardRef)(({ children, disabled, loading, style, ...props }, ref) => {
42
- return ((0, jsx_runtime_1.jsx)(react_native_1.Text, { ref: ref, style: [
43
- primitiveStyles.text,
44
- (disabled || loading) && primitiveStyles.textDisabled,
45
- style,
46
- ], ...props, children: children }));
47
- });
48
- exports.ButtonText.displayName = "ButtonText";
49
- exports.ButtonIcon = (0, react_1.forwardRef)(({ children, position = "left", disabled, loading, style, ...props }, ref) => {
50
- return ((0, jsx_runtime_1.jsx)(react_native_1.View, { ref: ref, style: [
51
- primitiveStyles.icon,
52
- (disabled || loading) && primitiveStyles.iconDisabled,
53
- style,
54
- ], ...props, children: children }));
55
- });
56
- exports.ButtonIcon.displayName = "ButtonIcon";
57
- exports.ButtonLoading = (0, react_1.forwardRef)(({ children, visible = false, style, ...props }, ref) => {
58
- if (!visible)
59
- return null;
60
- return ((0, jsx_runtime_1.jsx)(react_native_1.View, { ref: ref, style: [primitiveStyles.loading, style], ...props, children: children }));
61
- });
62
- exports.ButtonLoading.displayName = "ButtonLoading";
63
- exports.ButtonContent = (0, react_1.forwardRef)(({ children, direction = "row", align = "center", justify = "center", style, ...props }, ref) => {
64
- return ((0, jsx_runtime_1.jsx)(react_native_1.View, { ref: ref, style: [
65
- primitiveStyles.content,
66
- {
67
- flexDirection: direction,
68
- alignItems: align,
69
- justifyContent: justify,
70
- },
71
- style,
72
- ], ...props, children: children }));
73
- });
74
- exports.ButtonContent.displayName = "ButtonContent";
75
- // Primitive styles (minimal, unstyled)
76
- const primitiveStyles = react_native_1.StyleSheet.create({
77
- button: {
78
- flexDirection: "row",
79
- alignItems: "center",
80
- justifyContent: "center",
81
- minHeight: 44, // iOS minimum touch target
82
- minWidth: 44,
83
- },
84
- disabled: {
85
- opacity: 0.5,
86
- },
87
- content: {
88
- flexDirection: "row",
89
- alignItems: "center",
90
- justifyContent: "center",
91
- flex: 1,
92
- },
93
- text: {
94
- textAlign: "center",
95
- },
96
- textDisabled: {
97
- opacity: 0.5,
98
- },
99
- icon: {
100
- alignItems: "center",
101
- justifyContent: "center",
102
- },
103
- iconLeft: {
104
- marginRight: 8,
105
- },
106
- iconRight: {
107
- marginLeft: 8,
108
- },
109
- iconDisabled: {
110
- opacity: 0.5,
111
- },
112
- loading: {
113
- position: "absolute",
114
- alignItems: "center",
115
- justifyContent: "center",
116
- },
117
- });
118
- // Export primitive collection
119
- exports.ButtonPrimitive = {
120
- Root: exports.ButtonRoot,
121
- Text: exports.ButtonText,
122
- Icon: exports.ButtonIcon,
123
- Loading: exports.ButtonLoading,
124
- Content: exports.ButtonContent,
125
- };
@@ -1,206 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.InputPrimitive = exports.InputGroup = exports.InputAddon = exports.InputError = exports.InputDescription = exports.InputLabel = exports.InputContainer = exports.InputRoot = void 0;
4
- const tslib_1 = require("tslib");
5
- const jsx_runtime_1 = require("react/jsx-runtime");
6
- const react_1 = tslib_1.__importStar(require("react"));
7
- const react_native_1 = require("react-native");
8
- // Input root primitive - the main TextInput component
9
- exports.InputRoot = (0, react_1.forwardRef)(({ value, onChangeText, onChange, onFocus, onBlur, error = false, disabled = false, loading = false, editable, style, placeholderTextColor = "#9ca3af", ...props }, ref) => {
10
- const [isFocused, setIsFocused] = react_1.default.useState(false);
11
- const handleChangeText = react_1.default.useCallback((text) => {
12
- if (onChangeText) {
13
- onChangeText(text);
14
- }
15
- if (onChange) {
16
- onChange(text);
17
- }
18
- }, [onChangeText, onChange]);
19
- const handleFocus = react_1.default.useCallback((event) => {
20
- setIsFocused(true);
21
- if (onFocus) {
22
- onFocus(event);
23
- }
24
- }, [onFocus]);
25
- const handleBlur = react_1.default.useCallback((event) => {
26
- setIsFocused(false);
27
- if (onBlur) {
28
- onBlur(event);
29
- }
30
- }, [onBlur]);
31
- return ((0, jsx_runtime_1.jsx)(react_native_1.TextInput, { ref: ref, value: value, onChangeText: handleChangeText, onFocus: handleFocus, onBlur: handleBlur, editable: !disabled && !loading && editable, placeholderTextColor: placeholderTextColor, style: [
32
- primitiveStyles.input,
33
- style,
34
- error && primitiveStyles.inputError,
35
- disabled && primitiveStyles.inputDisabled,
36
- loading && primitiveStyles.inputLoading,
37
- ], ...props }));
38
- });
39
- exports.InputRoot.displayName = "InputRoot";
40
- exports.InputContainer = (0, react_1.forwardRef)(({ children, focused = false, error = false, disabled = false, style, ...props }, ref) => {
41
- return ((0, jsx_runtime_1.jsx)(react_native_1.View, { ref: ref, style: [
42
- primitiveStyles.container,
43
- style,
44
- focused && primitiveStyles.containerFocused,
45
- error && primitiveStyles.containerError,
46
- disabled && primitiveStyles.containerDisabled,
47
- ], ...props, children: children }));
48
- });
49
- exports.InputContainer.displayName = "InputContainer";
50
- exports.InputLabel = (0, react_1.forwardRef)(({ children, required = false, disabled = false, error = false, style, ...props }, ref) => {
51
- return ((0, jsx_runtime_1.jsxs)(react_native_1.Text, { ref: ref, style: [
52
- primitiveStyles.label,
53
- style,
54
- error && primitiveStyles.labelError,
55
- disabled && primitiveStyles.labelDisabled,
56
- ], ...props, children: [children, required && (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: primitiveStyles.required, children: " *" })] }));
57
- });
58
- exports.InputLabel.displayName = "InputLabel";
59
- exports.InputDescription = (0, react_1.forwardRef)(({ children, error = false, disabled = false, style, ...props }, ref) => {
60
- return ((0, jsx_runtime_1.jsx)(react_native_1.Text, { ref: ref, style: [
61
- primitiveStyles.description,
62
- style,
63
- error && primitiveStyles.descriptionError,
64
- disabled && primitiveStyles.descriptionDisabled,
65
- ], ...props, children: children }));
66
- });
67
- exports.InputDescription.displayName = "InputDescription";
68
- exports.InputError = (0, react_1.forwardRef)(({ children, visible = true, style, ...props }, ref) => {
69
- if (!visible || !children)
70
- return null;
71
- return ((0, jsx_runtime_1.jsx)(react_native_1.Text, { ref: ref, style: [primitiveStyles.error, style], ...props, children: children }));
72
- });
73
- exports.InputError.displayName = "InputError";
74
- exports.InputAddon = (0, react_1.forwardRef)(({ children, position = "left", touchable = false, onPress, style, ...props }, ref) => {
75
- const addonStyle = [
76
- primitiveStyles.addon,
77
- primitiveStyles[`addon${position.charAt(0).toUpperCase() + position.slice(1)}`],
78
- style,
79
- ];
80
- if (touchable && onPress) {
81
- return ((0, jsx_runtime_1.jsx)(react_native_1.TouchableOpacity, { ref: ref, style: addonStyle, onPress: onPress, ...props, children: children }));
82
- }
83
- return ((0, jsx_runtime_1.jsx)(react_native_1.View, { ref: ref, style: addonStyle, ...props, children: children }));
84
- });
85
- exports.InputAddon.displayName = "InputAddon";
86
- exports.InputGroup = (0, react_1.forwardRef)(({ children, spacing = 8, style, ...props }, ref) => {
87
- return ((0, jsx_runtime_1.jsx)(react_native_1.View, { ref: ref, style: [primitiveStyles.group, { gap: spacing }, style], ...props, children: children }));
88
- });
89
- exports.InputGroup.displayName = "InputGroup";
90
- // Primitive styles (minimal, unstyled)
91
- const primitiveStyles = react_native_1.StyleSheet.create({
92
- input: {
93
- minHeight: 44, // iOS minimum touch target
94
- paddingHorizontal: 12,
95
- paddingVertical: 8,
96
- fontSize: 16,
97
- borderWidth: 1,
98
- borderColor: "#d1d5db",
99
- borderRadius: 8,
100
- backgroundColor: "white",
101
- ...react_native_1.Platform.select({
102
- ios: {
103
- paddingVertical: 12,
104
- },
105
- android: {
106
- paddingVertical: 8,
107
- textAlignVertical: "center",
108
- },
109
- }),
110
- },
111
- inputFocused: {
112
- // No focus styles for the actual input
113
- },
114
- inputError: {
115
- borderColor: "#ef4444",
116
- borderWidth: 1,
117
- },
118
- inputDisabled: {
119
- backgroundColor: "#f3f4f6",
120
- borderColor: "#e5e7eb",
121
- opacity: 0.6,
122
- },
123
- inputLoading: {
124
- opacity: 0.7,
125
- },
126
- container: {
127
- flexDirection: "row",
128
- alignItems: "center",
129
- borderWidth: 1,
130
- borderColor: "#d1d5db",
131
- borderRadius: 8,
132
- backgroundColor: "white",
133
- paddingHorizontal: 12,
134
- minHeight: 44,
135
- },
136
- containerFocused: {
137
- borderColor: "#3b82f6",
138
- borderWidth: 1,
139
- },
140
- containerError: {
141
- borderColor: "#ef4444",
142
- borderWidth: 1,
143
- },
144
- containerDisabled: {
145
- backgroundColor: "#f3f4f6",
146
- borderColor: "#e5e7eb",
147
- opacity: 0.6,
148
- },
149
- label: {
150
- fontSize: 14,
151
- fontWeight: "500",
152
- color: "#374151",
153
- marginBottom: 4,
154
- },
155
- labelError: {
156
- color: "#ef4444",
157
- },
158
- labelDisabled: {
159
- color: "#9ca3af",
160
- opacity: 0.6,
161
- },
162
- required: {
163
- color: "#ef4444",
164
- },
165
- description: {
166
- fontSize: 12,
167
- color: "#6b7280",
168
- marginTop: 4,
169
- },
170
- descriptionError: {
171
- color: "#ef4444",
172
- },
173
- descriptionDisabled: {
174
- color: "#9ca3af",
175
- opacity: 0.6,
176
- },
177
- error: {
178
- fontSize: 12,
179
- color: "#ef4444",
180
- marginTop: 4,
181
- },
182
- addon: {
183
- alignItems: "center",
184
- justifyContent: "center",
185
- paddingHorizontal: 8,
186
- },
187
- addonLeft: {
188
- marginRight: 8,
189
- },
190
- addonRight: {
191
- marginLeft: 8,
192
- },
193
- group: {
194
- flexDirection: "column",
195
- },
196
- });
197
- // Export primitive collection
198
- exports.InputPrimitive = {
199
- Root: exports.InputRoot,
200
- Container: exports.InputContainer,
201
- Label: exports.InputLabel,
202
- Description: exports.InputDescription,
203
- Error: exports.InputError,
204
- Addon: exports.InputAddon,
205
- Group: exports.InputGroup,
206
- };