@plexui/react-native 0.2.32 → 0.3.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/es/components/Dialog/Dialog.js +13 -3
- package/dist/es/components/SignInButton/SignInButton.js +85 -0
- package/dist/es/icons/plex/AppleLogo.js +3 -0
- package/dist/es/icons/plex/GoogleLogo.js +3 -0
- package/dist/es/icons/plex/MicrosoftLogo.js +3 -0
- package/dist/es/icons/plex/index.js +3 -0
- package/dist/es/index.js +1 -0
- package/dist/types/components/Dialog/Dialog.d.ts +6 -2
- package/dist/types/components/SignInButton/SignInButton.d.ts +37 -0
- package/dist/types/icons/plex/AppleLogo.d.ts +2 -0
- package/dist/types/icons/plex/GoogleLogo.d.ts +2 -0
- package/dist/types/icons/plex/MicrosoftLogo.d.ts +2 -0
- package/dist/types/icons/plex/index.d.ts +3 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/Dialog/Dialog.tsx +33 -14
- package/src/components/SignInButton/SignInButton.tsx +168 -0
- package/src/icons/plex/AppleLogo.ts +4 -0
- package/src/icons/plex/GoogleLogo.ts +4 -0
- package/src/icons/plex/MicrosoftLogo.ts +4 -0
- package/src/icons/plex/index.ts +3 -0
- package/src/index.ts +1 -0
|
@@ -44,7 +44,13 @@ function DialogView({ open, onOpenChange, title, description, actions = [], chil
|
|
|
44
44
|
const ids = { title: useId(), description: useId() };
|
|
45
45
|
// The web names the alert dialog by its title and describes it by its message; a phone keeps the modal view
|
|
46
46
|
const a11y = Platform.OS === "web"
|
|
47
|
-
? {
|
|
47
|
+
? {
|
|
48
|
+
role: "alertdialog",
|
|
49
|
+
"aria-modal": true,
|
|
50
|
+
// A dialog without a title is named by its message
|
|
51
|
+
"aria-labelledby": title != null ? ids.title : description != null ? ids.description : undefined,
|
|
52
|
+
"aria-describedby": title != null && description != null ? ids.description : undefined,
|
|
53
|
+
}
|
|
48
54
|
: { accessibilityRole: "alert", accessibilityViewIsModal: true };
|
|
49
55
|
if (theme.isAndroid) {
|
|
50
56
|
return (_jsx(AndroidFrame, { open: open, onClose: close, dismissible: dismissible ?? true, a11y: a11y, testID: testID, children: _jsx(AndroidDialog, { theme: theme, title: title, description: description, actions: actions, run: run, ids: ids, layout: mobileLayout, children: children }) }));
|
|
@@ -165,7 +171,9 @@ function IOSAlert({ theme, title, description, actions, run, ids, layout, childr
|
|
|
165
171
|
_jsx(View, { pointerEvents: "none", "aria-hidden": true, style: styles.measure, children: actions.map((action, index) => (_jsx(Text, { weight: action.preferred ? "semibold" : "medium", numberOfLines: 1, style: type, onLayout: (event) => {
|
|
166
172
|
const next = event.nativeEvent.layout.width;
|
|
167
173
|
setLabels((current) => (current[index] === next ? current : Object.assign([...current], { [index]: next })));
|
|
168
|
-
}, children: action.label }, index))) })) : null, _jsxs(ScrollView, { style: styles.scroll, contentContainerStyle: { gap: 10 }, bounces: false, children: [_jsxs(View, { style: { paddingTop: 5, paddingHorizontal: 15, paddingBottom: 5.5, gap: 5.67 }, children: [_jsx(Text, { nativeID: ids.title, weight: "semibold", style: [type, { textAlign: description == null ? "center" : "auto" }], accessibilityRole: "header", children: title })
|
|
174
|
+
}, children: action.label }, index))) })) : null, _jsxs(ScrollView, { style: styles.scroll, contentContainerStyle: { gap: 10 }, bounces: false, children: [_jsxs(View, { style: { paddingTop: 5, paddingHorizontal: 15, paddingBottom: 5.5, gap: 5.67 }, children: [title != null ? (_jsx(Text, { nativeID: ids.title, weight: "semibold", style: [type, { textAlign: description == null ? "center" : "auto" }], accessibilityRole: "header", children: title })) : null, description != null ? (
|
|
175
|
+
// Without a title the message is the alert's whole text, in the label color (UIAlertController with a nil title)
|
|
176
|
+
_jsx(Text, { nativeID: ids.description, color: title != null ? theme.color("--dialog-alert-message-color") : undefined, style: { fontSize: 15, lineHeight: 20 }, children: description })) : null] }), children != null ? (
|
|
169
177
|
// A field fills the alert as its actions do: the largest control size is the alert's 48 there
|
|
170
178
|
// (Dialog.module.css sets --control-size-3xl to --dialog-alert-field-height in the alert's body)
|
|
171
179
|
_jsx(ThemeProvider, { brand: { tokens: { "--control-size-3xl": `${theme.length("--dialog-alert-field-height", 48)}px` } }, children: _jsx(View, { style: { paddingBottom: 10, marginHorizontal: -1 }, children: children }) })) : null] }), ordered.length ? (_jsx(View, { style: [{ gap, marginTop: children != null ? 0 : 4 }, inline ? styles.row : null], children: ordered.map(({ action, index }) => (_jsx(IOSAction, { theme: theme, action: action, run: run, type: type, grow: inline }, index))) })) : null] }));
|
|
@@ -236,7 +244,9 @@ function AndroidDialog({ theme, title, description, actions, run, ids, children,
|
|
|
236
244
|
};
|
|
237
245
|
return (_jsxs(View, { style: [styles.android, { width, backgroundColor: androidDialogBackground(theme), opacity: ready ? 1 : 0 }], children: [list != null ? (
|
|
238
246
|
// A list: the title stays, 14 over the rows, and the rows scroll under it (AlertDialog with a custom view)
|
|
239
|
-
_jsxs(_Fragment, { children: [title != null ? (_jsx(Text, { nativeID: ids.title, color: m.onSurface, accessibilityRole: "header", style: [styles.androidTitle, styles.androidListTitle, theme.font("medium")], children: title })) : null, _jsx(ScrollView, { style: styles.scroll, contentContainerStyle: title != null ? null : styles.androidListTop, bounces: false, children: list })] })) : (_jsxs(ScrollView, { style: styles.scroll, contentContainerStyle: styles.androidText, bounces: false, children: [_jsx(Text, { nativeID: ids.title, color: m.onSurface, accessibilityRole: "header", style: [styles.androidTitle, theme.font("medium")], children: title })
|
|
247
|
+
_jsxs(_Fragment, { children: [title != null ? (_jsx(Text, { nativeID: ids.title, color: m.onSurface, accessibilityRole: "header", style: [styles.androidTitle, styles.androidListTitle, theme.font("medium")], children: title })) : null, _jsx(ScrollView, { style: styles.scroll, contentContainerStyle: title != null ? null : styles.androidListTop, bounces: false, children: list })] })) : (_jsxs(ScrollView, { style: styles.scroll, contentContainerStyle: styles.androidText, bounces: false, children: [title != null ? (_jsx(Text, { nativeID: ids.title, color: m.onSurface, accessibilityRole: "header", style: [styles.androidTitle, theme.font("medium")], children: title })) : null, description != null ? (
|
|
248
|
+
// Material 3's dialog with no headline: the supporting text alone, in onSurfaceVariant
|
|
249
|
+
_jsx(Text, { nativeID: ids.description, color: title != null ? m.onSurface : m.onSurfaceVariant, style: styles.androidMessage, children: description })) : null, children != null ? _jsx(View, { style: styles.androidContent, children: children }) : null] })), bar.length ? (_jsx(View, { onLayout: (event) => setRoom(event.nativeEvent.layout.width - 16), style: stacked ? styles.androidStack : styles.androidActions, children: order.map((index) =>
|
|
240
250
|
// The neutral actions at the start, a space, then the negative and the positive
|
|
241
251
|
!stacked && index === neutral.length && neutral.length ? [_jsx(View, { style: styles.grow }, "space"), button(index)] : button(index)) })) : null] }));
|
|
242
252
|
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { Platform, StyleSheet, Text, View } from "react-native";
|
|
4
|
+
import { Pressable } from "../../internal/Pressable";
|
|
5
|
+
import { useRipple } from "../../internal/ripple";
|
|
6
|
+
import { withAlpha } from "../../theme/material";
|
|
7
|
+
import { useTheme } from "../../theme/ThemeProvider";
|
|
8
|
+
import AppleLogo from "../../icons/plex/AppleLogo";
|
|
9
|
+
import GoogleLogo from "../../icons/plex/GoogleLogo";
|
|
10
|
+
import { buttonMetrics, useMaterialPress } from "../Button/Button";
|
|
11
|
+
const LABEL = { "sign-in": "Sign in with", "sign-up": "Sign up with", continue: "Continue with" };
|
|
12
|
+
/** Apple HIG, Sign in with Apple: black with white content, or white with black content on dark or over media. */
|
|
13
|
+
function appleLook(white) {
|
|
14
|
+
return white ? { background: "#FFFFFF", text: "#000000" } : { background: "#000000", text: "#FFFFFF" };
|
|
15
|
+
}
|
|
16
|
+
/** Google Sign-In branding guidelines: the light, dark and neutral buttons. */
|
|
17
|
+
function googleLook(dark, neutral) {
|
|
18
|
+
if (neutral)
|
|
19
|
+
return { background: "#F2F2F2", text: "#1F1F1F" };
|
|
20
|
+
return dark ? { background: "#131314", text: "#E3E3E3", border: "#8E918F" } : { background: "#FFFFFF", text: "#1F1F1F", border: "#747775" };
|
|
21
|
+
}
|
|
22
|
+
// The logos' drawn ink inside their 24-unit boxes: the G spans 2.95–21.05, so at 24px it stands 2.95px in from each
|
|
23
|
+
// side; Apple's mark spans 3.36–20.64 of its width
|
|
24
|
+
const GOOGLE_ICON = 24;
|
|
25
|
+
const GOOGLE_INSET = 2.95;
|
|
26
|
+
const APPLE_ICON = 20;
|
|
27
|
+
/**
|
|
28
|
+
* The sign-in button of a provider, drawn to its brand rules rather than to the theme: Apple's black or white button
|
|
29
|
+
* with the real Apple logo, Google's light, dark or neutral one with the four-color G. It takes the height and the
|
|
30
|
+
* shape of the screen's other buttons (a capsule on iOS, a pill on Android). Disabled keeps the brand's colors at 40%.
|
|
31
|
+
*/
|
|
32
|
+
export function SignInButton({ provider, action = "continue", scheme, overMedia = false, neutral = false, size = "xl", block = true, disabled = false, style, onPressIn, onPressOut, accessibilityLabel, accessibilityState, ...rest }) {
|
|
33
|
+
const theme = useTheme();
|
|
34
|
+
const dark = (scheme ?? theme.scheme) === "dark";
|
|
35
|
+
const apple = provider === "apple";
|
|
36
|
+
const look = apple ? appleLook(dark || overMedia) : googleLook(dark, neutral);
|
|
37
|
+
const metrics = buttonMetrics(theme, size);
|
|
38
|
+
const label = `${LABEL[action]} ${apple ? "Apple" : "Google"}`;
|
|
39
|
+
const [pressed, setPressed] = useState(false);
|
|
40
|
+
const android = theme.isAndroid;
|
|
41
|
+
const nativeRipple = useMaterialPress(theme);
|
|
42
|
+
const ripple = useRipple(withAlpha(look.text, 0.1), android && !nativeRipple, theme.reducedMotion);
|
|
43
|
+
// Google's spacing: 16 before the G, 12 to the text and 16 after on iOS; 12, 10 and 12 on Android
|
|
44
|
+
const google = android ? { start: 12, gap: 10, end: 12 } : { start: 16, gap: 12, end: 16 };
|
|
45
|
+
const radius = metrics.height / 2;
|
|
46
|
+
// A compact size keeps the platform's 44pt or 48dp target, as Button does
|
|
47
|
+
const reach = Math.max(0, ((android ? 48 : 44) - metrics.height) / 2);
|
|
48
|
+
const padding = apple
|
|
49
|
+
? // Apple asks for a margin of at least a tenth of the height around the logo and the title
|
|
50
|
+
{ paddingHorizontal: Math.max(metrics.height / 10, 16) }
|
|
51
|
+
: { paddingLeft: google.start - GOOGLE_INSET, paddingRight: google.end };
|
|
52
|
+
return (_jsxs(Pressable, { accessibilityRole: "button", accessibilityLabel: accessibilityLabel ?? label, accessibilityState: { ...accessibilityState, disabled }, disabled: disabled, hitSlop: reach ? { top: reach, bottom: reach } : undefined, android_ripple: nativeRipple ? { color: withAlpha(look.text, 0.1), foreground: true } : undefined, onPressIn: (event) => {
|
|
53
|
+
setPressed(true);
|
|
54
|
+
ripple.start(event);
|
|
55
|
+
onPressIn?.(event);
|
|
56
|
+
}, onPressOut: (event) => {
|
|
57
|
+
setPressed(false);
|
|
58
|
+
ripple.end();
|
|
59
|
+
onPressOut?.(event);
|
|
60
|
+
}, style: [
|
|
61
|
+
styles.button,
|
|
62
|
+
{
|
|
63
|
+
// At least the size's height: a larger text size grows the button instead of clipping its title
|
|
64
|
+
minHeight: metrics.height,
|
|
65
|
+
paddingVertical: 4,
|
|
66
|
+
minWidth: 140,
|
|
67
|
+
borderRadius: radius,
|
|
68
|
+
backgroundColor: look.background,
|
|
69
|
+
alignSelf: block ? "stretch" : "center",
|
|
70
|
+
opacity: disabled ? 0.4 : 1,
|
|
71
|
+
},
|
|
72
|
+
padding,
|
|
73
|
+
style,
|
|
74
|
+
], ...rest, children: [ripple.layer, pressed && !android && _jsx(View, { pointerEvents: "none", style: [StyleSheet.absoluteFill, { borderRadius: radius, backgroundColor: withAlpha(look.text, 0.12) }] }), look.border && _jsx(View, { pointerEvents: "none", style: [StyleSheet.absoluteFill, { borderRadius: radius, borderWidth: 1, borderColor: look.border }] }), _jsxs(View, { style: [styles.content, { gap: apple ? 6 : google.gap - GOOGLE_INSET }], accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants", children: [apple ? _jsx(AppleLogo, { size: APPLE_ICON, color: look.text }) : _jsx(GoogleLogo, { size: GOOGLE_ICON }), _jsx(Text, { numberOfLines: 1, allowFontScaling: true, style: apple
|
|
75
|
+
? // The system font, as Apple's button sets its title
|
|
76
|
+
{ color: look.text, fontSize: metrics.fontSize, lineHeight: metrics.lineHeight, fontWeight: "500" }
|
|
77
|
+
: // Google Sans Medium 14/20 where the app has it, else the system font
|
|
78
|
+
{ color: look.text, fontSize: 14, lineHeight: 20, fontWeight: "500", fontFamily: GOOGLE_FONT }, children: label })] })] }));
|
|
79
|
+
}
|
|
80
|
+
/** The font the Google button asks for: an app that bundles Google Sans gets it; elsewhere the system font stands in. */
|
|
81
|
+
const GOOGLE_FONT = Platform.select({ web: "'Google Sans', system-ui, sans-serif", default: undefined });
|
|
82
|
+
const styles = StyleSheet.create({
|
|
83
|
+
button: { flexDirection: "row", alignItems: "center", justifyContent: "center", overflow: "hidden" },
|
|
84
|
+
content: { flexDirection: "row", alignItems: "center", justifyContent: "center", flexShrink: 1 },
|
|
85
|
+
});
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// Generated by scripts/build-icons.mjs. Do not edit.
|
|
2
|
+
import { createIcon } from "../../components/Icon/createIcon";
|
|
3
|
+
export default createIcon("AppleLogo", "0 0 24 24", [["path", { "d": "M20.0911 7.2368C19.3972 7.66168 18.8223 8.25568 18.4204 8.96321C18.0185 9.67075 17.8027 10.4687 17.7932 11.2823C17.7959 12.1981 18.0672 13.0929 18.5735 13.856C19.0798 14.6191 19.7988 15.2169 20.6415 15.5754C20.3093 16.6474 19.8176 17.6632 19.1829 18.5888C18.2748 19.8961 17.3253 21.2032 15.8805 21.2032C14.4358 21.2032 14.0642 20.3638 12.3992 20.3638C10.7755 20.3638 10.1976 21.2308 8.87662 21.2308C7.55564 21.2308 6.63382 20.0198 5.57424 18.5338C4.17461 16.452 3.4054 14.0106 3.35889 11.5024C3.35889 7.37443 6.04214 5.18665 8.68397 5.18665C10.0875 5.18665 11.2572 6.10847 12.1378 6.10847C12.9772 6.10847 14.2844 5.1315 15.8805 5.1315C16.7012 5.11032 17.5145 5.29127 18.2487 5.6584C18.983 6.02553 19.6157 6.56757 20.0911 7.2368ZM15.1238 3.38405C15.8274 2.55637 16.2257 1.51233 16.2521 0.426336C16.2533 0.28317 16.2395 0.140275 16.2108 0C15.0022 0.11806 13.8846 0.694096 13.0872 1.60995C12.3769 2.40465 11.9636 3.42081 11.9176 4.48573C11.9181 4.61524 11.932 4.74435 11.9589 4.87103C12.0542 4.88904 12.1509 4.89827 12.2479 4.89861C12.8049 4.85429 13.347 4.69717 13.8414 4.4368C14.3358 4.17644 14.7721 3.81826 15.1238 3.38405Z", "fill": 0 }]]);
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// Generated by scripts/build-icons.mjs. Do not edit.
|
|
2
|
+
import { createIcon } from "../../components/Icon/createIcon";
|
|
3
|
+
export default createIcon("GoogleLogo", "0 0 24 24", [["path", { "d": "M21.0461 12.2099C21.0461 11.5553 20.9874 10.9259 20.8783 10.3217H12.1846V13.8966H17.1524C16.9342 15.0462 16.2797 16.0197 15.2979 16.6742V18.9987H18.2937C20.0391 17.3875 21.0461 15.0211 21.0461 12.2099Z", "fill": "#4285F4" }], ["path", { "d": "M12.1844 21.2307C14.6767 21.2307 16.7662 20.4084 18.2935 18.9986L15.2977 16.6741C14.4753 17.2279 13.4264 17.5636 12.1844 17.5636C9.78441 17.5636 7.74525 15.944 7.01518 13.7622H3.94385V16.1454C5.46273 19.158 8.57602 21.2307 12.1844 21.2307Z", "fill": "#34A853" }], ["path", { "d": "M7.01516 13.7539C6.83054 13.2 6.72145 12.6126 6.72145 12C6.72145 11.3874 6.83054 10.8 7.01516 10.2462V7.86295H3.94382C3.31445 9.10491 2.95361 10.5063 2.95361 12C2.95361 13.4937 3.31445 14.8951 3.94382 16.1371L6.33544 14.2741L7.01516 13.7539Z", "fill": "#FBBC05" }], ["path", { "d": "M12.1844 6.44475C13.5439 6.44475 14.7522 6.91469 15.7173 7.82098L18.3606 5.17762C16.7578 3.68391 14.6767 2.76923 12.1844 2.76923C8.57602 2.76923 5.46273 4.84196 3.94385 7.86294L7.01518 10.2462C7.74525 8.06434 9.78441 6.44475 12.1844 6.44475Z", "fill": "#EA4335" }]]);
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// Generated by scripts/build-icons.mjs. Do not edit.
|
|
2
|
+
import { createIcon } from "../../components/Icon/createIcon";
|
|
3
|
+
export default createIcon("MicrosoftLogo", "0 0 24 24", [["path", { "d": "M3.25 3.25H11.25V11.25H3.25V3.25Z", "fill": "#F35325" }], ["path", { "d": "M12.75 3.25H20.75V11.25H12.75V3.25Z", "fill": "#81BC06" }], ["path", { "d": "M3.25 12.75H11.25V20.75H3.25V12.75Z", "fill": "#05A6F0" }], ["path", { "d": "M12.75 12.75H20.75V20.75H12.75V12.75Z", "fill": "#FFBA08" }]]);
|
|
@@ -20,6 +20,7 @@ export { default as AppPermission } from "./AppPermission";
|
|
|
20
20
|
export { default as AppStore } from "./AppStore";
|
|
21
21
|
export { default as AppStoreSquare } from "./AppStoreSquare";
|
|
22
22
|
export { default as Apple } from "./Apple";
|
|
23
|
+
export { default as AppleLogo } from "./AppleLogo";
|
|
23
24
|
export { default as Archive } from "./Archive";
|
|
24
25
|
export { default as Array } from "./Array";
|
|
25
26
|
export { default as ArrowBottomLeftSm } from "./ArrowBottomLeftSm";
|
|
@@ -268,6 +269,7 @@ export { default as GlobeAlt } from "./GlobeAlt";
|
|
|
268
269
|
export { default as GlobeFilled } from "./GlobeFilled";
|
|
269
270
|
export { default as GlobeOff } from "./GlobeOff";
|
|
270
271
|
export { default as GlobeSpin } from "./GlobeSpin";
|
|
272
|
+
export { default as GoogleLogo } from "./GoogleLogo";
|
|
271
273
|
export { default as Grid } from "./Grid";
|
|
272
274
|
export { default as GridAlt } from "./GridAlt";
|
|
273
275
|
export { default as GripHorizontal } from "./GripHorizontal";
|
|
@@ -361,6 +363,7 @@ export { default as Mic } from "./Mic";
|
|
|
361
363
|
export { default as MicFilled } from "./MicFilled";
|
|
362
364
|
export { default as MicFilledOff } from "./MicFilledOff";
|
|
363
365
|
export { default as MicOff } from "./MicOff";
|
|
366
|
+
export { default as MicrosoftLogo } from "./MicrosoftLogo";
|
|
364
367
|
export { default as MinimizeDown } from "./MinimizeDown";
|
|
365
368
|
export { default as MinimizeLeft } from "./MinimizeLeft";
|
|
366
369
|
export { default as MinimizeRight } from "./MinimizeRight";
|
package/dist/es/index.js
CHANGED
|
@@ -14,6 +14,7 @@ export { Toolbar, } from "./components/Toolbar/Toolbar";
|
|
|
14
14
|
export { TabBar, useTabBarMetrics, useTabBarMinimize, } from "./components/TabBar/TabBar";
|
|
15
15
|
export { SegmentedControl, } from "./components/SegmentedControl/SegmentedControl";
|
|
16
16
|
export { Switch } from "./components/Switch/Switch";
|
|
17
|
+
export { SignInButton } from "./components/SignInButton/SignInButton";
|
|
17
18
|
export { Checkbox } from "./components/Checkbox/Checkbox";
|
|
18
19
|
export { RadioGroup } from "./components/RadioGroup/RadioGroup";
|
|
19
20
|
export { Input, InputAdornmentButton, TextField } from "./components/Input/Input";
|
|
@@ -15,8 +15,12 @@ export type DialogAction = {
|
|
|
15
15
|
export type DialogProps = {
|
|
16
16
|
open: boolean;
|
|
17
17
|
onOpenChange: (open: boolean) => void;
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
/**
|
|
19
|
+
* The title. Without one the dialog is its message alone: an iOS alert with only a message, a Material 3 dialog
|
|
20
|
+
* with only its supporting text.
|
|
21
|
+
*/
|
|
22
|
+
title?: ReactNode;
|
|
23
|
+
/** The message under the title, or the whole text of a dialog without one. */
|
|
20
24
|
description?: ReactNode;
|
|
21
25
|
/** The actions; two stand side by side on iOS, three or more stack. */
|
|
22
26
|
actions?: DialogAction[];
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type ComponentRef, type Ref } from "react";
|
|
2
|
+
import { View, type PressableProps, type StyleProp, type ViewStyle } from "react-native";
|
|
3
|
+
import { type ControlSize } from "../Button/Button";
|
|
4
|
+
export type SignInProvider = "apple" | "google";
|
|
5
|
+
export type SignInAction = "sign-in" | "sign-up" | "continue";
|
|
6
|
+
export type SignInButtonProps = Omit<PressableProps, "children" | "style"> & {
|
|
7
|
+
/** Whose sign-in: Apple's (an iOS app's) or Google's (iOS and Android alike). */
|
|
8
|
+
provider: SignInProvider;
|
|
9
|
+
/** The label, one of the brands' own: Sign in with…, Sign up with… or Continue with…. @default "continue" */
|
|
10
|
+
action?: SignInAction;
|
|
11
|
+
/**
|
|
12
|
+
* The brand look against the screen. Apple: black in a light scheme, white in a dark one (never black on dark).
|
|
13
|
+
* Google: light (white with a #747775 outline) or dark (#131314 with a #8E918F outline). Defaults to the theme's.
|
|
14
|
+
*/
|
|
15
|
+
scheme?: "light" | "dark";
|
|
16
|
+
/** Over a photo or a video: Apple's white button. */
|
|
17
|
+
overMedia?: boolean;
|
|
18
|
+
/** Google's neutral button: #F2F2F2 with no outline. */
|
|
19
|
+
neutral?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Height step of the Button scale, so the button matches the screen's other buttons: iOS's large 50 and Android's
|
|
22
|
+
* 48 from `xl`. @default "xl"
|
|
23
|
+
*/
|
|
24
|
+
size?: ControlSize;
|
|
25
|
+
/** Takes the whole width. @default true */
|
|
26
|
+
block?: boolean;
|
|
27
|
+
/** Keeps the brand's colors, dimmed to 40%, and takes no presses. */
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
style?: StyleProp<ViewStyle>;
|
|
30
|
+
ref?: Ref<ComponentRef<typeof View>>;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* The sign-in button of a provider, drawn to its brand rules rather than to the theme: Apple's black or white button
|
|
34
|
+
* with the real Apple logo, Google's light, dark or neutral one with the four-color G. It takes the height and the
|
|
35
|
+
* shape of the screen's other buttons (a capsule on iOS, a pill on Android). Disabled keeps the brand's colors at 40%.
|
|
36
|
+
*/
|
|
37
|
+
export declare function SignInButton({ provider, action, scheme, overMedia, neutral, size, block, disabled, style, onPressIn, onPressOut, accessibilityLabel, accessibilityState, ...rest }: SignInButtonProps): import("react").JSX.Element;
|
|
@@ -18,6 +18,7 @@ export { default as AppPermission } from "./AppPermission";
|
|
|
18
18
|
export { default as AppStore } from "./AppStore";
|
|
19
19
|
export { default as AppStoreSquare } from "./AppStoreSquare";
|
|
20
20
|
export { default as Apple } from "./Apple";
|
|
21
|
+
export { default as AppleLogo } from "./AppleLogo";
|
|
21
22
|
export { default as Archive } from "./Archive";
|
|
22
23
|
export { default as Array } from "./Array";
|
|
23
24
|
export { default as ArrowBottomLeftSm } from "./ArrowBottomLeftSm";
|
|
@@ -266,6 +267,7 @@ export { default as GlobeAlt } from "./GlobeAlt";
|
|
|
266
267
|
export { default as GlobeFilled } from "./GlobeFilled";
|
|
267
268
|
export { default as GlobeOff } from "./GlobeOff";
|
|
268
269
|
export { default as GlobeSpin } from "./GlobeSpin";
|
|
270
|
+
export { default as GoogleLogo } from "./GoogleLogo";
|
|
269
271
|
export { default as Grid } from "./Grid";
|
|
270
272
|
export { default as GridAlt } from "./GridAlt";
|
|
271
273
|
export { default as GripHorizontal } from "./GripHorizontal";
|
|
@@ -359,6 +361,7 @@ export { default as Mic } from "./Mic";
|
|
|
359
361
|
export { default as MicFilled } from "./MicFilled";
|
|
360
362
|
export { default as MicFilledOff } from "./MicFilledOff";
|
|
361
363
|
export { default as MicOff } from "./MicOff";
|
|
364
|
+
export { default as MicrosoftLogo } from "./MicrosoftLogo";
|
|
362
365
|
export { default as MinimizeDown } from "./MinimizeDown";
|
|
363
366
|
export { default as MinimizeLeft } from "./MinimizeLeft";
|
|
364
367
|
export { default as MinimizeRight } from "./MinimizeRight";
|
package/dist/types/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export { Toolbar, type ToolbarBackground, type ToolbarContentProps, type Toolbar
|
|
|
13
13
|
export { TabBar, useTabBarMetrics, useTabBarMinimize, type TabBarBackground, type TabBarBadgeColor, type TabBarItemProps, type TabBarProminent, type TabBarProps, type TabBarSearch, } from "./components/TabBar/TabBar";
|
|
14
14
|
export { SegmentedControl, type SegmentedControlBadgeProp, type SegmentedControlOptionProps, type SegmentedControlProps, } from "./components/SegmentedControl/SegmentedControl";
|
|
15
15
|
export { Switch, type SwitchProps } from "./components/Switch/Switch";
|
|
16
|
+
export { SignInButton, type SignInAction, type SignInButtonProps, type SignInProvider } from "./components/SignInButton/SignInButton";
|
|
16
17
|
export { Checkbox, type CheckboxProps } from "./components/Checkbox/Checkbox";
|
|
17
18
|
export { RadioGroup, type RadioGroupItemProps, type RadioGroupProps } from "./components/RadioGroup/RadioGroup";
|
|
18
19
|
export { Input, InputAdornmentButton, TextField, type InputAdornmentButtonProps, type InputProps, type InputVariant, type TextFieldProps } from "./components/Input/Input";
|
package/package.json
CHANGED
|
@@ -28,8 +28,12 @@ export type DialogAction = {
|
|
|
28
28
|
export type DialogProps = {
|
|
29
29
|
open: boolean
|
|
30
30
|
onOpenChange: (open: boolean) => void
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
/**
|
|
32
|
+
* The title. Without one the dialog is its message alone: an iOS alert with only a message, a Material 3 dialog
|
|
33
|
+
* with only its supporting text.
|
|
34
|
+
*/
|
|
35
|
+
title?: ReactNode
|
|
36
|
+
/** The message under the title, or the whole text of a dialog without one. */
|
|
33
37
|
description?: ReactNode
|
|
34
38
|
/** The actions; two stand side by side on iOS, three or more stack. */
|
|
35
39
|
actions?: DialogAction[]
|
|
@@ -89,7 +93,13 @@ function DialogView({ open, onOpenChange, title, description, actions = [], chil
|
|
|
89
93
|
// The web names the alert dialog by its title and describes it by its message; a phone keeps the modal view
|
|
90
94
|
const a11y =
|
|
91
95
|
Platform.OS === "web"
|
|
92
|
-
? {
|
|
96
|
+
? {
|
|
97
|
+
role: "alertdialog" as const,
|
|
98
|
+
"aria-modal": true,
|
|
99
|
+
// A dialog without a title is named by its message
|
|
100
|
+
"aria-labelledby": title != null ? ids.title : description != null ? ids.description : undefined,
|
|
101
|
+
"aria-describedby": title != null && description != null ? ids.description : undefined,
|
|
102
|
+
}
|
|
93
103
|
: { accessibilityRole: "alert" as const, accessibilityViewIsModal: true }
|
|
94
104
|
if (theme.isAndroid) {
|
|
95
105
|
return (
|
|
@@ -304,7 +314,7 @@ export function PickerDialog({ open, onClose, onOk, cancelLabel, okLabel, label,
|
|
|
304
314
|
|
|
305
315
|
type PanelProps = {
|
|
306
316
|
theme: Theme
|
|
307
|
-
title
|
|
317
|
+
title?: ReactNode
|
|
308
318
|
description?: ReactNode
|
|
309
319
|
actions: DialogAction[]
|
|
310
320
|
run: (action: DialogAction) => void
|
|
@@ -313,8 +323,7 @@ type PanelProps = {
|
|
|
313
323
|
children?: ReactNode
|
|
314
324
|
}
|
|
315
325
|
|
|
316
|
-
type AndroidPanelProps =
|
|
317
|
-
title?: ReactNode
|
|
326
|
+
type AndroidPanelProps = PanelProps & {
|
|
318
327
|
/** Rows across the panel's width under the title, in place of the text (an Android dialog with a list of rows). */
|
|
319
328
|
list?: ReactNode
|
|
320
329
|
/** The buttons in a row or stacked; by default in a row while they fit. */
|
|
@@ -371,11 +380,18 @@ function IOSAlert({ theme, title, description, actions, run, ids, layout, childr
|
|
|
371
380
|
<ScrollView style={styles.scroll} contentContainerStyle={{ gap: 10 }} bounces={false}>
|
|
372
381
|
{/* The text 31 from the sides: 16 of padding and 15 of the header's own */}
|
|
373
382
|
<View style={{ paddingTop: 5, paddingHorizontal: 15, paddingBottom: 5.5, gap: 5.67 }}>
|
|
374
|
-
|
|
375
|
-
{title}
|
|
376
|
-
|
|
383
|
+
{title != null ? (
|
|
384
|
+
<Text nativeID={ids.title} weight="semibold" style={[type, { textAlign: description == null ? "center" : "auto" }]} accessibilityRole="header">
|
|
385
|
+
{title}
|
|
386
|
+
</Text>
|
|
387
|
+
) : null}
|
|
377
388
|
{description != null ? (
|
|
378
|
-
|
|
389
|
+
// Without a title the message is the alert's whole text, in the label color (UIAlertController with a nil title)
|
|
390
|
+
<Text
|
|
391
|
+
nativeID={ids.description}
|
|
392
|
+
color={title != null ? theme.color("--dialog-alert-message-color") : undefined}
|
|
393
|
+
style={{ fontSize: 15, lineHeight: 20 }}
|
|
394
|
+
>
|
|
379
395
|
{description}
|
|
380
396
|
</Text>
|
|
381
397
|
) : null}
|
|
@@ -501,11 +517,14 @@ function AndroidDialog({ theme, title, description, actions, run, ids, children,
|
|
|
501
517
|
</>
|
|
502
518
|
) : (
|
|
503
519
|
<ScrollView style={styles.scroll} contentContainerStyle={styles.androidText} bounces={false}>
|
|
504
|
-
|
|
505
|
-
{title}
|
|
506
|
-
|
|
520
|
+
{title != null ? (
|
|
521
|
+
<Text nativeID={ids.title} color={m.onSurface} accessibilityRole="header" style={[styles.androidTitle, theme.font("medium")]}>
|
|
522
|
+
{title}
|
|
523
|
+
</Text>
|
|
524
|
+
) : null}
|
|
507
525
|
{description != null ? (
|
|
508
|
-
|
|
526
|
+
// Material 3's dialog with no headline: the supporting text alone, in onSurfaceVariant
|
|
527
|
+
<Text nativeID={ids.description} color={title != null ? m.onSurface : m.onSurfaceVariant} style={styles.androidMessage}>
|
|
509
528
|
{description}
|
|
510
529
|
</Text>
|
|
511
530
|
) : null}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { useState, type ComponentRef, type Ref } from "react"
|
|
2
|
+
import { Platform, StyleSheet, Text, View, type PressableProps, type StyleProp, type ViewStyle } from "react-native"
|
|
3
|
+
import { Pressable } from "../../internal/Pressable"
|
|
4
|
+
import { useRipple } from "../../internal/ripple"
|
|
5
|
+
import { withAlpha } from "../../theme/material"
|
|
6
|
+
import { useTheme } from "../../theme/ThemeProvider"
|
|
7
|
+
import AppleLogo from "../../icons/plex/AppleLogo"
|
|
8
|
+
import GoogleLogo from "../../icons/plex/GoogleLogo"
|
|
9
|
+
import { buttonMetrics, useMaterialPress, type ControlSize } from "../Button/Button"
|
|
10
|
+
|
|
11
|
+
export type SignInProvider = "apple" | "google"
|
|
12
|
+
export type SignInAction = "sign-in" | "sign-up" | "continue"
|
|
13
|
+
|
|
14
|
+
export type SignInButtonProps = Omit<PressableProps, "children" | "style"> & {
|
|
15
|
+
/** Whose sign-in: Apple's (an iOS app's) or Google's (iOS and Android alike). */
|
|
16
|
+
provider: SignInProvider
|
|
17
|
+
/** The label, one of the brands' own: Sign in with…, Sign up with… or Continue with…. @default "continue" */
|
|
18
|
+
action?: SignInAction
|
|
19
|
+
/**
|
|
20
|
+
* The brand look against the screen. Apple: black in a light scheme, white in a dark one (never black on dark).
|
|
21
|
+
* Google: light (white with a #747775 outline) or dark (#131314 with a #8E918F outline). Defaults to the theme's.
|
|
22
|
+
*/
|
|
23
|
+
scheme?: "light" | "dark"
|
|
24
|
+
/** Over a photo or a video: Apple's white button. */
|
|
25
|
+
overMedia?: boolean
|
|
26
|
+
/** Google's neutral button: #F2F2F2 with no outline. */
|
|
27
|
+
neutral?: boolean
|
|
28
|
+
/**
|
|
29
|
+
* Height step of the Button scale, so the button matches the screen's other buttons: iOS's large 50 and Android's
|
|
30
|
+
* 48 from `xl`. @default "xl"
|
|
31
|
+
*/
|
|
32
|
+
size?: ControlSize
|
|
33
|
+
/** Takes the whole width. @default true */
|
|
34
|
+
block?: boolean
|
|
35
|
+
/** Keeps the brand's colors, dimmed to 40%, and takes no presses. */
|
|
36
|
+
disabled?: boolean
|
|
37
|
+
style?: StyleProp<ViewStyle>
|
|
38
|
+
ref?: Ref<ComponentRef<typeof View>>
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const LABEL: Record<SignInAction, string> = { "sign-in": "Sign in with", "sign-up": "Sign up with", continue: "Continue with" }
|
|
42
|
+
|
|
43
|
+
type Look = { background: string; text: string; border?: string }
|
|
44
|
+
|
|
45
|
+
/** Apple HIG, Sign in with Apple: black with white content, or white with black content on dark or over media. */
|
|
46
|
+
function appleLook(white: boolean): Look {
|
|
47
|
+
return white ? { background: "#FFFFFF", text: "#000000" } : { background: "#000000", text: "#FFFFFF" }
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** Google Sign-In branding guidelines: the light, dark and neutral buttons. */
|
|
51
|
+
function googleLook(dark: boolean, neutral: boolean): Look {
|
|
52
|
+
if (neutral) return { background: "#F2F2F2", text: "#1F1F1F" }
|
|
53
|
+
return dark ? { background: "#131314", text: "#E3E3E3", border: "#8E918F" } : { background: "#FFFFFF", text: "#1F1F1F", border: "#747775" }
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// The logos' drawn ink inside their 24-unit boxes: the G spans 2.95–21.05, so at 24px it stands 2.95px in from each
|
|
57
|
+
// side; Apple's mark spans 3.36–20.64 of its width
|
|
58
|
+
const GOOGLE_ICON = 24
|
|
59
|
+
const GOOGLE_INSET = 2.95
|
|
60
|
+
const APPLE_ICON = 20
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* The sign-in button of a provider, drawn to its brand rules rather than to the theme: Apple's black or white button
|
|
64
|
+
* with the real Apple logo, Google's light, dark or neutral one with the four-color G. It takes the height and the
|
|
65
|
+
* shape of the screen's other buttons (a capsule on iOS, a pill on Android). Disabled keeps the brand's colors at 40%.
|
|
66
|
+
*/
|
|
67
|
+
export function SignInButton({
|
|
68
|
+
provider,
|
|
69
|
+
action = "continue",
|
|
70
|
+
scheme,
|
|
71
|
+
overMedia = false,
|
|
72
|
+
neutral = false,
|
|
73
|
+
size = "xl",
|
|
74
|
+
block = true,
|
|
75
|
+
disabled = false,
|
|
76
|
+
style,
|
|
77
|
+
onPressIn,
|
|
78
|
+
onPressOut,
|
|
79
|
+
accessibilityLabel,
|
|
80
|
+
accessibilityState,
|
|
81
|
+
...rest
|
|
82
|
+
}: SignInButtonProps) {
|
|
83
|
+
const theme = useTheme()
|
|
84
|
+
const dark = (scheme ?? theme.scheme) === "dark"
|
|
85
|
+
const apple = provider === "apple"
|
|
86
|
+
const look = apple ? appleLook(dark || overMedia) : googleLook(dark, neutral)
|
|
87
|
+
const metrics = buttonMetrics(theme, size)
|
|
88
|
+
const label = `${LABEL[action]} ${apple ? "Apple" : "Google"}`
|
|
89
|
+
const [pressed, setPressed] = useState(false)
|
|
90
|
+
const android = theme.isAndroid
|
|
91
|
+
const nativeRipple = useMaterialPress(theme)
|
|
92
|
+
const ripple = useRipple(withAlpha(look.text, 0.1), android && !nativeRipple, theme.reducedMotion)
|
|
93
|
+
// Google's spacing: 16 before the G, 12 to the text and 16 after on iOS; 12, 10 and 12 on Android
|
|
94
|
+
const google = android ? { start: 12, gap: 10, end: 12 } : { start: 16, gap: 12, end: 16 }
|
|
95
|
+
const radius = metrics.height / 2
|
|
96
|
+
// A compact size keeps the platform's 44pt or 48dp target, as Button does
|
|
97
|
+
const reach = Math.max(0, ((android ? 48 : 44) - metrics.height) / 2)
|
|
98
|
+
const padding = apple
|
|
99
|
+
? // Apple asks for a margin of at least a tenth of the height around the logo and the title
|
|
100
|
+
{ paddingHorizontal: Math.max(metrics.height / 10, 16) }
|
|
101
|
+
: { paddingLeft: google.start - GOOGLE_INSET, paddingRight: google.end }
|
|
102
|
+
return (
|
|
103
|
+
<Pressable
|
|
104
|
+
accessibilityRole="button"
|
|
105
|
+
accessibilityLabel={accessibilityLabel ?? label}
|
|
106
|
+
accessibilityState={{ ...accessibilityState, disabled }}
|
|
107
|
+
disabled={disabled}
|
|
108
|
+
hitSlop={reach ? { top: reach, bottom: reach } : undefined}
|
|
109
|
+
android_ripple={nativeRipple ? { color: withAlpha(look.text, 0.1), foreground: true } : undefined}
|
|
110
|
+
onPressIn={(event) => {
|
|
111
|
+
setPressed(true)
|
|
112
|
+
ripple.start(event)
|
|
113
|
+
onPressIn?.(event)
|
|
114
|
+
}}
|
|
115
|
+
onPressOut={(event) => {
|
|
116
|
+
setPressed(false)
|
|
117
|
+
ripple.end()
|
|
118
|
+
onPressOut?.(event)
|
|
119
|
+
}}
|
|
120
|
+
style={[
|
|
121
|
+
styles.button,
|
|
122
|
+
{
|
|
123
|
+
// At least the size's height: a larger text size grows the button instead of clipping its title
|
|
124
|
+
minHeight: metrics.height,
|
|
125
|
+
paddingVertical: 4,
|
|
126
|
+
minWidth: 140,
|
|
127
|
+
borderRadius: radius,
|
|
128
|
+
backgroundColor: look.background,
|
|
129
|
+
alignSelf: block ? "stretch" : "center",
|
|
130
|
+
opacity: disabled ? 0.4 : 1,
|
|
131
|
+
},
|
|
132
|
+
padding,
|
|
133
|
+
style,
|
|
134
|
+
]}
|
|
135
|
+
{...rest}
|
|
136
|
+
>
|
|
137
|
+
{ripple.layer}
|
|
138
|
+
{/* iOS's press: a layer of the content's color, as a filled button darkens or lightens */}
|
|
139
|
+
{pressed && !android && <View pointerEvents="none" style={[StyleSheet.absoluteFill, { borderRadius: radius, backgroundColor: withAlpha(look.text, 0.12) }]} />}
|
|
140
|
+
{/* Google's outline is 1px inside the button */}
|
|
141
|
+
{look.border && <View pointerEvents="none" style={[StyleSheet.absoluteFill, { borderRadius: radius, borderWidth: 1, borderColor: look.border }]} />}
|
|
142
|
+
<View style={[styles.content, { gap: apple ? 6 : google.gap - GOOGLE_INSET }]} accessibilityElementsHidden importantForAccessibility="no-hide-descendants">
|
|
143
|
+
{apple ? <AppleLogo size={APPLE_ICON} color={look.text} /> : <GoogleLogo size={GOOGLE_ICON} />}
|
|
144
|
+
<Text
|
|
145
|
+
numberOfLines={1}
|
|
146
|
+
allowFontScaling
|
|
147
|
+
style={
|
|
148
|
+
apple
|
|
149
|
+
? // The system font, as Apple's button sets its title
|
|
150
|
+
{ color: look.text, fontSize: metrics.fontSize, lineHeight: metrics.lineHeight, fontWeight: "500" }
|
|
151
|
+
: // Google Sans Medium 14/20 where the app has it, else the system font
|
|
152
|
+
{ color: look.text, fontSize: 14, lineHeight: 20, fontWeight: "500", fontFamily: GOOGLE_FONT }
|
|
153
|
+
}
|
|
154
|
+
>
|
|
155
|
+
{label}
|
|
156
|
+
</Text>
|
|
157
|
+
</View>
|
|
158
|
+
</Pressable>
|
|
159
|
+
)
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/** The font the Google button asks for: an app that bundles Google Sans gets it; elsewhere the system font stands in. */
|
|
163
|
+
const GOOGLE_FONT = Platform.select({ web: "'Google Sans', system-ui, sans-serif", default: undefined })
|
|
164
|
+
|
|
165
|
+
const styles = StyleSheet.create({
|
|
166
|
+
button: { flexDirection: "row", alignItems: "center", justifyContent: "center", overflow: "hidden" },
|
|
167
|
+
content: { flexDirection: "row", alignItems: "center", justifyContent: "center", flexShrink: 1 },
|
|
168
|
+
})
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// Generated by scripts/build-icons.mjs. Do not edit.
|
|
2
|
+
import { createIcon } from "../../components/Icon/createIcon"
|
|
3
|
+
|
|
4
|
+
export default createIcon("AppleLogo", "0 0 24 24", [["path",{"d":"M20.0911 7.2368C19.3972 7.66168 18.8223 8.25568 18.4204 8.96321C18.0185 9.67075 17.8027 10.4687 17.7932 11.2823C17.7959 12.1981 18.0672 13.0929 18.5735 13.856C19.0798 14.6191 19.7988 15.2169 20.6415 15.5754C20.3093 16.6474 19.8176 17.6632 19.1829 18.5888C18.2748 19.8961 17.3253 21.2032 15.8805 21.2032C14.4358 21.2032 14.0642 20.3638 12.3992 20.3638C10.7755 20.3638 10.1976 21.2308 8.87662 21.2308C7.55564 21.2308 6.63382 20.0198 5.57424 18.5338C4.17461 16.452 3.4054 14.0106 3.35889 11.5024C3.35889 7.37443 6.04214 5.18665 8.68397 5.18665C10.0875 5.18665 11.2572 6.10847 12.1378 6.10847C12.9772 6.10847 14.2844 5.1315 15.8805 5.1315C16.7012 5.11032 17.5145 5.29127 18.2487 5.6584C18.983 6.02553 19.6157 6.56757 20.0911 7.2368ZM15.1238 3.38405C15.8274 2.55637 16.2257 1.51233 16.2521 0.426336C16.2533 0.28317 16.2395 0.140275 16.2108 0C15.0022 0.11806 13.8846 0.694096 13.0872 1.60995C12.3769 2.40465 11.9636 3.42081 11.9176 4.48573C11.9181 4.61524 11.932 4.74435 11.9589 4.87103C12.0542 4.88904 12.1509 4.89827 12.2479 4.89861C12.8049 4.85429 13.347 4.69717 13.8414 4.4368C14.3358 4.17644 14.7721 3.81826 15.1238 3.38405Z","fill":0}]])
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// Generated by scripts/build-icons.mjs. Do not edit.
|
|
2
|
+
import { createIcon } from "../../components/Icon/createIcon"
|
|
3
|
+
|
|
4
|
+
export default createIcon("GoogleLogo", "0 0 24 24", [["path",{"d":"M21.0461 12.2099C21.0461 11.5553 20.9874 10.9259 20.8783 10.3217H12.1846V13.8966H17.1524C16.9342 15.0462 16.2797 16.0197 15.2979 16.6742V18.9987H18.2937C20.0391 17.3875 21.0461 15.0211 21.0461 12.2099Z","fill":"#4285F4"}],["path",{"d":"M12.1844 21.2307C14.6767 21.2307 16.7662 20.4084 18.2935 18.9986L15.2977 16.6741C14.4753 17.2279 13.4264 17.5636 12.1844 17.5636C9.78441 17.5636 7.74525 15.944 7.01518 13.7622H3.94385V16.1454C5.46273 19.158 8.57602 21.2307 12.1844 21.2307Z","fill":"#34A853"}],["path",{"d":"M7.01516 13.7539C6.83054 13.2 6.72145 12.6126 6.72145 12C6.72145 11.3874 6.83054 10.8 7.01516 10.2462V7.86295H3.94382C3.31445 9.10491 2.95361 10.5063 2.95361 12C2.95361 13.4937 3.31445 14.8951 3.94382 16.1371L6.33544 14.2741L7.01516 13.7539Z","fill":"#FBBC05"}],["path",{"d":"M12.1844 6.44475C13.5439 6.44475 14.7522 6.91469 15.7173 7.82098L18.3606 5.17762C16.7578 3.68391 14.6767 2.76923 12.1844 2.76923C8.57602 2.76923 5.46273 4.84196 3.94385 7.86294L7.01518 10.2462C7.74525 8.06434 9.78441 6.44475 12.1844 6.44475Z","fill":"#EA4335"}]])
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// Generated by scripts/build-icons.mjs. Do not edit.
|
|
2
|
+
import { createIcon } from "../../components/Icon/createIcon"
|
|
3
|
+
|
|
4
|
+
export default createIcon("MicrosoftLogo", "0 0 24 24", [["path",{"d":"M3.25 3.25H11.25V11.25H3.25V3.25Z","fill":"#F35325"}],["path",{"d":"M12.75 3.25H20.75V11.25H12.75V3.25Z","fill":"#81BC06"}],["path",{"d":"M3.25 12.75H11.25V20.75H3.25V12.75Z","fill":"#05A6F0"}],["path",{"d":"M12.75 12.75H20.75V20.75H12.75V12.75Z","fill":"#FFBA08"}]])
|
package/src/icons/plex/index.ts
CHANGED
|
@@ -20,6 +20,7 @@ export { default as AppPermission } from "./AppPermission"
|
|
|
20
20
|
export { default as AppStore } from "./AppStore"
|
|
21
21
|
export { default as AppStoreSquare } from "./AppStoreSquare"
|
|
22
22
|
export { default as Apple } from "./Apple"
|
|
23
|
+
export { default as AppleLogo } from "./AppleLogo"
|
|
23
24
|
export { default as Archive } from "./Archive"
|
|
24
25
|
export { default as Array } from "./Array"
|
|
25
26
|
export { default as ArrowBottomLeftSm } from "./ArrowBottomLeftSm"
|
|
@@ -268,6 +269,7 @@ export { default as GlobeAlt } from "./GlobeAlt"
|
|
|
268
269
|
export { default as GlobeFilled } from "./GlobeFilled"
|
|
269
270
|
export { default as GlobeOff } from "./GlobeOff"
|
|
270
271
|
export { default as GlobeSpin } from "./GlobeSpin"
|
|
272
|
+
export { default as GoogleLogo } from "./GoogleLogo"
|
|
271
273
|
export { default as Grid } from "./Grid"
|
|
272
274
|
export { default as GridAlt } from "./GridAlt"
|
|
273
275
|
export { default as GripHorizontal } from "./GripHorizontal"
|
|
@@ -361,6 +363,7 @@ export { default as Mic } from "./Mic"
|
|
|
361
363
|
export { default as MicFilled } from "./MicFilled"
|
|
362
364
|
export { default as MicFilledOff } from "./MicFilledOff"
|
|
363
365
|
export { default as MicOff } from "./MicOff"
|
|
366
|
+
export { default as MicrosoftLogo } from "./MicrosoftLogo"
|
|
364
367
|
export { default as MinimizeDown } from "./MinimizeDown"
|
|
365
368
|
export { default as MinimizeLeft } from "./MinimizeLeft"
|
|
366
369
|
export { default as MinimizeRight } from "./MinimizeRight"
|
package/src/index.ts
CHANGED
|
@@ -61,6 +61,7 @@ export {
|
|
|
61
61
|
} from "./components/SegmentedControl/SegmentedControl"
|
|
62
62
|
|
|
63
63
|
export { Switch, type SwitchProps } from "./components/Switch/Switch"
|
|
64
|
+
export { SignInButton, type SignInAction, type SignInButtonProps, type SignInProvider } from "./components/SignInButton/SignInButton"
|
|
64
65
|
export { Checkbox, type CheckboxProps } from "./components/Checkbox/Checkbox"
|
|
65
66
|
export { RadioGroup, type RadioGroupItemProps, type RadioGroupProps } from "./components/RadioGroup/RadioGroup"
|
|
66
67
|
export { Input, InputAdornmentButton, TextField, type InputAdornmentButtonProps, type InputProps, type InputVariant, type TextFieldProps } from "./components/Input/Input"
|