@boostdev/design-system-react-native 0.2.6 → 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/CHANGELOG.md +77 -0
- package/dist/index.cjs +164 -158
- package/dist/index.d.cts +12 -2
- package/dist/index.d.ts +12 -2
- package/dist/index.js +164 -158
- package/package.json +1 -1
- package/src/components/interaction/Dialog/Dialog.mdx +3 -2
- package/src/components/interaction/Dialog/Dialog.spec.tsx +42 -11
- package/src/components/interaction/Dialog/Dialog.tsx +19 -12
- package/src/components/interaction/DropdownMenu/DropdownMenu.mdx +3 -1
- package/src/components/interaction/DropdownMenu/DropdownMenu.spec.tsx +73 -0
- package/src/components/interaction/DropdownMenu/DropdownMenu.tsx +79 -73
- package/src/components/interaction/Popover/Popover.mdx +3 -1
- package/src/components/interaction/Popover/Popover.spec.tsx +43 -3
- package/src/components/interaction/Popover/Popover.tsx +23 -13
- package/src/components/interaction/SideSheet/SideSheet.mdx +4 -3
- package/src/components/interaction/SideSheet/SideSheet.spec.tsx +8 -9
- package/src/components/interaction/SideSheet/SideSheet.tsx +9 -3
- package/src/components/ui/Alert/Alert.spec.tsx +32 -1
- package/src/components/ui/Alert/Alert.stories.tsx +45 -0
- package/src/components/ui/Alert/Alert.tsx +11 -2
- package/src/components/ui/NotificationBanner/NotificationBanner.spec.tsx +32 -1
- package/src/components/ui/NotificationBanner/NotificationBanner.stories.tsx +30 -0
- package/src/components/ui/NotificationBanner/NotificationBanner.tsx +16 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,83 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
3
|
All notable changes to `@boostdev/design-system-react-native` are documented here.
|
|
4
|
+
## [0.3.0] - 2026-09-23
|
|
5
|
+
### Added
|
|
6
|
+
- Feat(alert): support arbitrary and theme-aware children
|
|
7
|
+
|
|
8
|
+
Render string/number children in the themed body Text as before, but render any other node as-is so children can hold custom layout (View, Pressable, etc.). Also accept a function child that receives the variant's resolved text color, so custom content can match the theme. ([`4a43a8e`](https://gitlab.com/b00stdev/boostdev-design-system-react-native/-/commit/4a43a8ead2a70675a2e7eb39e86a0bed18515c93))
|
|
9
|
+
- Feat(notification-banner): support arbitrary and theme-aware children
|
|
10
|
+
|
|
11
|
+
Mirror the Alert change: only string/number children go in the themed body Text; any other node renders as-is. Move flex:1 onto a wrapper View so layout is preserved for non-text children. Accept a function child that receives the resolved text color. ([`d804efc`](https://gitlab.com/b00stdev/boostdev-design-system-react-native/-/commit/d804efc5721924b700730c23402838ca5da1bcb6))
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
- Fix(dropdown-menu): make each item reachable for VoiceOver on iOS
|
|
15
|
+
|
|
16
|
+
The sheet's content was wrapped in a no-op Pressable to swallow presses.
|
|
17
|
+
On iOS a Pressable is accessible by default, and an accessible view is a
|
|
18
|
+
single element to VoiceOver and XCUITest: the whole sheet (title, Done,
|
|
19
|
+
every item) read as one element whose label listed all items, and no item
|
|
20
|
+
could be picked on its own. The wrapper was also unneeded: the backdrop is
|
|
21
|
+
a sibling behind the sheet, so sheet touches never reach it.
|
|
22
|
+
|
|
23
|
+
The wrapper is gone, so title, Done and each menuitem are separate
|
|
24
|
+
elements. The backdrop still closes on press but is hidden from assistive
|
|
25
|
+
tech (testID "bds-dropdownmenu-backdrop"); Done is the accessible close.
|
|
26
|
+
The sheet is accessibilityViewIsModal and closes on VoiceOver's escape
|
|
27
|
+
gesture. Specs pin the roleless backdrop, the missing "Close menu" button,
|
|
28
|
+
independent menuitems and no press-swallowing wrapper around them.
|
|
29
|
+
|
|
30
|
+
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> ([`a42e0da`](https://gitlab.com/b00stdev/boostdev-design-system-react-native/-/commit/a42e0daa2ece8db443326b07840c8a15edcb2884))
|
|
31
|
+
- Fix(side-sheet): hide the backdrop from assistive tech, close on escape
|
|
32
|
+
|
|
33
|
+
The full-screen backdrop was an accessible "Close side sheet" button next
|
|
34
|
+
to the real close button. VoiceOver listed the close control twice, and a
|
|
35
|
+
double-tap on the full-screen element activates its centre, which can land
|
|
36
|
+
on the panel instead of closing.
|
|
37
|
+
|
|
38
|
+
The backdrop still closes on press but is hidden from assistive tech
|
|
39
|
+
(testID "bds-sidesheet-backdrop"); the close button is the one accessible
|
|
40
|
+
close. The panel is accessibilityViewIsModal and closes on VoiceOver's
|
|
41
|
+
escape gesture. Specs pin exactly one "Close side sheet" button and a
|
|
42
|
+
roleless backdrop that still calls onClose.
|
|
43
|
+
|
|
44
|
+
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> ([`4b93294`](https://gitlab.com/b00stdev/boostdev-design-system-react-native/-/commit/4b932947c3989cbf9a23cedb9c545b2d37243781))
|
|
45
|
+
- Fix(dialog): make the dialog's content reachable for VoiceOver on iOS
|
|
46
|
+
|
|
47
|
+
The backdrop Pressable wrapped the panel. On iOS a Pressable is
|
|
48
|
+
accessible by default, and an accessible view is a single element to
|
|
49
|
+
VoiceOver and XCUITest: an open dialog was one full-screen "Close dialog"
|
|
50
|
+
button. The title, the content and the dialog's own buttons could not be
|
|
51
|
+
reached, and a VoiceOver double-tap activated the centre of the screen
|
|
52
|
+
(the panel), so it did nothing.
|
|
53
|
+
|
|
54
|
+
The backdrop is now a sibling behind the panel: it still closes on press
|
|
55
|
+
but is hidden from assistive tech (testID "bds-dialog-backdrop"), and the
|
|
56
|
+
close button is the accessible close. The panel is a plain View,
|
|
57
|
+
accessibilityViewIsModal, and closes on VoiceOver's escape gesture.
|
|
58
|
+
Verified on an iPhone 17 simulator (iOS 26.1): title, close button,
|
|
59
|
+
content and a "Klaar" button inside are separate elements, a backdrop tap
|
|
60
|
+
closes, a panel tap does not, and the dialog looks the same. Specs pin one
|
|
61
|
+
"Close dialog" button, a roleless backdrop that does not contain the
|
|
62
|
+
content, and content presses that do not close.
|
|
63
|
+
|
|
64
|
+
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> ([`fe6703e`](https://gitlab.com/b00stdev/boostdev-design-system-react-native/-/commit/fe6703e4aeb9b716212dacf94886cdc7629b2f55))
|
|
65
|
+
- Fix(popover): keep the popover's content reachable for VoiceOver on iOS
|
|
66
|
+
|
|
67
|
+
The "Close popover" backdrop Pressable wrapped the panel, so on iOS the
|
|
68
|
+
open popover was a single accessibility element and its content could not
|
|
69
|
+
be reached by VoiceOver or XCUITest.
|
|
70
|
+
|
|
71
|
+
The backdrop is now a sibling behind the panel. Popover has no close
|
|
72
|
+
button, so the backdrop stays the accessible "Close popover" button, with
|
|
73
|
+
onAccessibilityTap so a VoiceOver double-tap closes it (without it the
|
|
74
|
+
activation lands on the centred panel). The panel is a plain View and
|
|
75
|
+
VoiceOver's escape gesture closes the popover. Specs pin the separate
|
|
76
|
+
backdrop button, content outside it, and content presses that do not
|
|
77
|
+
close.
|
|
78
|
+
|
|
79
|
+
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> ([`5ddb57c`](https://gitlab.com/b00stdev/boostdev-design-system-react-native/-/commit/5ddb57c5158b8181d9d87eb706099662519fbdad))
|
|
80
|
+
|
|
4
81
|
## [0.2.6] - 2026-06-15
|
|
5
82
|
### Fixed
|
|
6
83
|
- Fix(collapsible): render the disclosure indicator as a border-box chevron instead of the ▸ (U+25B8) glyph char
|
package/dist/index.cjs
CHANGED
|
@@ -530,6 +530,7 @@ function Alert({
|
|
|
530
530
|
error: { bg: colors2.colorRedSubtle, text: colors2.colorOnBg, border: colors2.colorError }
|
|
531
531
|
};
|
|
532
532
|
const { bg, text, border: borderColor } = variantColors[variant];
|
|
533
|
+
const resolvedChildren = typeof children === "function" ? children({ color: text }) : children;
|
|
533
534
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
534
535
|
import_react_native9.View,
|
|
535
536
|
{
|
|
@@ -540,7 +541,7 @@ function Alert({
|
|
|
540
541
|
icon && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native9.View, { style: styles7.icon, children: icon }),
|
|
541
542
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_react_native9.View, { style: styles7.content, children: [
|
|
542
543
|
title && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native9.Text, { style: [styles7.title, { color: text }], children: title }),
|
|
543
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native9.Text, { style: [styles7.body, { color: text }], children })
|
|
544
|
+
typeof resolvedChildren === "string" || typeof resolvedChildren === "number" ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native9.Text, { style: [styles7.body, { color: text }], children: resolvedChildren }) : resolvedChildren
|
|
544
545
|
] }),
|
|
545
546
|
onDismiss && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
546
547
|
import_react_native9.Pressable,
|
|
@@ -569,8 +570,10 @@ var styles8 = import_react_native10.StyleSheet.create({
|
|
|
569
570
|
paddingHorizontal: import_native.spacing.m,
|
|
570
571
|
gap: import_native.spacing.xs
|
|
571
572
|
},
|
|
573
|
+
body: {
|
|
574
|
+
flex: 1
|
|
575
|
+
},
|
|
572
576
|
content: {
|
|
573
|
-
flex: 1,
|
|
574
577
|
fontSize: import_native.font.size.bodyS,
|
|
575
578
|
fontFamily: import_native.font.family.body,
|
|
576
579
|
lineHeight: lineHeight.bodyS
|
|
@@ -596,6 +599,7 @@ function NotificationBanner({
|
|
|
596
599
|
error: { bg: colors2.colorRedSubtle, text: colors2.colorOnBg, border: colors2.colorError }
|
|
597
600
|
};
|
|
598
601
|
const { bg, text, border: borderColor } = variantColors[variant];
|
|
602
|
+
const resolvedChildren = typeof children === "function" ? children({ color: text }) : children;
|
|
599
603
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
600
604
|
import_react_native10.View,
|
|
601
605
|
{
|
|
@@ -603,7 +607,7 @@ function NotificationBanner({
|
|
|
603
607
|
accessibilityLiveRegion: isUrgent ? "assertive" : "polite",
|
|
604
608
|
style: [styles8.banner, { backgroundColor: bg, borderBottomWidth: 3, borderBottomColor: borderColor }, style],
|
|
605
609
|
children: [
|
|
606
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_native10.Text, { style: [styles8.content, { color: text }], children }),
|
|
610
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_native10.View, { style: styles8.body, children: typeof resolvedChildren === "string" || typeof resolvedChildren === "number" ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_native10.Text, { style: [styles8.content, { color: text }], children: resolvedChildren }) : resolvedChildren }),
|
|
607
611
|
action,
|
|
608
612
|
onDismiss && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
609
613
|
import_react_native10.Pressable,
|
|
@@ -3797,46 +3801,48 @@ function Dialog({
|
|
|
3797
3801
|
transparent: true,
|
|
3798
3802
|
animationType: "fade",
|
|
3799
3803
|
onRequestClose: onClose,
|
|
3800
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime44.
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
}
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3804
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_react_native44.View, { style: styles40.overlay, children: [
|
|
3805
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
3806
|
+
import_react_native44.Pressable,
|
|
3807
|
+
{
|
|
3808
|
+
testID: "bds-dialog-backdrop",
|
|
3809
|
+
style: import_react_native44.StyleSheet.absoluteFill,
|
|
3810
|
+
onPress: onClose,
|
|
3811
|
+
accessible: false,
|
|
3812
|
+
importantForAccessibility: "no"
|
|
3813
|
+
}
|
|
3814
|
+
),
|
|
3815
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
3816
|
+
import_react_native44.View,
|
|
3817
|
+
{
|
|
3818
|
+
style: [styles40.panel, { backgroundColor: colors2.colorGreySubtle }, style],
|
|
3819
|
+
accessibilityViewIsModal: true,
|
|
3820
|
+
onAccessibilityEscape: onClose,
|
|
3821
|
+
children: [
|
|
3822
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
3823
|
+
import_react_native44.Pressable,
|
|
3824
|
+
{
|
|
3825
|
+
style: styles40.closeButton,
|
|
3826
|
+
onPress: onClose,
|
|
3827
|
+
accessibilityRole: "button",
|
|
3828
|
+
accessibilityLabel: "Close dialog",
|
|
3829
|
+
hitSlop: 8,
|
|
3830
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
3831
|
+
import_react_native44.Text,
|
|
3832
|
+
{
|
|
3833
|
+
style: [styles40.closeText, { color: colors2.colorOnBgSubtle }],
|
|
3834
|
+
"aria-hidden": true,
|
|
3835
|
+
children: "\u2715"
|
|
3836
|
+
}
|
|
3837
|
+
)
|
|
3838
|
+
}
|
|
3839
|
+
),
|
|
3840
|
+
!!title && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react_native44.View, { style: styles40.header, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react_native44.Text, { style: [styles40.title, { color: colors2.colorOnGreySubtle }], children: title }) }),
|
|
3841
|
+
children
|
|
3842
|
+
]
|
|
3843
|
+
}
|
|
3844
|
+
)
|
|
3845
|
+
] })
|
|
3840
3846
|
}
|
|
3841
3847
|
);
|
|
3842
3848
|
}
|
|
@@ -3954,8 +3960,9 @@ function SideSheet({
|
|
|
3954
3960
|
{
|
|
3955
3961
|
style: import_react_native45.StyleSheet.absoluteFill,
|
|
3956
3962
|
onPress: onClose,
|
|
3957
|
-
|
|
3958
|
-
|
|
3963
|
+
testID: "bds-sidesheet-backdrop",
|
|
3964
|
+
accessible: false,
|
|
3965
|
+
importantForAccessibility: "no"
|
|
3959
3966
|
}
|
|
3960
3967
|
)
|
|
3961
3968
|
}
|
|
@@ -3971,7 +3978,8 @@ function SideSheet({
|
|
|
3971
3978
|
},
|
|
3972
3979
|
style
|
|
3973
3980
|
],
|
|
3974
|
-
|
|
3981
|
+
accessibilityViewIsModal: true,
|
|
3982
|
+
onAccessibilityEscape: onClose,
|
|
3975
3983
|
children: [
|
|
3976
3984
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
3977
3985
|
import_react_native45.View,
|
|
@@ -4283,8 +4291,9 @@ function DropdownMenu({
|
|
|
4283
4291
|
{
|
|
4284
4292
|
style: import_react_native47.StyleSheet.absoluteFill,
|
|
4285
4293
|
onPress: () => setOpen(false),
|
|
4286
|
-
|
|
4287
|
-
|
|
4294
|
+
testID: "bds-dropdownmenu-backdrop",
|
|
4295
|
+
accessible: false,
|
|
4296
|
+
importantForAccessibility: "no"
|
|
4288
4297
|
}
|
|
4289
4298
|
)
|
|
4290
4299
|
}
|
|
@@ -4299,100 +4308,95 @@ function DropdownMenu({
|
|
|
4299
4308
|
transform: [{ translateY: slideAnim }]
|
|
4300
4309
|
}
|
|
4301
4310
|
],
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
|
|
4306
|
-
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
-
|
|
4310
|
-
{
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
|
|
4316
|
-
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
hitSlop: 8,
|
|
4324
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
4325
|
-
import_react_native47.Text,
|
|
4326
|
-
{
|
|
4327
|
-
style: [
|
|
4328
|
-
styles43.closeText,
|
|
4329
|
-
{ color: colors2.colorInteractive }
|
|
4330
|
-
],
|
|
4331
|
-
children: "Done"
|
|
4332
|
-
}
|
|
4333
|
-
)
|
|
4334
|
-
}
|
|
4335
|
-
)
|
|
4336
|
-
]
|
|
4337
|
-
}
|
|
4338
|
-
),
|
|
4339
|
-
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
4340
|
-
import_react_native47.FlatList,
|
|
4341
|
-
{
|
|
4342
|
-
data: items,
|
|
4343
|
-
keyExtractor: (item) => item.id,
|
|
4344
|
-
renderItem: ({ item }) => /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_jsx_runtime47.Fragment, { children: [
|
|
4345
|
-
item.separator && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
4346
|
-
import_react_native47.View,
|
|
4311
|
+
accessibilityViewIsModal: true,
|
|
4312
|
+
onAccessibilityEscape: () => setOpen(false),
|
|
4313
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_react_native47.SafeAreaView, { children: [
|
|
4314
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
4315
|
+
import_react_native47.View,
|
|
4316
|
+
{
|
|
4317
|
+
style: [
|
|
4318
|
+
styles43.sheetHeader,
|
|
4319
|
+
{ borderBottomColor: colors2.colorBgSubtle }
|
|
4320
|
+
],
|
|
4321
|
+
children: [
|
|
4322
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_react_native47.Text, { style: [styles43.sheetTitle, { color: colors2.colorOnBg }], children: title }),
|
|
4323
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
4324
|
+
import_react_native47.Pressable,
|
|
4325
|
+
{
|
|
4326
|
+
accessibilityRole: "button",
|
|
4327
|
+
accessibilityLabel: "Close",
|
|
4328
|
+
onPress: () => setOpen(false),
|
|
4329
|
+
hitSlop: 8,
|
|
4330
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
4331
|
+
import_react_native47.Text,
|
|
4347
4332
|
{
|
|
4348
4333
|
style: [
|
|
4349
|
-
styles43.
|
|
4350
|
-
{
|
|
4334
|
+
styles43.closeText,
|
|
4335
|
+
{ color: colors2.colorInteractive }
|
|
4351
4336
|
],
|
|
4352
|
-
|
|
4353
|
-
}
|
|
4354
|
-
),
|
|
4355
|
-
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
4356
|
-
import_react_native47.Pressable,
|
|
4357
|
-
{
|
|
4358
|
-
accessibilityRole: "menuitem",
|
|
4359
|
-
accessibilityLabel: item.label,
|
|
4360
|
-
accessibilityState: { disabled: item.disabled },
|
|
4361
|
-
disabled: item.disabled,
|
|
4362
|
-
onPress: () => handleItemPress(item),
|
|
4363
|
-
style: ({ pressed }) => [
|
|
4364
|
-
styles43.item,
|
|
4365
|
-
pressed && { backgroundColor: colors2.colorBgSubtle },
|
|
4366
|
-
item.disabled && { opacity: 0.4 }
|
|
4367
|
-
],
|
|
4368
|
-
children: [
|
|
4369
|
-
!!item.icon && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
4370
|
-
import_react_native47.View,
|
|
4371
|
-
{
|
|
4372
|
-
importantForAccessibility: "no-hide-descendants",
|
|
4373
|
-
accessibilityElementsHidden: true,
|
|
4374
|
-
children: item.icon
|
|
4375
|
-
}
|
|
4376
|
-
),
|
|
4377
|
-
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
4378
|
-
import_react_native47.Text,
|
|
4379
|
-
{
|
|
4380
|
-
style: [
|
|
4381
|
-
styles43.itemText,
|
|
4382
|
-
{ color: colors2.colorOnBg }
|
|
4383
|
-
],
|
|
4384
|
-
children: item.label
|
|
4385
|
-
}
|
|
4386
|
-
)
|
|
4387
|
-
]
|
|
4337
|
+
children: "Done"
|
|
4388
4338
|
}
|
|
4389
4339
|
)
|
|
4390
|
-
|
|
4391
|
-
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
|
|
4340
|
+
}
|
|
4341
|
+
)
|
|
4342
|
+
]
|
|
4343
|
+
}
|
|
4344
|
+
),
|
|
4345
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
4346
|
+
import_react_native47.FlatList,
|
|
4347
|
+
{
|
|
4348
|
+
data: items,
|
|
4349
|
+
keyExtractor: (item) => item.id,
|
|
4350
|
+
renderItem: ({ item }) => /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_jsx_runtime47.Fragment, { children: [
|
|
4351
|
+
item.separator && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
4352
|
+
import_react_native47.View,
|
|
4353
|
+
{
|
|
4354
|
+
style: [
|
|
4355
|
+
styles43.separator,
|
|
4356
|
+
{ backgroundColor: colors2.colorBgSubtle }
|
|
4357
|
+
],
|
|
4358
|
+
accessibilityRole: "none"
|
|
4359
|
+
}
|
|
4360
|
+
),
|
|
4361
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
4362
|
+
import_react_native47.Pressable,
|
|
4363
|
+
{
|
|
4364
|
+
accessibilityRole: "menuitem",
|
|
4365
|
+
accessibilityLabel: item.label,
|
|
4366
|
+
accessibilityState: { disabled: item.disabled },
|
|
4367
|
+
disabled: item.disabled,
|
|
4368
|
+
onPress: () => handleItemPress(item),
|
|
4369
|
+
style: ({ pressed }) => [
|
|
4370
|
+
styles43.item,
|
|
4371
|
+
pressed && { backgroundColor: colors2.colorBgSubtle },
|
|
4372
|
+
item.disabled && { opacity: 0.4 }
|
|
4373
|
+
],
|
|
4374
|
+
children: [
|
|
4375
|
+
!!item.icon && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
4376
|
+
import_react_native47.View,
|
|
4377
|
+
{
|
|
4378
|
+
importantForAccessibility: "no-hide-descendants",
|
|
4379
|
+
accessibilityElementsHidden: true,
|
|
4380
|
+
children: item.icon
|
|
4381
|
+
}
|
|
4382
|
+
),
|
|
4383
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
4384
|
+
import_react_native47.Text,
|
|
4385
|
+
{
|
|
4386
|
+
style: [
|
|
4387
|
+
styles43.itemText,
|
|
4388
|
+
{ color: colors2.colorOnBg }
|
|
4389
|
+
],
|
|
4390
|
+
children: item.label
|
|
4391
|
+
}
|
|
4392
|
+
)
|
|
4393
|
+
]
|
|
4394
|
+
}
|
|
4395
|
+
)
|
|
4396
|
+
] })
|
|
4397
|
+
}
|
|
4398
|
+
)
|
|
4399
|
+
] })
|
|
4396
4400
|
}
|
|
4397
4401
|
)
|
|
4398
4402
|
] })
|
|
@@ -4436,6 +4440,7 @@ function Popover({
|
|
|
4436
4440
|
}) {
|
|
4437
4441
|
const { colors: colors2 } = useTheme();
|
|
4438
4442
|
const [isOpen, setIsOpen] = (0, import_react19.useState)(false);
|
|
4443
|
+
const close = () => setIsOpen(false);
|
|
4439
4444
|
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_react_native48.View, { style: [styles44.wrapper, style], children: [
|
|
4440
4445
|
import_react19.default.cloneElement(children, {
|
|
4441
4446
|
onPress: () => setIsOpen(true),
|
|
@@ -4448,27 +4453,28 @@ function Popover({
|
|
|
4448
4453
|
visible: isOpen,
|
|
4449
4454
|
transparent: true,
|
|
4450
4455
|
animationType: "fade",
|
|
4451
|
-
onRequestClose:
|
|
4452
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime48.
|
|
4453
|
-
|
|
4454
|
-
|
|
4455
|
-
|
|
4456
|
-
|
|
4457
|
-
|
|
4458
|
-
|
|
4459
|
-
|
|
4460
|
-
|
|
4461
|
-
|
|
4462
|
-
|
|
4463
|
-
|
|
4464
|
-
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
|
|
4468
|
-
|
|
4469
|
-
|
|
4470
|
-
|
|
4471
|
-
|
|
4456
|
+
onRequestClose: close,
|
|
4457
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_react_native48.View, { style: styles44.overlay, onAccessibilityEscape: close, children: [
|
|
4458
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
4459
|
+
import_react_native48.Pressable,
|
|
4460
|
+
{
|
|
4461
|
+
testID: "bds-popover-backdrop",
|
|
4462
|
+
style: import_react_native48.StyleSheet.absoluteFill,
|
|
4463
|
+
onPress: close,
|
|
4464
|
+
onAccessibilityTap: close,
|
|
4465
|
+
accessibilityRole: "button",
|
|
4466
|
+
accessibilityLabel: "Close popover"
|
|
4467
|
+
}
|
|
4468
|
+
),
|
|
4469
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
4470
|
+
import_react_native48.View,
|
|
4471
|
+
{
|
|
4472
|
+
style: [styles44.panel, { backgroundColor: colors2.colorBg }],
|
|
4473
|
+
accessibilityLabel,
|
|
4474
|
+
children: content
|
|
4475
|
+
}
|
|
4476
|
+
)
|
|
4477
|
+
] })
|
|
4472
4478
|
}
|
|
4473
4479
|
)
|
|
4474
4480
|
] });
|
package/dist/index.d.cts
CHANGED
|
@@ -137,20 +137,30 @@ interface SkeletonProps {
|
|
|
137
137
|
declare function Skeleton({ style }: SkeletonProps): react_jsx_runtime.JSX.Element;
|
|
138
138
|
|
|
139
139
|
type AlertVariant = 'info' | 'success' | 'warning' | 'error';
|
|
140
|
+
/** Function form of children: receives the variant's resolved text color so
|
|
141
|
+
* custom content can match the alert's theme. */
|
|
142
|
+
type AlertContentRenderProp = (props: {
|
|
143
|
+
color: string;
|
|
144
|
+
}) => ReactNode;
|
|
140
145
|
interface AlertProps {
|
|
141
146
|
variant?: AlertVariant;
|
|
142
147
|
icon?: ReactNode;
|
|
143
148
|
title?: string;
|
|
144
|
-
children: ReactNode;
|
|
149
|
+
children: ReactNode | AlertContentRenderProp;
|
|
145
150
|
onDismiss?: () => void;
|
|
146
151
|
style?: StyleProp<ViewStyle>;
|
|
147
152
|
}
|
|
148
153
|
declare function Alert({ variant, icon, title, children, onDismiss, style, }: Readonly<AlertProps>): react_jsx_runtime.JSX.Element;
|
|
149
154
|
|
|
150
155
|
type BannerVariant = 'info' | 'success' | 'warning' | 'error';
|
|
156
|
+
/** Function form of children: receives the variant's resolved text color so
|
|
157
|
+
* custom content can match the banner's theme. */
|
|
158
|
+
type BannerContentRenderProp = (props: {
|
|
159
|
+
color: string;
|
|
160
|
+
}) => ReactNode;
|
|
151
161
|
interface NotificationBannerProps {
|
|
152
162
|
variant?: BannerVariant;
|
|
153
|
-
children: ReactNode;
|
|
163
|
+
children: ReactNode | BannerContentRenderProp;
|
|
154
164
|
action?: ReactNode;
|
|
155
165
|
onDismiss?: () => void;
|
|
156
166
|
style?: StyleProp<ViewStyle>;
|
package/dist/index.d.ts
CHANGED
|
@@ -137,20 +137,30 @@ interface SkeletonProps {
|
|
|
137
137
|
declare function Skeleton({ style }: SkeletonProps): react_jsx_runtime.JSX.Element;
|
|
138
138
|
|
|
139
139
|
type AlertVariant = 'info' | 'success' | 'warning' | 'error';
|
|
140
|
+
/** Function form of children: receives the variant's resolved text color so
|
|
141
|
+
* custom content can match the alert's theme. */
|
|
142
|
+
type AlertContentRenderProp = (props: {
|
|
143
|
+
color: string;
|
|
144
|
+
}) => ReactNode;
|
|
140
145
|
interface AlertProps {
|
|
141
146
|
variant?: AlertVariant;
|
|
142
147
|
icon?: ReactNode;
|
|
143
148
|
title?: string;
|
|
144
|
-
children: ReactNode;
|
|
149
|
+
children: ReactNode | AlertContentRenderProp;
|
|
145
150
|
onDismiss?: () => void;
|
|
146
151
|
style?: StyleProp<ViewStyle>;
|
|
147
152
|
}
|
|
148
153
|
declare function Alert({ variant, icon, title, children, onDismiss, style, }: Readonly<AlertProps>): react_jsx_runtime.JSX.Element;
|
|
149
154
|
|
|
150
155
|
type BannerVariant = 'info' | 'success' | 'warning' | 'error';
|
|
156
|
+
/** Function form of children: receives the variant's resolved text color so
|
|
157
|
+
* custom content can match the banner's theme. */
|
|
158
|
+
type BannerContentRenderProp = (props: {
|
|
159
|
+
color: string;
|
|
160
|
+
}) => ReactNode;
|
|
151
161
|
interface NotificationBannerProps {
|
|
152
162
|
variant?: BannerVariant;
|
|
153
|
-
children: ReactNode;
|
|
163
|
+
children: ReactNode | BannerContentRenderProp;
|
|
154
164
|
action?: ReactNode;
|
|
155
165
|
onDismiss?: () => void;
|
|
156
166
|
style?: StyleProp<ViewStyle>;
|