@streamplace/components 0.7.34 → 0.8.0
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/content-metadata/content-metadata-form.js +404 -0
- package/dist/components/content-metadata/content-rights.js +78 -0
- package/dist/components/content-metadata/content-warnings.js +68 -0
- package/dist/components/content-metadata/index.js +11 -0
- package/dist/components/dashboard/header.js +16 -2
- package/dist/components/dashboard/problems.js +29 -28
- package/dist/components/mobile-player/player.js +4 -0
- package/dist/components/mobile-player/ui/report-modal.js +3 -2
- package/dist/components/mobile-player/ui/viewer-context-menu.js +44 -1
- package/dist/components/ui/button.js +9 -9
- package/dist/components/ui/checkbox.js +87 -0
- package/dist/components/ui/dialog.js +188 -83
- package/dist/components/ui/dropdown.js +15 -10
- package/dist/components/ui/icons.js +6 -0
- package/dist/components/ui/primitives/button.js +0 -7
- package/dist/components/ui/primitives/input.js +13 -1
- package/dist/components/ui/primitives/modal.js +2 -2
- package/dist/components/ui/select.js +89 -0
- package/dist/components/ui/textarea.js +23 -4
- package/dist/components/ui/toast.js +464 -114
- package/dist/components/ui/tooltip.js +103 -0
- package/dist/index.js +2 -0
- package/dist/lib/metadata-constants.js +157 -0
- package/dist/lib/theme/theme.js +5 -3
- package/dist/lib/theme/tokens.js +9 -0
- package/dist/streamplace-provider/index.js +14 -4
- package/dist/streamplace-store/content-metadata-actions.js +118 -0
- package/dist/streamplace-store/graph.js +195 -0
- package/dist/streamplace-store/streamplace-store.js +18 -5
- package/dist/streamplace-store/user.js +67 -7
- package/node-compile-cache/v22.15.0-x64-efe9a9df-0/37be0eec +0 -0
- package/package.json +3 -3
- package/src/components/content-metadata/content-metadata-form.tsx +761 -0
- package/src/components/content-metadata/content-rights.tsx +104 -0
- package/src/components/content-metadata/content-warnings.tsx +100 -0
- package/src/components/content-metadata/index.tsx +18 -0
- package/src/components/dashboard/header.tsx +37 -3
- package/src/components/dashboard/index.tsx +1 -1
- package/src/components/dashboard/problems.tsx +57 -46
- package/src/components/mobile-player/player.tsx +5 -0
- package/src/components/mobile-player/ui/report-modal.tsx +13 -7
- package/src/components/mobile-player/ui/viewer-context-menu.tsx +100 -1
- package/src/components/ui/button.tsx +10 -13
- package/src/components/ui/checkbox.tsx +147 -0
- package/src/components/ui/dialog.tsx +319 -99
- package/src/components/ui/dropdown.tsx +27 -13
- package/src/components/ui/icons.tsx +14 -0
- package/src/components/ui/primitives/button.tsx +0 -7
- package/src/components/ui/primitives/input.tsx +19 -2
- package/src/components/ui/primitives/modal.tsx +4 -2
- package/src/components/ui/select.tsx +175 -0
- package/src/components/ui/textarea.tsx +47 -29
- package/src/components/ui/toast.tsx +785 -179
- package/src/components/ui/tooltip.tsx +131 -0
- package/src/index.tsx +3 -0
- package/src/lib/metadata-constants.ts +180 -0
- package/src/lib/theme/theme.tsx +10 -6
- package/src/lib/theme/tokens.ts +9 -0
- package/src/streamplace-provider/index.tsx +20 -2
- package/src/streamplace-store/content-metadata-actions.tsx +142 -0
- package/src/streamplace-store/graph.tsx +232 -0
- package/src/streamplace-store/streamplace-store.tsx +30 -4
- package/src/streamplace-store/user.tsx +71 -7
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -109,7 +109,7 @@ export const Button = forwardRef<any, ButtonProps>(
|
|
|
109
109
|
{ borderRadius: zero.borderRadius.md },
|
|
110
110
|
],
|
|
111
111
|
inner: { gap: 4 },
|
|
112
|
-
text:
|
|
112
|
+
text: zero.typography.universal.sm,
|
|
113
113
|
};
|
|
114
114
|
case "lg":
|
|
115
115
|
return {
|
|
@@ -118,8 +118,8 @@ export const Button = forwardRef<any, ButtonProps>(
|
|
|
118
118
|
zero.py[3],
|
|
119
119
|
{ borderRadius: zero.borderRadius.md },
|
|
120
120
|
],
|
|
121
|
-
inner: { gap:
|
|
122
|
-
text:
|
|
121
|
+
inner: { gap: 12 },
|
|
122
|
+
text: zero.typography.universal.lg,
|
|
123
123
|
};
|
|
124
124
|
case "xl":
|
|
125
125
|
return {
|
|
@@ -129,17 +129,17 @@ export const Button = forwardRef<any, ButtonProps>(
|
|
|
129
129
|
{ borderRadius: zero.borderRadius.lg },
|
|
130
130
|
],
|
|
131
131
|
inner: { gap: 12 },
|
|
132
|
-
text:
|
|
132
|
+
text: zero.typography.universal.xl,
|
|
133
133
|
};
|
|
134
134
|
case "pill":
|
|
135
135
|
return {
|
|
136
136
|
button: [
|
|
137
|
-
zero.px[
|
|
138
|
-
zero.py[
|
|
137
|
+
zero.px[2],
|
|
138
|
+
zero.py[1],
|
|
139
139
|
{ borderRadius: zero.borderRadius.full },
|
|
140
140
|
],
|
|
141
141
|
inner: { gap: 4 },
|
|
142
|
-
text:
|
|
142
|
+
text: zero.typography.universal.xs,
|
|
143
143
|
};
|
|
144
144
|
case "md":
|
|
145
145
|
default:
|
|
@@ -150,7 +150,7 @@ export const Button = forwardRef<any, ButtonProps>(
|
|
|
150
150
|
{ borderRadius: zero.borderRadius.md },
|
|
151
151
|
],
|
|
152
152
|
inner: { gap: 6 },
|
|
153
|
-
text:
|
|
153
|
+
text: zero.typography.universal.sm,
|
|
154
154
|
};
|
|
155
155
|
}
|
|
156
156
|
}, [size, zt]);
|
|
@@ -211,15 +211,12 @@ export const Button = forwardRef<any, ButtonProps>(
|
|
|
211
211
|
<ActivityIndicator size={spinnerSize} color={spinnerColor} />
|
|
212
212
|
</ButtonPrimitive.Icon>
|
|
213
213
|
) : leftIcon ? (
|
|
214
|
-
<ButtonPrimitive.Icon
|
|
215
|
-
position="left"
|
|
216
|
-
style={{ width: iconSize, height: iconSize }}
|
|
217
|
-
>
|
|
214
|
+
<ButtonPrimitive.Icon position="left">
|
|
218
215
|
{leftIcon}
|
|
219
216
|
</ButtonPrimitive.Icon>
|
|
220
217
|
) : null}
|
|
221
218
|
|
|
222
|
-
<TextPrimitive.Root style={[textStyle, sizeStyles.text]}>
|
|
219
|
+
<TextPrimitive.Root style={[textStyle as any, sizeStyles.text]}>
|
|
223
220
|
{loading && loadingText ? loadingText : children}
|
|
224
221
|
</TextPrimitive.Root>
|
|
225
222
|
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { Check } from "lucide-react-native";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { StyleSheet, TouchableOpacity, View } from "react-native";
|
|
4
|
+
import { useTheme } from "../../lib/theme/theme";
|
|
5
|
+
import { Text } from "./text";
|
|
6
|
+
|
|
7
|
+
export interface CheckboxProps {
|
|
8
|
+
checked: boolean;
|
|
9
|
+
onCheckedChange: (checked: boolean) => void;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
size?: "sm" | "md" | "lg";
|
|
12
|
+
label?: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
style?: any;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const Checkbox = forwardRef<any, CheckboxProps>(
|
|
18
|
+
(
|
|
19
|
+
{
|
|
20
|
+
checked,
|
|
21
|
+
onCheckedChange,
|
|
22
|
+
disabled = false,
|
|
23
|
+
size = "md",
|
|
24
|
+
label,
|
|
25
|
+
description,
|
|
26
|
+
style,
|
|
27
|
+
...props
|
|
28
|
+
},
|
|
29
|
+
ref,
|
|
30
|
+
) => {
|
|
31
|
+
const { theme } = useTheme();
|
|
32
|
+
|
|
33
|
+
const handlePress = () => {
|
|
34
|
+
if (!disabled) {
|
|
35
|
+
onCheckedChange(!checked);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const styles = createStyles(theme, size, disabled, checked);
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<TouchableOpacity
|
|
43
|
+
ref={ref}
|
|
44
|
+
style={[styles.container, style]}
|
|
45
|
+
onPress={handlePress}
|
|
46
|
+
disabled={disabled}
|
|
47
|
+
{...props}
|
|
48
|
+
>
|
|
49
|
+
<View style={styles.checkbox}>
|
|
50
|
+
{checked && (
|
|
51
|
+
<Check
|
|
52
|
+
size={size === "sm" ? 12 : size === "lg" ? 18 : 14}
|
|
53
|
+
color={
|
|
54
|
+
disabled
|
|
55
|
+
? theme.colors.textDisabled
|
|
56
|
+
: theme.colors.primaryForeground
|
|
57
|
+
}
|
|
58
|
+
/>
|
|
59
|
+
)}
|
|
60
|
+
</View>
|
|
61
|
+
{(label || description) && (
|
|
62
|
+
<View style={styles.content}>
|
|
63
|
+
{label && <Text style={styles.label}>{label}</Text>}
|
|
64
|
+
{description && (
|
|
65
|
+
<Text style={styles.description}>{description}</Text>
|
|
66
|
+
)}
|
|
67
|
+
</View>
|
|
68
|
+
)}
|
|
69
|
+
</TouchableOpacity>
|
|
70
|
+
);
|
|
71
|
+
},
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
Checkbox.displayName = "Checkbox";
|
|
75
|
+
|
|
76
|
+
function createStyles(
|
|
77
|
+
theme: any,
|
|
78
|
+
size: string,
|
|
79
|
+
disabled: boolean,
|
|
80
|
+
checked: boolean,
|
|
81
|
+
) {
|
|
82
|
+
const sizeStyles = {
|
|
83
|
+
sm: {
|
|
84
|
+
checkboxSize: 16,
|
|
85
|
+
borderRadius: 2,
|
|
86
|
+
padding: theme.spacing[1],
|
|
87
|
+
gap: theme.spacing[1],
|
|
88
|
+
},
|
|
89
|
+
md: {
|
|
90
|
+
checkboxSize: 20,
|
|
91
|
+
borderRadius: 4,
|
|
92
|
+
padding: theme.spacing[1],
|
|
93
|
+
gap: theme.spacing[2],
|
|
94
|
+
},
|
|
95
|
+
lg: {
|
|
96
|
+
checkboxSize: 24,
|
|
97
|
+
borderRadius: 6,
|
|
98
|
+
padding: theme.spacing[2],
|
|
99
|
+
gap: theme.spacing[3],
|
|
100
|
+
},
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
const currentSize = sizeStyles[size as keyof typeof sizeStyles];
|
|
104
|
+
|
|
105
|
+
return StyleSheet.create({
|
|
106
|
+
container: {
|
|
107
|
+
flexDirection: "row",
|
|
108
|
+
alignItems: "flex-start",
|
|
109
|
+
opacity: disabled ? 0.5 : 1,
|
|
110
|
+
},
|
|
111
|
+
checkbox: {
|
|
112
|
+
width: currentSize.checkboxSize,
|
|
113
|
+
height: currentSize.checkboxSize,
|
|
114
|
+
borderWidth: 1.5,
|
|
115
|
+
borderColor: disabled
|
|
116
|
+
? theme.colors.border
|
|
117
|
+
: checked
|
|
118
|
+
? theme.colors.primary
|
|
119
|
+
: theme.colors.border,
|
|
120
|
+
borderRadius: currentSize.borderRadius,
|
|
121
|
+
backgroundColor: disabled
|
|
122
|
+
? theme.colors.muted
|
|
123
|
+
: checked
|
|
124
|
+
? theme.colors.primary
|
|
125
|
+
: "transparent",
|
|
126
|
+
alignItems: "center",
|
|
127
|
+
justifyContent: "center",
|
|
128
|
+
},
|
|
129
|
+
content: {
|
|
130
|
+
flex: 1,
|
|
131
|
+
paddingTop: currentSize.padding * 0.5,
|
|
132
|
+
paddingLeft: theme.spacing[2],
|
|
133
|
+
},
|
|
134
|
+
label: {
|
|
135
|
+
fontSize: size === "sm" ? 14 : size === "lg" ? 18 : 16,
|
|
136
|
+
fontWeight: "500",
|
|
137
|
+
color: disabled ? theme.colors.textDisabled : theme.colors.text,
|
|
138
|
+
lineHeight: size === "sm" ? 18 : size === "lg" ? 22 : 20,
|
|
139
|
+
},
|
|
140
|
+
description: {
|
|
141
|
+
fontSize: size === "sm" ? 12 : size === "lg" ? 16 : 14,
|
|
142
|
+
color: disabled ? theme.colors.textDisabled : theme.colors.textMuted,
|
|
143
|
+
marginTop: theme.spacing[1],
|
|
144
|
+
lineHeight: size === "sm" ? 16 : size === "lg" ? 20 : 18,
|
|
145
|
+
},
|
|
146
|
+
});
|
|
147
|
+
}
|