glacia-native 0.5.1 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +29 -4
- package/README.md +27 -0
- package/lib/module/Bars.js +10 -9
- package/lib/module/Button.js +11 -8
- package/lib/module/Card.js +2 -2
- package/lib/module/Dialog.js +16 -17
- package/lib/module/Display.js +8 -7
- package/lib/module/Feedback.js +24 -15
- package/lib/module/Form.js +29 -33
- package/lib/module/Forms2.js +38 -21
- package/lib/module/Glass.js +2 -2
- package/lib/module/Input.js +12 -10
- package/lib/module/Message.js +11 -15
- package/lib/module/Overlays.js +22 -6
- package/lib/module/Pickers.js +16 -16
- package/lib/module/SegmentedControl.js +19 -10
- package/lib/module/Slider.js +18 -9
- package/lib/module/Switch.js +21 -9
- package/lib/module/TabBar.js +18 -12
- package/lib/module/Table.js +4 -3
- package/lib/module/Tabs.js +3 -2
- package/lib/module/ai.js +18 -15
- package/lib/module/charts/BarChart.js +11 -3
- package/lib/module/internal/GlassView.js +2 -2
- package/lib/module/internal/blur.js +78 -0
- package/lib/module/internal/fallback.js +110 -20
- package/lib/module/internal/glow.js +36 -0
- package/lib/module/internal/lens.js +70 -0
- package/lib/module/internal/material.js +64 -0
- package/lib/module/internal/primitives.js +1 -0
- package/lib/module/internal/rim.js +35 -0
- package/lib/module/internal/tokens.js +34 -2
- package/lib/typescript/Message.d.ts +5 -9
- package/lib/typescript/index.d.ts +1 -0
- package/lib/typescript/internal/GlassView.d.ts +13 -0
- package/lib/typescript/internal/blur.d.ts +24 -0
- package/lib/typescript/internal/fallback.d.ts +27 -2
- package/lib/typescript/internal/glow.d.ts +11 -0
- package/lib/typescript/internal/lens.d.ts +47 -0
- package/lib/typescript/internal/material.d.ts +27 -0
- package/lib/typescript/internal/primitives.d.ts +2 -0
- package/lib/typescript/internal/rim.d.ts +16 -0
- package/lib/typescript/internal/tokens.d.ts +36 -0
- package/package.json +12 -3
- package/src/Bars.tsx +12 -2
- package/src/Button.tsx +16 -9
- package/src/Card.tsx +2 -2
- package/src/Dialog.tsx +37 -26
- package/src/Display.tsx +8 -5
- package/src/Feedback.tsx +36 -13
- package/src/Form.tsx +60 -40
- package/src/Forms2.tsx +65 -24
- package/src/Glass.tsx +4 -0
- package/src/Input.tsx +15 -11
- package/src/Message.tsx +15 -16
- package/src/Overlays.tsx +25 -6
- package/src/Pickers.tsx +11 -6
- package/src/SegmentedControl.tsx +33 -9
- package/src/Slider.tsx +19 -10
- package/src/Switch.tsx +24 -10
- package/src/TabBar.tsx +33 -12
- package/src/Table.tsx +4 -3
- package/src/Tabs.tsx +5 -0
- package/src/ai.tsx +28 -20
- package/src/charts/BarChart.tsx +41 -3
- package/src/index.ts +1 -0
- package/src/internal/GlassView.tsx +17 -0
- package/src/internal/blur.ts +90 -0
- package/src/internal/fallback.tsx +158 -20
- package/src/internal/glow.tsx +62 -0
- package/src/internal/lens.tsx +105 -0
- package/src/internal/material.ts +92 -0
- package/src/internal/primitives.ts +3 -0
- package/src/internal/rim.tsx +79 -0
- package/src/internal/tokens.ts +34 -1
package/src/Bars.tsx
CHANGED
|
@@ -74,6 +74,7 @@ export const SearchBar = forwardRef<any, SearchBarProps>(function SearchBar(
|
|
|
74
74
|
>
|
|
75
75
|
<Glass
|
|
76
76
|
effect="regular"
|
|
77
|
+
surface="field"
|
|
77
78
|
isDark={isDark}
|
|
78
79
|
style={{
|
|
79
80
|
flex: 1,
|
|
@@ -204,6 +205,7 @@ export const Chip = forwardRef<any, ChipProps>(function Chip(
|
|
|
204
205
|
const { View, Text: RNText, Pressable } = primitives();
|
|
205
206
|
|
|
206
207
|
const [internalSelected, setInternalSelected] = useState(defaultSelected);
|
|
208
|
+
const [held, setHeld] = useState(false);
|
|
207
209
|
const selected = selectedProp !== undefined ? selectedProp : internalSelected;
|
|
208
210
|
const selectable = selectedProp !== undefined || onSelectedChange !== undefined || defaultSelected;
|
|
209
211
|
|
|
@@ -220,6 +222,8 @@ export const Chip = forwardRef<any, ChipProps>(function Chip(
|
|
|
220
222
|
const pill = (
|
|
221
223
|
<Glass
|
|
222
224
|
effect="regular"
|
|
225
|
+
surface="control"
|
|
226
|
+
pressed={held}
|
|
223
227
|
isDark={isDark}
|
|
224
228
|
tintColor={selected ? theme.glassActive : undefined}
|
|
225
229
|
interactive={!disabled}
|
|
@@ -227,7 +231,7 @@ export const Chip = forwardRef<any, ChipProps>(function Chip(
|
|
|
227
231
|
flexDirection: "row",
|
|
228
232
|
alignItems: "center",
|
|
229
233
|
gap: 6,
|
|
230
|
-
height:
|
|
234
|
+
height: 34,
|
|
231
235
|
paddingHorizontal: 12,
|
|
232
236
|
borderRadius: radii.pill,
|
|
233
237
|
opacity: disabled ? 0.38 : 1,
|
|
@@ -237,7 +241,7 @@ export const Chip = forwardRef<any, ChipProps>(function Chip(
|
|
|
237
241
|
{icon ? <View>{icon}</View> : null}
|
|
238
242
|
<RNText
|
|
239
243
|
numberOfLines={1}
|
|
240
|
-
style={{ fontSize:
|
|
244
|
+
style={{ fontSize: 14, fontWeight: selected ? "600" : "500", color: selected ? theme.foreground : theme.muted }}
|
|
241
245
|
>
|
|
242
246
|
{label}
|
|
243
247
|
</RNText>
|
|
@@ -344,6 +348,7 @@ export const FAB = forwardRef<any, FABProps>(function FAB(
|
|
|
344
348
|
>
|
|
345
349
|
<Glass
|
|
346
350
|
effect="clear"
|
|
351
|
+
surface="control"
|
|
347
352
|
interactive={!disabled}
|
|
348
353
|
isDark={isDark}
|
|
349
354
|
style={{
|
|
@@ -428,6 +433,7 @@ export const IconButton = forwardRef<any, IconButtonProps>(function IconButton(
|
|
|
428
433
|
>
|
|
429
434
|
<Glass
|
|
430
435
|
effect={variant === "ghost" ? "none" : "regular"}
|
|
436
|
+
surface="control"
|
|
431
437
|
interactive={!disabled && variant !== "ghost"}
|
|
432
438
|
isDark={isDark}
|
|
433
439
|
style={{
|
|
@@ -545,6 +551,7 @@ export const AppBar = forwardRef<any, AppBarProps>(function AppBar(
|
|
|
545
551
|
<Glass
|
|
546
552
|
ref={ref}
|
|
547
553
|
effect="regular"
|
|
554
|
+
surface="rail"
|
|
548
555
|
isDark={isDark}
|
|
549
556
|
testID={testID}
|
|
550
557
|
style={{
|
|
@@ -726,6 +733,7 @@ export const FABGroup = forwardRef<any, FABGroupProps>(function FABGroup(
|
|
|
726
733
|
>
|
|
727
734
|
<Glass
|
|
728
735
|
effect="regular"
|
|
736
|
+
surface="control"
|
|
729
737
|
isDark={isDark}
|
|
730
738
|
style={{ borderRadius: radii.pill, paddingHorizontal: 12, paddingVertical: 7 }}
|
|
731
739
|
>
|
|
@@ -735,6 +743,7 @@ export const FABGroup = forwardRef<any, FABGroupProps>(function FABGroup(
|
|
|
735
743
|
</Glass>
|
|
736
744
|
<Glass
|
|
737
745
|
effect="regular"
|
|
746
|
+
surface="control"
|
|
738
747
|
isDark={isDark}
|
|
739
748
|
style={{
|
|
740
749
|
width: mini,
|
|
@@ -774,6 +783,7 @@ export const FABGroup = forwardRef<any, FABGroupProps>(function FABGroup(
|
|
|
774
783
|
>
|
|
775
784
|
<Glass
|
|
776
785
|
effect="clear"
|
|
786
|
+
surface="control"
|
|
777
787
|
interactive
|
|
778
788
|
isDark={isDark}
|
|
779
789
|
style={{
|
package/src/Button.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { forwardRef, type ReactNode } from "react";
|
|
1
|
+
import { forwardRef, useState, type ReactNode } from "react";
|
|
2
2
|
import type { StyleProp, TextStyle, ViewStyle } from "react-native";
|
|
3
3
|
|
|
4
4
|
import { Glass } from "./Glass";
|
|
@@ -21,10 +21,12 @@ export interface ButtonProps {
|
|
|
21
21
|
testID?: string;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
// The web control scale: 28 / 34 / 44, one horizontal padding and one type
|
|
25
|
+
// size for every button, and the inherited 400 weight rather than a 500.
|
|
24
26
|
const sizeHeights = {
|
|
25
|
-
sm:
|
|
26
|
-
md:
|
|
27
|
-
lg:
|
|
27
|
+
sm: 28,
|
|
28
|
+
md: 34,
|
|
29
|
+
lg: 44,
|
|
28
30
|
};
|
|
29
31
|
|
|
30
32
|
/**
|
|
@@ -54,6 +56,7 @@ export const Button = forwardRef<any, ButtonProps>(function Button(
|
|
|
54
56
|
const isDark = useIsDark(isDarkProp);
|
|
55
57
|
const themeColors = isDark ? colors.dark : colors.light;
|
|
56
58
|
const { Pressable, View, Text } = primitives();
|
|
59
|
+
const [held, setHeld] = useState(false);
|
|
57
60
|
const height = sizeHeights[size];
|
|
58
61
|
|
|
59
62
|
const buttonStyle: ViewStyle = {
|
|
@@ -62,7 +65,7 @@ export const Button = forwardRef<any, ButtonProps>(function Button(
|
|
|
62
65
|
flexDirection: "row",
|
|
63
66
|
alignItems: "center",
|
|
64
67
|
justifyContent: "center",
|
|
65
|
-
paddingHorizontal:
|
|
68
|
+
paddingHorizontal: 14,
|
|
66
69
|
opacity: disabled ? 0.38 : 1,
|
|
67
70
|
backgroundColor:
|
|
68
71
|
variant === "filled"
|
|
@@ -74,9 +77,9 @@ export const Button = forwardRef<any, ButtonProps>(function Button(
|
|
|
74
77
|
};
|
|
75
78
|
|
|
76
79
|
const textStyle: TextStyle = {
|
|
77
|
-
color: variant === "filled" ?
|
|
78
|
-
fontSize:
|
|
79
|
-
fontWeight: "
|
|
80
|
+
color: variant === "filled" ? themeColors.onTint : tint || themeColors.foreground,
|
|
81
|
+
fontSize: 14,
|
|
82
|
+
fontWeight: "400",
|
|
80
83
|
};
|
|
81
84
|
|
|
82
85
|
return (
|
|
@@ -88,16 +91,20 @@ export const Button = forwardRef<any, ButtonProps>(function Button(
|
|
|
88
91
|
accessibilityState={{ disabled }}
|
|
89
92
|
disabled={disabled}
|
|
90
93
|
onPress={disabled ? undefined : onPress}
|
|
94
|
+
onPressIn={() => setHeld(true)}
|
|
95
|
+
onPressOut={() => setHeld(false)}
|
|
91
96
|
style={({ pressed }: { pressed: boolean }) => ({ opacity: pressed && !disabled ? 0.85 : 1 })}
|
|
92
97
|
{...props}
|
|
93
98
|
>
|
|
94
99
|
<Glass
|
|
95
100
|
effect={variant === "ghost" ? "none" : "regular"}
|
|
101
|
+
surface="control"
|
|
102
|
+
pressed={held && !disabled}
|
|
96
103
|
interactive={!disabled}
|
|
97
104
|
isDark={isDark}
|
|
98
105
|
style={buttonStyle}
|
|
99
106
|
>
|
|
100
|
-
{icon ? <View style={{ marginRight: children ?
|
|
107
|
+
{icon ? <View style={{ marginRight: children ? 7 : 0 }}>{icon}</View> : null}
|
|
101
108
|
{typeof children === "string" ? (
|
|
102
109
|
// A string label is text: it needs Text to inherit font and colour.
|
|
103
110
|
<Text style={textStyle} numberOfLines={1}>
|
package/src/Card.tsx
CHANGED
|
@@ -26,10 +26,10 @@ export const Card = forwardRef<any, CardProps>(function Card(
|
|
|
26
26
|
const isDark = useIsDark(isDarkProp);
|
|
27
27
|
|
|
28
28
|
const cardStyle: ViewStyle = {
|
|
29
|
-
padding:
|
|
29
|
+
padding: 24,
|
|
30
30
|
borderRadius: radii.lg,
|
|
31
31
|
flexDirection: "column",
|
|
32
|
-
gap:
|
|
32
|
+
gap: 16,
|
|
33
33
|
...(style as ViewStyle),
|
|
34
34
|
};
|
|
35
35
|
|
package/src/Dialog.tsx
CHANGED
|
@@ -103,14 +103,17 @@ export function Dialog({
|
|
|
103
103
|
>
|
|
104
104
|
<Glass
|
|
105
105
|
effect="regular"
|
|
106
|
+
surface="overlay"
|
|
106
107
|
isDark={isDark}
|
|
107
108
|
testID={testID}
|
|
108
109
|
style={{
|
|
109
|
-
borderRadius: radii.
|
|
110
|
-
borderWidth: 1,
|
|
111
|
-
borderColor: theme.edge,
|
|
110
|
+
borderRadius: radii.xl,
|
|
112
111
|
padding: 20,
|
|
113
112
|
gap: 8,
|
|
113
|
+
// The web overlay shadow: the panel has to float above the scrim.
|
|
114
|
+
shadowOpacity: 0.12,
|
|
115
|
+
shadowRadius: 50,
|
|
116
|
+
shadowOffset: { width: 0, height: 20 },
|
|
114
117
|
...(style as ViewStyle),
|
|
115
118
|
}}
|
|
116
119
|
>
|
|
@@ -124,7 +127,7 @@ export function Dialog({
|
|
|
124
127
|
)}
|
|
125
128
|
|
|
126
129
|
{description && (
|
|
127
|
-
<Text style={{ fontSize:
|
|
130
|
+
<Text style={{ fontSize: 14, color: theme.muted, lineHeight: 20 }}>{description}</Text>
|
|
128
131
|
)}
|
|
129
132
|
|
|
130
133
|
{children}
|
|
@@ -313,12 +316,16 @@ export function ActionSheet({
|
|
|
313
316
|
onPress={() => {}}
|
|
314
317
|
style={{ padding: 10, gap: 8 }}
|
|
315
318
|
>
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
319
|
+
{/* The web's ActionSheet is not one panel: it is a stack of separate
|
|
320
|
+
glass pills. That shape is the single most visible difference in
|
|
321
|
+
the owner's screenshots, so each row gets its own surface. */}
|
|
322
|
+
{(title || message) && (
|
|
323
|
+
<Glass
|
|
324
|
+
effect="regular"
|
|
325
|
+
surface="overlay"
|
|
326
|
+
isDark={isDark}
|
|
327
|
+
style={{ borderRadius: radii.lg }}
|
|
328
|
+
>
|
|
322
329
|
<View style={{ paddingVertical: 12, paddingHorizontal: 16, alignItems: "center" }}>
|
|
323
330
|
{title && (
|
|
324
331
|
<Text style={{ fontSize: 13, fontWeight: "600", color: theme.foreground }}>
|
|
@@ -331,44 +338,48 @@ export function ActionSheet({
|
|
|
331
338
|
</Text>
|
|
332
339
|
)}
|
|
333
340
|
</View>
|
|
334
|
-
|
|
341
|
+
</Glass>
|
|
342
|
+
)}
|
|
335
343
|
|
|
336
|
-
|
|
344
|
+
{options.map((option) => (
|
|
345
|
+
<Glass
|
|
346
|
+
key={option.label}
|
|
347
|
+
effect="regular"
|
|
348
|
+
surface="overlay"
|
|
349
|
+
isDark={isDark}
|
|
350
|
+
style={{ borderRadius: radii.pill }}
|
|
351
|
+
>
|
|
337
352
|
<Pressable
|
|
338
|
-
key={option.label}
|
|
339
353
|
accessibilityRole="button"
|
|
340
354
|
accessibilityLabel={option.label}
|
|
341
355
|
onPress={() => {
|
|
342
356
|
option.onPress?.();
|
|
343
357
|
close();
|
|
344
358
|
}}
|
|
345
|
-
style={{
|
|
346
|
-
paddingVertical: 14,
|
|
347
|
-
alignItems: "center",
|
|
348
|
-
borderTopWidth: index === 0 && !title && !message ? 0 : 1,
|
|
349
|
-
borderTopColor: theme.edge,
|
|
350
|
-
}}
|
|
359
|
+
style={{ minHeight: 44, paddingVertical: 12, paddingHorizontal: 20, alignItems: "center", justifyContent: "center" }}
|
|
351
360
|
>
|
|
352
361
|
<Text
|
|
353
362
|
style={{
|
|
354
|
-
fontSize:
|
|
355
|
-
|
|
363
|
+
fontSize: 17,
|
|
364
|
+
// The web's iOS-style action sheet: every row is the tint
|
|
365
|
+
// colour, and only a destructive one is red.
|
|
366
|
+
color: option.destructive ? theme.destructive : theme.fill,
|
|
356
367
|
}}
|
|
357
368
|
>
|
|
358
369
|
{option.label}
|
|
359
370
|
</Text>
|
|
360
371
|
</Pressable>
|
|
361
|
-
|
|
362
|
-
|
|
372
|
+
</Glass>
|
|
373
|
+
))}
|
|
363
374
|
|
|
364
|
-
<Glass effect="regular" isDark={isDark} style={{ borderRadius: radii.
|
|
375
|
+
<Glass effect="regular" surface="overlay" isDark={isDark} style={{ borderRadius: radii.pill }}>
|
|
365
376
|
<Pressable
|
|
366
377
|
accessibilityRole="button"
|
|
367
378
|
accessibilityLabel={cancelLabel}
|
|
368
379
|
onPress={close}
|
|
369
|
-
style={{ paddingVertical:
|
|
380
|
+
style={{ minHeight: 44, paddingVertical: 12, alignItems: "center", justifyContent: "center" }}
|
|
370
381
|
>
|
|
371
|
-
<Text style={{ fontSize:
|
|
382
|
+
<Text style={{ fontSize: 17, fontWeight: "600", color: theme.foreground }}>
|
|
372
383
|
{cancelLabel}
|
|
373
384
|
</Text>
|
|
374
385
|
</Pressable>
|
package/src/Display.tsx
CHANGED
|
@@ -69,6 +69,7 @@ export const Avatar = forwardRef<any, AvatarProps>(function Avatar(
|
|
|
69
69
|
>
|
|
70
70
|
<Glass
|
|
71
71
|
effect="regular"
|
|
72
|
+
surface="panel"
|
|
72
73
|
isDark={isDark}
|
|
73
74
|
style={{
|
|
74
75
|
width: dimension,
|
|
@@ -158,7 +159,8 @@ export const Badge = forwardRef<any, BadgeProps>(function Badge(
|
|
|
158
159
|
: theme.fill;
|
|
159
160
|
|
|
160
161
|
const isDot = children == null;
|
|
161
|
-
|
|
162
|
+
// The web badge is 24 tall with 10 of horizontal padding and 12/500 type.
|
|
163
|
+
const height = isDot ? 10 : 24;
|
|
162
164
|
|
|
163
165
|
const badge = (
|
|
164
166
|
<View
|
|
@@ -170,7 +172,7 @@ export const Badge = forwardRef<any, BadgeProps>(function Badge(
|
|
|
170
172
|
minWidth: height,
|
|
171
173
|
height,
|
|
172
174
|
borderRadius: height / 2,
|
|
173
|
-
paddingHorizontal: isDot ? 0 :
|
|
175
|
+
paddingHorizontal: isDot ? 0 : 10,
|
|
174
176
|
alignItems: "center",
|
|
175
177
|
justifyContent: "center",
|
|
176
178
|
backgroundColor: background,
|
|
@@ -179,7 +181,7 @@ export const Badge = forwardRef<any, BadgeProps>(function Badge(
|
|
|
179
181
|
{...props}
|
|
180
182
|
>
|
|
181
183
|
{!isDot && (
|
|
182
|
-
<Text style={{ fontSize:
|
|
184
|
+
<Text style={{ fontSize: 12, fontWeight: "500", color: theme.onTint }} numberOfLines={1}>
|
|
183
185
|
{children}
|
|
184
186
|
</Text>
|
|
185
187
|
)}
|
|
@@ -226,8 +228,8 @@ export const Separator = forwardRef<any, SeparatorProps>(function Separator(
|
|
|
226
228
|
|
|
227
229
|
const separatorStyle: ViewStyle =
|
|
228
230
|
orientation === "horizontal"
|
|
229
|
-
? { height:
|
|
230
|
-
: { width:
|
|
231
|
+
? { height: 1, alignSelf: "stretch", marginLeft: inset, backgroundColor: theme.separator }
|
|
232
|
+
: { width: 1, alignSelf: "stretch", backgroundColor: theme.separator };
|
|
231
233
|
|
|
232
234
|
return (
|
|
233
235
|
<View
|
|
@@ -526,6 +528,7 @@ export const Progress = forwardRef<any, ProgressProps>(function Progress(
|
|
|
526
528
|
<Glass
|
|
527
529
|
ref={ref}
|
|
528
530
|
effect="regular"
|
|
531
|
+
surface="rail"
|
|
529
532
|
isDark={isDark}
|
|
530
533
|
style={{
|
|
531
534
|
height: 8,
|
package/src/Feedback.tsx
CHANGED
|
@@ -6,6 +6,7 @@ import { Separator } from "./Display";
|
|
|
6
6
|
import { colors, radii, toneColor, type Tone } from "./internal/tokens";
|
|
7
7
|
import { primitives } from "./internal/primitives";
|
|
8
8
|
import { useIsDark, useSpring } from "./internal/motion";
|
|
9
|
+
import { SelectedLens, rowLensStyle } from "./internal/lens";
|
|
9
10
|
import { hapticSelection } from "./internal/haptics";
|
|
10
11
|
|
|
11
12
|
// ---------------------------------------------------------------------------
|
|
@@ -105,15 +106,21 @@ export const Toast = forwardRef<any, ToastProps>(function Toast(
|
|
|
105
106
|
<Entrance animated={animated} rise={rise} fade={fade}>
|
|
106
107
|
<Glass
|
|
107
108
|
effect="regular"
|
|
109
|
+
surface="overlay"
|
|
108
110
|
isDark={isDark}
|
|
109
111
|
style={{
|
|
110
112
|
flexDirection: "row",
|
|
111
113
|
alignItems: "center",
|
|
112
114
|
gap: 10,
|
|
113
|
-
paddingVertical:
|
|
114
|
-
paddingHorizontal:
|
|
115
|
-
borderRadius: radii.
|
|
116
|
-
maxWidth:
|
|
115
|
+
paddingVertical: 12,
|
|
116
|
+
paddingHorizontal: 16,
|
|
117
|
+
borderRadius: radii.lg,
|
|
118
|
+
maxWidth: 400,
|
|
119
|
+
minWidth: 280,
|
|
120
|
+
// A toast floats above everything; without a shadow it is a label.
|
|
121
|
+
shadowOpacity: 0.12,
|
|
122
|
+
shadowRadius: 30,
|
|
123
|
+
shadowOffset: { width: 0, height: 10 },
|
|
117
124
|
borderColor: tone === "neutral" ? theme.edge : accent,
|
|
118
125
|
}}
|
|
119
126
|
>
|
|
@@ -121,7 +128,7 @@ export const Toast = forwardRef<any, ToastProps>(function Toast(
|
|
|
121
128
|
<RNText
|
|
122
129
|
accessibilityRole="alert"
|
|
123
130
|
accessibilityLiveRegion="polite"
|
|
124
|
-
style={{ fontSize:
|
|
131
|
+
style={{ fontSize: 13, color: theme.foreground, flexShrink: 1 }}
|
|
125
132
|
>
|
|
126
133
|
{message}
|
|
127
134
|
</RNText>
|
|
@@ -399,6 +406,7 @@ export const Banner = forwardRef<any, BannerProps>(function Banner(
|
|
|
399
406
|
<Glass
|
|
400
407
|
ref={ref}
|
|
401
408
|
effect="regular"
|
|
409
|
+
surface="overlay"
|
|
402
410
|
isDark={isDark}
|
|
403
411
|
testID={testID}
|
|
404
412
|
style={{ borderRadius: radii.md, borderColor: accent, ...(style as ViewStyle) }}
|
|
@@ -661,16 +669,27 @@ export const ListItem = forwardRef<any, ListItemProps>(function ListItem(
|
|
|
661
669
|
const rowStyle: ViewStyle = {
|
|
662
670
|
flexDirection: "row",
|
|
663
671
|
alignItems: "center",
|
|
664
|
-
minHeight:
|
|
672
|
+
minHeight: 44,
|
|
665
673
|
paddingVertical: 10,
|
|
666
|
-
paddingHorizontal:
|
|
667
|
-
|
|
674
|
+
paddingHorizontal: 16,
|
|
675
|
+
// The selected row is a lens painted behind the content, not a flat wash.
|
|
676
|
+
backgroundColor: "transparent",
|
|
668
677
|
opacity: disabled ? 0.38 : 1,
|
|
669
678
|
...(style as ViewStyle),
|
|
670
679
|
};
|
|
671
680
|
|
|
681
|
+
const lens = selected ? (
|
|
682
|
+
<SelectedLens
|
|
683
|
+
radius={8}
|
|
684
|
+
isDark={isDark}
|
|
685
|
+
style={rowLensStyle(8)}
|
|
686
|
+
testID={testID ? `${testID}-lens` : undefined}
|
|
687
|
+
/>
|
|
688
|
+
) : null;
|
|
689
|
+
|
|
672
690
|
const rowInner = !interactive ? (
|
|
673
691
|
<View accessibilityRole="text" accessibilityState={{ disabled }} style={rowStyle}>
|
|
692
|
+
{lens}
|
|
674
693
|
{content}
|
|
675
694
|
</View>
|
|
676
695
|
) : (
|
|
@@ -682,6 +701,7 @@ export const ListItem = forwardRef<any, ListItemProps>(function ListItem(
|
|
|
682
701
|
onPress={guardPress(onPress)}
|
|
683
702
|
style={({ pressed }: { pressed: boolean }) => ({ ...rowStyle, opacity: pressed ? 0.7 : rowStyle.opacity })}
|
|
684
703
|
>
|
|
704
|
+
{lens}
|
|
685
705
|
{content}
|
|
686
706
|
</Pressable>
|
|
687
707
|
);
|
|
@@ -808,9 +828,10 @@ export const List = forwardRef<any, ListProps>(function List(
|
|
|
808
828
|
<Glass
|
|
809
829
|
ref={ref}
|
|
810
830
|
effect="regular"
|
|
831
|
+
surface="panel"
|
|
811
832
|
isDark={isDark}
|
|
812
833
|
testID={testID}
|
|
813
|
-
style={{ borderRadius: radii.
|
|
834
|
+
style={{ borderRadius: radii.lg, ...(style as ViewStyle) }}
|
|
814
835
|
{...props}
|
|
815
836
|
>
|
|
816
837
|
{body}
|
|
@@ -846,7 +867,8 @@ export const ListSection = forwardRef<any, ListSectionProps>(function ListSectio
|
|
|
846
867
|
letterSpacing: 0.4,
|
|
847
868
|
textTransform: "uppercase",
|
|
848
869
|
color: theme.muted,
|
|
849
|
-
paddingHorizontal:
|
|
870
|
+
paddingHorizontal: 16,
|
|
871
|
+
paddingVertical: 5,
|
|
850
872
|
}}
|
|
851
873
|
>
|
|
852
874
|
{header}
|
|
@@ -925,9 +947,10 @@ export const Accordion = forwardRef<any, AccordionProps>(function Accordion(
|
|
|
925
947
|
<Glass
|
|
926
948
|
ref={ref}
|
|
927
949
|
effect="regular"
|
|
950
|
+
surface="panel"
|
|
928
951
|
isDark={isDark}
|
|
929
952
|
testID={testID}
|
|
930
|
-
style={{ borderRadius: radii.
|
|
953
|
+
style={{ borderRadius: radii.stack, ...(style as ViewStyle) }}
|
|
931
954
|
{...props}
|
|
932
955
|
>
|
|
933
956
|
{sections.map((section, index) => {
|
|
@@ -940,7 +963,7 @@ export const Accordion = forwardRef<any, AccordionProps>(function Accordion(
|
|
|
940
963
|
accessibilityLabel={section.title}
|
|
941
964
|
accessibilityState={{ expanded }}
|
|
942
965
|
onPress={() => toggle(section.value)}
|
|
943
|
-
style={{ paddingVertical:
|
|
966
|
+
style={{ paddingVertical: 16, paddingHorizontal: 20, flexDirection: "row", alignItems: "center" }}
|
|
944
967
|
>
|
|
945
968
|
<View style={{ flex: 1, gap: 2 }}>
|
|
946
969
|
<RNText style={{ fontSize: 15, fontWeight: "500", color: theme.foreground }}>
|
|
@@ -959,7 +982,7 @@ export const Accordion = forwardRef<any, AccordionProps>(function Accordion(
|
|
|
959
982
|
</RNText>
|
|
960
983
|
</Pressable>
|
|
961
984
|
{expanded ? (
|
|
962
|
-
<View style={{ paddingHorizontal:
|
|
985
|
+
<View style={{ paddingHorizontal: 20, paddingBottom: 16 }}>{section.content}</View>
|
|
963
986
|
) : null}
|
|
964
987
|
</View>
|
|
965
988
|
);
|