@hzblj/kara-components 0.17.0 → 0.19.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/CHANGELOG.md +62 -0
- package/lib/module/atoms/badge/badge.android.js +5 -0
- package/lib/module/atoms/badge/badge.android.js.map +1 -1
- package/lib/module/atoms/badge/badge.ios.js +2 -0
- package/lib/module/atoms/badge/badge.ios.js.map +1 -1
- package/lib/module/atoms/button/button-tokens.js +8 -0
- package/lib/module/atoms/button/button-tokens.js.map +1 -1
- package/lib/module/atoms/button/button.android.js +43 -15
- package/lib/module/atoms/button/button.android.js.map +1 -1
- package/lib/module/atoms/button/button.ios.js +66 -10
- package/lib/module/atoms/button/button.ios.js.map +1 -1
- package/lib/module/atoms/checkbox/checkbox.android.js +5 -1
- package/lib/module/atoms/checkbox/checkbox.android.js.map +1 -1
- package/lib/module/atoms/checkbox/checkbox.ios.js +3 -1
- package/lib/module/atoms/checkbox/checkbox.ios.js.map +1 -1
- package/lib/module/atoms/color-picker/color-picker.android.js +4 -0
- package/lib/module/atoms/color-picker/color-picker.android.js.map +1 -1
- package/lib/module/atoms/color-picker/color-picker.ios.js +24 -2
- package/lib/module/atoms/color-picker/color-picker.ios.js.map +1 -1
- package/lib/module/atoms/date-picker/date-picker.android.js +85 -10
- package/lib/module/atoms/date-picker/date-picker.android.js.map +1 -1
- package/lib/module/atoms/date-picker/date-picker.ios.js +9 -7
- package/lib/module/atoms/date-picker/date-picker.ios.js.map +1 -1
- package/lib/module/atoms/divider/divider.android.js +17 -4
- package/lib/module/atoms/divider/divider.android.js.map +1 -1
- package/lib/module/atoms/divider/divider.ios.js +4 -0
- package/lib/module/atoms/divider/divider.ios.js.map +1 -1
- package/lib/module/atoms/fab/fab.android.js +64 -8
- package/lib/module/atoms/fab/fab.android.js.map +1 -1
- package/lib/module/atoms/fab/fab.ios.js +68 -12
- package/lib/module/atoms/fab/fab.ios.js.map +1 -1
- package/lib/module/atoms/icon-button/icon-button.android.js +48 -5
- package/lib/module/atoms/icon-button/icon-button.android.js.map +1 -1
- package/lib/module/atoms/icon-button/icon-button.ios.js +60 -10
- package/lib/module/atoms/icon-button/icon-button.ios.js.map +1 -1
- package/lib/module/atoms/list/list.android.js +32 -4
- package/lib/module/atoms/list/list.android.js.map +1 -1
- package/lib/module/atoms/list/list.ios.js +15 -5
- package/lib/module/atoms/list/list.ios.js.map +1 -1
- package/lib/module/atoms/progress/progress.android.js +21 -7
- package/lib/module/atoms/progress/progress.android.js.map +1 -1
- package/lib/module/atoms/progress/progress.ios.js +5 -1
- package/lib/module/atoms/progress/progress.ios.js.map +1 -1
- package/lib/module/atoms/segmented-control/segmented-control.android.js +66 -12
- package/lib/module/atoms/segmented-control/segmented-control.android.js.map +1 -1
- package/lib/module/atoms/segmented-control/segmented-control.ios.js +19 -8
- package/lib/module/atoms/segmented-control/segmented-control.ios.js.map +1 -1
- package/lib/module/atoms/segmented-control/segments.js +16 -0
- package/lib/module/atoms/segmented-control/segments.js.map +1 -0
- package/lib/module/atoms/slider/slider.android.js +16 -2
- package/lib/module/atoms/slider/slider.android.js.map +1 -1
- package/lib/module/atoms/slider/slider.ios.js +22 -2
- package/lib/module/atoms/slider/slider.ios.js.map +1 -1
- package/lib/module/atoms/switch/switch.android.js +5 -1
- package/lib/module/atoms/switch/switch.android.js.map +1 -1
- package/lib/module/atoms/switch/switch.ios.js +3 -1
- package/lib/module/atoms/switch/switch.ios.js.map +1 -1
- package/lib/module/atoms/text/spans.js +2 -1
- package/lib/module/atoms/text/spans.js.map +1 -1
- package/lib/module/atoms/text/text.android.js +18 -6
- package/lib/module/atoms/text/text.android.js.map +1 -1
- package/lib/module/atoms/text/text.ios.js +6 -2
- package/lib/module/atoms/text/text.ios.js.map +1 -1
- package/lib/module/atoms/text-field/text-field-input.js +14 -0
- package/lib/module/atoms/text-field/text-field-input.js.map +1 -0
- package/lib/module/atoms/text-field/text-field.android.js +113 -6
- package/lib/module/atoms/text-field/text-field.android.js.map +1 -1
- package/lib/module/atoms/text-field/text-field.ios.js +75 -3
- package/lib/module/atoms/text-field/text-field.ios.js.map +1 -1
- package/lib/module/molecules/collapsible/collapsible.android.js +4 -3
- package/lib/module/molecules/collapsible/collapsible.android.js.map +1 -1
- package/lib/module/molecules/collapsible/collapsible.ios.js +3 -1
- package/lib/module/molecules/collapsible/collapsible.ios.js.map +1 -1
- package/lib/module/molecules/radio-group/radio-group.android.js +10 -2
- package/lib/module/molecules/radio-group/radio-group.android.js.map +1 -1
- package/lib/module/molecules/radio-group/radio-group.ios.js +6 -2
- package/lib/module/molecules/radio-group/radio-group.ios.js.map +1 -1
- package/lib/module/molecules/search-bar/search-bar.js +9 -0
- package/lib/module/molecules/search-bar/search-bar.js.map +1 -1
- package/lib/module/molecules/stepper/stepper.android.js +25 -13
- package/lib/module/molecules/stepper/stepper.android.js.map +1 -1
- package/lib/module/molecules/stepper/stepper.ios.js +12 -6
- package/lib/module/molecules/stepper/stepper.ios.js.map +1 -1
- package/lib/module/organisms/action-sheet/action-sheet.android.js +16 -8
- package/lib/module/organisms/action-sheet/action-sheet.android.js.map +1 -1
- package/lib/module/organisms/action-sheet/action-sheet.ios.js +16 -3
- package/lib/module/organisms/action-sheet/action-sheet.ios.js.map +1 -1
- package/lib/module/organisms/alert/alert.android.js +4 -3
- package/lib/module/organisms/alert/alert.android.js.map +1 -1
- package/lib/module/organisms/alert/alert.ios.js +3 -2
- package/lib/module/organisms/alert/alert.ios.js.map +1 -1
- package/lib/module/organisms/context-menu/context-menu.android.js +3 -1
- package/lib/module/organisms/context-menu/context-menu.android.js.map +1 -1
- package/lib/module/organisms/context-menu/context-menu.ios.js +1 -0
- package/lib/module/organisms/context-menu/context-menu.ios.js.map +1 -1
- package/lib/module/organisms/fab-menu/fab-menu.android.js +3 -0
- package/lib/module/organisms/fab-menu/fab-menu.android.js.map +1 -1
- package/lib/module/organisms/fab-menu/fab-menu.ios.js +3 -0
- package/lib/module/organisms/fab-menu/fab-menu.ios.js.map +1 -1
- package/lib/module/organisms/menu/menu-parts.js +20 -0
- package/lib/module/organisms/menu/menu-parts.js.map +1 -0
- package/lib/module/organisms/menu/menu.android.js +51 -19
- package/lib/module/organisms/menu/menu.android.js.map +1 -1
- package/lib/module/organisms/menu/menu.ios.js +71 -8
- package/lib/module/organisms/menu/menu.ios.js.map +1 -1
- package/lib/module/organisms/sheet/sheet.js +2 -1
- package/lib/module/organisms/sheet/sheet.js.map +1 -1
- package/lib/typescript/atoms/badge/badge.types.d.ts +2 -0
- package/lib/typescript/atoms/button/button-tokens.d.ts +6 -2
- package/lib/typescript/atoms/button/button.types.d.ts +19 -5
- package/lib/typescript/atoms/checkbox/checkbox.types.d.ts +2 -0
- package/lib/typescript/atoms/color-picker/color-picker.types.d.ts +2 -0
- package/lib/typescript/atoms/date-picker/date-picker.ios.d.ts +5 -5
- package/lib/typescript/atoms/date-picker/date-picker.types.d.ts +30 -7
- package/lib/typescript/atoms/divider/divider.ios.d.ts +4 -0
- package/lib/typescript/atoms/divider/divider.types.d.ts +13 -2
- package/lib/typescript/atoms/fab/fab.types.d.ts +21 -4
- package/lib/typescript/atoms/icon-button/icon-button.types.d.ts +23 -4
- package/lib/typescript/atoms/list/list.types.d.ts +15 -1
- package/lib/typescript/atoms/progress/progress.types.d.ts +13 -2
- package/lib/typescript/atoms/segmented-control/segmented-control.ios.d.ts +3 -1
- package/lib/typescript/atoms/segmented-control/segmented-control.types.d.ts +26 -3
- package/lib/typescript/atoms/segmented-control/segments.d.ts +6 -0
- package/lib/typescript/atoms/slider/slider.ios.d.ts +4 -0
- package/lib/typescript/atoms/slider/slider.types.d.ts +7 -0
- package/lib/typescript/atoms/switch/switch.types.d.ts +2 -0
- package/lib/typescript/atoms/text/spans.d.ts +2 -0
- package/lib/typescript/atoms/text/text.types.d.ts +9 -1
- package/lib/typescript/atoms/text-field/text-field-input.d.ts +7 -0
- package/lib/typescript/atoms/text-field/text-field.types.d.ts +77 -4
- package/lib/typescript/molecules/collapsible/collapsible.types.d.ts +2 -0
- package/lib/typescript/molecules/radio-group/radio-group.types.d.ts +4 -0
- package/lib/typescript/molecules/search-bar/search-bar.types.d.ts +11 -1
- package/lib/typescript/molecules/stepper/stepper.ios.d.ts +2 -1
- package/lib/typescript/molecules/stepper/stepper.types.d.ts +17 -0
- package/lib/typescript/organisms/action-sheet/action-sheet.ios.d.ts +4 -0
- package/lib/typescript/organisms/action-sheet/action-sheet.types.d.ts +8 -3
- package/lib/typescript/organisms/alert/alert.types.d.ts +8 -3
- package/lib/typescript/organisms/menu/menu-parts.d.ts +14 -0
- package/lib/typescript/organisms/menu/menu.types.d.ts +35 -7
- package/lib/typescript/organisms/sheet/sheet.types.d.ts +7 -1
- package/package.json +4 -4
- package/src/atoms/badge/badge.android.tsx +9 -2
- package/src/atoms/badge/badge.ios.tsx +2 -2
- package/src/atoms/badge/badge.types.ts +2 -0
- package/src/atoms/button/button-tokens.ts +6 -3
- package/src/atoms/button/button.android.tsx +35 -11
- package/src/atoms/button/button.ios.tsx +72 -8
- package/src/atoms/button/button.types.ts +20 -5
- package/src/atoms/checkbox/checkbox.android.tsx +5 -2
- package/src/atoms/checkbox/checkbox.ios.tsx +2 -2
- package/src/atoms/checkbox/checkbox.types.ts +2 -0
- package/src/atoms/color-picker/color-picker.android.tsx +10 -2
- package/src/atoms/color-picker/color-picker.ios.tsx +24 -1
- package/src/atoms/color-picker/color-picker.types.ts +2 -0
- package/src/atoms/date-picker/date-picker.android.tsx +86 -16
- package/src/atoms/date-picker/date-picker.ios.tsx +20 -8
- package/src/atoms/date-picker/date-picker.types.ts +31 -7
- package/src/atoms/divider/divider.android.tsx +14 -3
- package/src/atoms/divider/divider.ios.tsx +4 -0
- package/src/atoms/divider/divider.types.ts +14 -2
- package/src/atoms/fab/fab.android.tsx +61 -11
- package/src/atoms/fab/fab.ios.tsx +48 -13
- package/src/atoms/fab/fab.types.ts +22 -4
- package/src/atoms/icon-button/icon-button.android.tsx +60 -10
- package/src/atoms/icon-button/icon-button.ios.tsx +77 -8
- package/src/atoms/icon-button/icon-button.types.ts +24 -4
- package/src/atoms/list/list.android.tsx +26 -4
- package/src/atoms/list/list.ios.tsx +20 -5
- package/src/atoms/list/list.types.ts +16 -1
- package/src/atoms/progress/progress.android.tsx +32 -6
- package/src/atoms/progress/progress.ios.tsx +11 -5
- package/src/atoms/progress/progress.types.ts +13 -2
- package/src/atoms/segmented-control/segmented-control.android.tsx +69 -10
- package/src/atoms/segmented-control/segmented-control.ios.tsx +24 -5
- package/src/atoms/segmented-control/segmented-control.types.ts +28 -3
- package/src/atoms/segmented-control/segments.ts +16 -0
- package/src/atoms/slider/slider.android.tsx +18 -2
- package/src/atoms/slider/slider.ios.tsx +38 -2
- package/src/atoms/slider/slider.types.ts +7 -0
- package/src/atoms/switch/switch.android.tsx +5 -2
- package/src/atoms/switch/switch.ios.tsx +2 -2
- package/src/atoms/switch/switch.types.ts +2 -0
- package/src/atoms/text/spans.ts +2 -1
- package/src/atoms/text/text.android.tsx +20 -7
- package/src/atoms/text/text.ios.tsx +7 -0
- package/src/atoms/text/text.types.ts +10 -1
- package/src/atoms/text-field/text-field-input.ts +17 -0
- package/src/atoms/text-field/text-field.android.tsx +132 -9
- package/src/atoms/text-field/text-field.ios.tsx +110 -6
- package/src/atoms/text-field/text-field.types.ts +98 -4
- package/src/molecules/collapsible/collapsible.android.tsx +10 -2
- package/src/molecules/collapsible/collapsible.ios.tsx +8 -2
- package/src/molecules/collapsible/collapsible.types.ts +2 -0
- package/src/molecules/radio-group/radio-group.android.tsx +18 -4
- package/src/molecules/radio-group/radio-group.ios.tsx +19 -5
- package/src/molecules/radio-group/radio-group.types.ts +4 -0
- package/src/molecules/search-bar/search-bar.tsx +9 -0
- package/src/molecules/search-bar/search-bar.types.ts +12 -1
- package/src/molecules/stepper/stepper.android.tsx +24 -4
- package/src/molecules/stepper/stepper.ios.tsx +23 -8
- package/src/molecules/stepper/stepper.types.ts +17 -0
- package/src/organisms/action-sheet/action-sheet.android.tsx +23 -11
- package/src/organisms/action-sheet/action-sheet.ios.tsx +20 -3
- package/src/organisms/action-sheet/action-sheet.types.ts +8 -3
- package/src/organisms/alert/alert.android.tsx +11 -8
- package/src/organisms/alert/alert.ios.tsx +2 -1
- package/src/organisms/alert/alert.types.ts +8 -3
- package/src/organisms/context-menu/context-menu.android.tsx +3 -2
- package/src/organisms/context-menu/context-menu.ios.tsx +1 -0
- package/src/organisms/fab-menu/fab-menu.android.tsx +3 -0
- package/src/organisms/fab-menu/fab-menu.ios.tsx +9 -1
- package/src/organisms/menu/menu-parts.ts +21 -0
- package/src/organisms/menu/menu.android.tsx +39 -10
- package/src/organisms/menu/menu.ios.tsx +55 -5
- package/src/organisms/menu/menu.types.ts +30 -7
- package/src/organisms/sheet/sheet.tsx +2 -1
- package/src/organisms/sheet/sheet.types.ts +7 -1
|
@@ -1,20 +1,70 @@
|
|
|
1
|
-
import {Button, Menu as SwiftUIMenu} from '@expo/ui/swift-ui'
|
|
1
|
+
import {Button, Image, Label, Menu as SwiftUIMenu} from '@expo/ui/swift-ui'
|
|
2
|
+
import {contentShape, disabled, frame, resizable, shapes} from '@expo/ui/swift-ui/modifiers'
|
|
3
|
+
import {iconResourceName} from '@hzblj/expo-native-icons'
|
|
4
|
+
import {useAccessibilityModifiers} from '@hzblj/kara-sx'
|
|
5
|
+
import {spacing} from '@hzblj/kara-theme'
|
|
6
|
+
import type {ReactNode} from 'react'
|
|
2
7
|
|
|
8
|
+
import {Icon} from '../../atoms/icon'
|
|
9
|
+
import {ZStack} from '../../atoms/z-stack'
|
|
3
10
|
import {useHostGuard} from '../../host-context'
|
|
4
11
|
import type {MenuComponent, MenuProps} from './menu.types'
|
|
12
|
+
import {isIconOnly} from './menu-parts'
|
|
5
13
|
|
|
6
|
-
|
|
14
|
+
const DISABLED = [disabled(true)]
|
|
15
|
+
|
|
16
|
+
/** Apple's least tap target, as `IconButton` takes it. */
|
|
17
|
+
const TARGET = 44
|
|
18
|
+
|
|
19
|
+
/** The whole square takes the tap, not only the glyph's own pixels. */
|
|
20
|
+
const WHOLE_TARGET = {modifiers: [contentShape(shapes.circle())]}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The icon beside the trigger's text, the size `Link` draws one beside body text. No colour of its own: the asset is a
|
|
24
|
+
* template image, so it takes the menu's tint with the text.
|
|
25
|
+
*/
|
|
26
|
+
const LABEL_ICON = [resizable(), frame({height: spacing.s20, width: spacing.s20})]
|
|
27
|
+
|
|
28
|
+
const triggerOf = (props: MenuProps): ReactNode => {
|
|
29
|
+
if (isIconOnly(props)) {
|
|
30
|
+
// An icon alone is drawn as an `IconButton`: `content.primary`, its label carried by the icon.
|
|
31
|
+
return (
|
|
32
|
+
<ZStack h={TARGET} ios={WHOLE_TARGET} w={TARGET}>
|
|
33
|
+
<Icon accessibilityLabel={props.accessibilityLabel} color="content.primary" name={props.icon} />
|
|
34
|
+
</ZStack>
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return props.icon ? (
|
|
39
|
+
<Label icon={<Image assetName={iconResourceName(props.icon)} modifiers={LABEL_ICON} />} title={props.label} />
|
|
40
|
+
) : (
|
|
41
|
+
props.label
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export const Menu: MenuComponent = (props: MenuProps) => {
|
|
7
46
|
useHostGuard('Menu')
|
|
47
|
+
const {accessibilityLabel, actions, label, testID} = props
|
|
48
|
+
// An icon alone carries its own label; with text, `accessibilityLabel` replaces it on the menu.
|
|
49
|
+
const modifiers = useAccessibilityModifiers({
|
|
50
|
+
accessibilityLabel: label === undefined ? undefined : accessibilityLabel,
|
|
51
|
+
})
|
|
8
52
|
|
|
9
53
|
return (
|
|
10
|
-
<SwiftUIMenu label={
|
|
54
|
+
<SwiftUIMenu label={triggerOf(props)} modifiers={modifiers} testID={testID}>
|
|
11
55
|
{actions.map(action => (
|
|
12
56
|
<Button
|
|
13
57
|
key={action.label}
|
|
14
|
-
label={action.label}
|
|
58
|
+
label={action.icon ? undefined : action.label}
|
|
59
|
+
modifiers={action.disabled ? DISABLED : undefined}
|
|
15
60
|
onPress={action.onPress}
|
|
16
61
|
role={action.destructive ? 'destructive' : 'default'}
|
|
17
|
-
|
|
62
|
+
>
|
|
63
|
+
{/* A menu row is the system's Label: our icon is its image, from the asset catalog, and UIKit sizes it. */}
|
|
64
|
+
{action.icon ? (
|
|
65
|
+
<Label icon={<Image assetName={iconResourceName(action.icon)} />} title={action.label} />
|
|
66
|
+
) : undefined}
|
|
67
|
+
</Button>
|
|
18
68
|
))}
|
|
19
69
|
</SwiftUIMenu>
|
|
20
70
|
)
|
|
@@ -10,8 +10,13 @@ export type MenuAction = {
|
|
|
10
10
|
*/
|
|
11
11
|
destructive?: boolean
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
* `
|
|
13
|
+
* Greys the action out and stops it responding, for one that does not apply right now: "Paste" with nothing copied.
|
|
14
|
+
* Off by default. `FabMenu` ignores it on Android, where Material's FAB menu items have no disabled state.
|
|
15
|
+
*/
|
|
16
|
+
disabled?: boolean
|
|
17
|
+
/**
|
|
18
|
+
* One of the app's icons, before the label. `Menu`, `ContextMenu` and `FabMenu` show it on both platforms,
|
|
19
|
+
* `ActionSheet` on Android only: an iOS confirmation dialog draws text alone.
|
|
15
20
|
*/
|
|
16
21
|
icon?: IconName
|
|
17
22
|
/** The action's text. Rows are keyed by it, so keep labels unique within one list. */
|
|
@@ -20,15 +25,33 @@ export type MenuAction = {
|
|
|
20
25
|
onPress: () => void
|
|
21
26
|
}
|
|
22
27
|
|
|
28
|
+
/** What the trigger needs: its text, or an icon and the words a screen reader says for it. */
|
|
29
|
+
type MenuTrigger = {label: string} | {accessibilityLabel: string; icon: IconName}
|
|
30
|
+
|
|
23
31
|
/**
|
|
24
|
-
* A
|
|
25
|
-
* A native atom: it renders inside `<Screen>` or `<Island>`.
|
|
32
|
+
* A button that opens a list of actions: a SwiftUI `Menu` on iOS, a Material dropdown anchored to it on Android. The
|
|
33
|
+
* trigger is text, an icon and text, or an icon alone. A native atom: it renders inside `<Screen>` or `<Island>`.
|
|
26
34
|
*/
|
|
27
|
-
export type MenuProps = {
|
|
35
|
+
export type MenuProps = MenuTrigger & {
|
|
36
|
+
/**
|
|
37
|
+
* What VoiceOver and TalkBack say for the trigger: "More options". Required with an `icon` and no `label`, since an
|
|
38
|
+
* icon has no words of its own. With a label, it replaces the label for screen readers.
|
|
39
|
+
*/
|
|
40
|
+
accessibilityLabel?: string
|
|
28
41
|
/** The menu's actions, top to bottom. */
|
|
29
42
|
actions: MenuAction[]
|
|
30
|
-
/**
|
|
31
|
-
|
|
43
|
+
/**
|
|
44
|
+
* One of the app's icons on the trigger. Before the `label`, in the same colour, when there is one; alone, the
|
|
45
|
+
* trigger is drawn as an `IconButton` (`content.primary`, in a 44pt target on iOS and 48dp on Android) and needs an
|
|
46
|
+
* `accessibilityLabel`.
|
|
47
|
+
*/
|
|
48
|
+
icon?: IconName
|
|
49
|
+
/**
|
|
50
|
+
* The trigger's text. Android draws it in the accent colour, with a chevron. Required unless there is an `icon`.
|
|
51
|
+
*/
|
|
52
|
+
label?: string
|
|
53
|
+
/** Test identifier, forwarded to the trigger. Reach an action by its label once the menu is open. */
|
|
54
|
+
testID?: string
|
|
32
55
|
}
|
|
33
56
|
|
|
34
57
|
export type MenuComponent = (props: MenuProps) => ReactNode
|
|
@@ -32,6 +32,7 @@ const SheetRoot = ({
|
|
|
32
32
|
onPresent,
|
|
33
33
|
ref,
|
|
34
34
|
scrollable = false,
|
|
35
|
+
systemBackground = false,
|
|
35
36
|
testID,
|
|
36
37
|
visible,
|
|
37
38
|
}: SheetProps) => {
|
|
@@ -105,7 +106,7 @@ const SheetRoot = ({
|
|
|
105
106
|
return (
|
|
106
107
|
<View collapsable={false} pointerEvents="box-none" style={styles.host}>
|
|
107
108
|
<TrueSheet
|
|
108
|
-
backgroundColor={theme.color(bg)}
|
|
109
|
+
backgroundColor={systemBackground && Platform.OS === 'ios' ? undefined : theme.color(bg)}
|
|
109
110
|
cornerRadius={CORNER_RADIUS}
|
|
110
111
|
detents={detents}
|
|
111
112
|
dimmed={dimmed}
|
|
@@ -51,7 +51,7 @@ export type SheetRef = {
|
|
|
51
51
|
* one; native atoms in its content go in an `Island`.
|
|
52
52
|
*/
|
|
53
53
|
export type SheetProps = {
|
|
54
|
-
/** The sheet's colour. `surface.primary` by default
|
|
54
|
+
/** The sheet's colour. `surface.primary` by default; ignored on iOS with `systemBackground`. */
|
|
55
55
|
bg?: ColorToken
|
|
56
56
|
/** The content. A `<Sheet.Header>` among the direct children becomes the native header instead. */
|
|
57
57
|
children: ReactNode
|
|
@@ -80,6 +80,12 @@ export type SheetProps = {
|
|
|
80
80
|
* and a header scrolls with the iOS 26 edge effect. Off by default; set it with a scrolling body.
|
|
81
81
|
*/
|
|
82
82
|
scrollable?: boolean
|
|
83
|
+
/**
|
|
84
|
+
* iOS: the system's own sheet background instead of `bg` — untinted Liquid Glass on iOS 26, a material blur before
|
|
85
|
+
* it — for a sheet that floats over content it should let through, like a map. Keep the content free of fills. Android
|
|
86
|
+
* keeps `bg`. Off by default.
|
|
87
|
+
*/
|
|
88
|
+
systemBackground?: boolean
|
|
83
89
|
/** Test identifier, forwarded to the native sheet. */
|
|
84
90
|
testID?: string
|
|
85
91
|
/** Presents the sheet while true; going false dismisses it. */
|