@helpwave/hightide-native 0.6.0 → 0.7.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/package.json +3 -3
- package/src/components/card/Card.tsx +2 -4
- package/src/components/chat/ChatAttachmentMessageBubble.tsx +152 -90
- package/src/components/chat/ChatConversationList.tsx +4 -12
- package/src/components/chat/ChatConversationRow.tsx +159 -164
- package/src/components/chat/ChatDateDivider.tsx +3 -8
- package/src/components/chat/ChatMessageBubble.tsx +51 -45
- package/src/components/chat/ChatMessageComposer.tsx +4 -12
- package/src/components/chat/ChatMessageList.tsx +3 -9
- package/src/components/chat/ChatQuickReplyChip.tsx +41 -27
- package/src/components/chat/ChatSystemLine.tsx +4 -12
- package/src/components/chat/ChatThreadHeader.tsx +136 -101
- package/src/components/layout/Divider.tsx +2 -4
- package/src/components/list/ListActionItem.tsx +57 -65
- package/src/components/list/ListItem.tsx +8 -28
- package/src/components/list/ListItemTextContent.tsx +4 -2
- package/src/components/list/ListNavigationItem.tsx +55 -63
- package/src/components/user-interaction/Button.tsx +43 -49
- package/src/components/user-interaction/Checkbox.tsx +47 -48
- package/src/components/user-interaction/IconButton.tsx +40 -42
- package/src/components/user-interaction/Input.tsx +69 -80
- package/src/components/user-interaction/MultiSelect/MultiSelect.tsx +40 -0
- package/src/components/user-interaction/MultiSelect/MultiSelectContext.tsx +70 -0
- package/src/components/user-interaction/MultiSelect/MultiSelectMenu.tsx +87 -0
- package/src/components/user-interaction/MultiSelect/MultiSelectOption.tsx +87 -0
- package/src/components/user-interaction/MultiSelect/MultiSelectRoot.tsx +194 -0
- package/src/components/user-interaction/MultiSelect/MultiSelectTrigger.tsx +123 -0
- package/src/components/user-interaction/MultiSelect/index.ts +6 -0
- package/src/components/user-interaction/SearchBar.tsx +11 -17
- package/src/components/user-interaction/Select/Select.tsx +40 -0
- package/src/components/user-interaction/Select/SelectContext.tsx +69 -0
- package/src/components/user-interaction/Select/SelectMenu.tsx +87 -0
- package/src/components/user-interaction/Select/SelectOption.tsx +77 -0
- package/src/components/user-interaction/Select/SelectRoot.tsx +186 -0
- package/src/components/user-interaction/Select/SelectTrigger.tsx +92 -0
- package/src/components/user-interaction/Select/index.ts +6 -0
- package/src/components/user-interaction/Switch.tsx +46 -98
- package/src/components/user-interaction/Textarea.tsx +165 -12
- package/src/components/user-interaction/ThemedPressable.tsx +48 -49
- package/src/components/visualization-and-display/Avatar.tsx +19 -17
- package/src/components/visualization-and-display/Chip.tsx +4 -12
- package/src/components/visualization-and-display/ThemedText.tsx +12 -5
- package/src/enums/chatMessageDirection.ts +18 -0
- package/src/enums/chatMessageStatus.ts +18 -0
- package/src/enums/hightideThemeModes.ts +18 -0
- package/src/enums/index.ts +7 -0
- package/src/enums/listItemContentOrder.ts +18 -0
- package/src/enums/themedTextAppearance.ts +18 -0
- package/src/enums/useMultiSelectFirstHighlightBehavior.ts +18 -0
- package/src/enums/useSelectFirstHighlightBehavior.ts +18 -0
- package/src/global-contexts/content-theme/ContentThemeProvider.tsx +9 -5
- package/src/global-contexts/theme/ThemeProvider.tsx +4 -1
- package/src/hooks/index.ts +2 -0
- package/src/hooks/useAnimatedStyleTransition.ts +460 -0
- package/src/hooks/useMemoizedTheme.ts +23 -0
- package/src/hooks/useMultiSelect.ts +3 -1
- package/src/hooks/useSelect.ts +3 -1
- package/src/icons/HightideIconRegistry.ts +2 -0
- package/src/theme/adapters/style-adapter-utils.ts +121 -27
- package/src/theme/resolvers/avatar.ts +48 -39
- package/src/theme/resolvers/button.ts +7 -17
- package/src/theme/resolvers/chat/attachment-message-bubble.ts +5 -6
- package/src/theme/resolvers/chat/conversation-row.ts +4 -6
- package/src/theme/resolvers/chat/message-bubble.ts +1 -2
- package/src/theme/resolvers/chat/message-composer.ts +1 -2
- package/src/theme/resolvers/chat/quick-reply-chip.ts +2 -3
- package/src/theme/resolvers/chat/system-line.ts +1 -2
- package/src/theme/resolvers/chat/thread-header.ts +3 -4
- package/src/theme/resolvers/checkbox.ts +2 -2
- package/src/theme/resolvers/chip.ts +1 -2
- package/src/theme/resolvers/iconButton.ts +4 -13
- package/src/theme/resolvers/input.ts +30 -14
- package/src/theme/resolvers/listItem.ts +2 -3
- package/src/theme/resolvers/multiSelect.ts +1 -2
- package/src/theme/resolvers/searchBar.ts +1 -2
- package/src/theme/resolvers/select.ts +1 -2
- package/src/theme/resolvers/themedPressable.ts +4 -15
- package/src/theme/themes/hightideThemes.ts +3 -1
- package/src/theme/types/components/chat.ts +6 -21
- package/src/theme/types/components/input.ts +3 -0
- package/src/theme/types/components/textarea.ts +1 -0
- package/src/theme/types/resolver.ts +4 -27
- package/src/utils/index.ts +1 -0
- package/src/utils/pressableInteraction.ts +7 -0
- package/src/components/user-interaction/MultiSelect.tsx +0 -282
- package/src/components/user-interaction/Select.tsx +0 -242
|
@@ -22,6 +22,7 @@ import {
|
|
|
22
22
|
import type { ColorPairToken } from '@helpwave/hightide-design/theme-tokens'
|
|
23
23
|
|
|
24
24
|
import { useTheme } from '../../global-contexts/theme/ThemeContext'
|
|
25
|
+
import { useMemoizedTheme, useMemoizedThemeFactory } from '../../hooks/useMemoizedTheme'
|
|
25
26
|
import type {
|
|
26
27
|
AvatarGroupContainerStyle,
|
|
27
28
|
AvatarGroupStackStyle,
|
|
@@ -32,6 +33,7 @@ import type {
|
|
|
32
33
|
AvatarStatus,
|
|
33
34
|
AvatarStyle,
|
|
34
35
|
AvatarTextStyle,
|
|
36
|
+
AvatarThemeResolvers,
|
|
35
37
|
AvatarStatusDotStyle,
|
|
36
38
|
AvatarWithStatusState
|
|
37
39
|
} from '../../theme/types/components/avatar'
|
|
@@ -126,10 +128,10 @@ export const Avatar = ({
|
|
|
126
128
|
setImage(initialImage)
|
|
127
129
|
}, [image?.avatarUrl, initialImage])
|
|
128
130
|
|
|
129
|
-
const resolvedAvatar = theme.components.avatar.container
|
|
130
|
-
const resolvedImage = theme.components.avatar.image
|
|
131
|
-
const resolvedText = theme.components.avatar.text
|
|
132
|
-
const resolvedIcon = theme.components.avatar.icon
|
|
131
|
+
const resolvedAvatar = useMemoizedTheme(theme.components.avatar.container, state, avatarStyle)
|
|
132
|
+
const resolvedImage = useMemoizedTheme(theme.components.avatar.image, state, imageStyle)
|
|
133
|
+
const resolvedText = useMemoizedTheme(theme.components.avatar.text, state, textStyle)
|
|
134
|
+
const resolvedIcon = useMemoizedTheme(theme.components.avatar.icon, state, iconStyle)
|
|
133
135
|
|
|
134
136
|
return (
|
|
135
137
|
<View
|
|
@@ -196,13 +198,13 @@ export const AvatarGroup = ({
|
|
|
196
198
|
count: displayedProfiles.length,
|
|
197
199
|
}), [size, color, displayedProfiles.length])
|
|
198
200
|
|
|
199
|
-
const avatarResolvers =
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
)
|
|
203
|
-
const resolvedContainer = theme.components.avatarGroup.container
|
|
204
|
-
const resolvedAvatarStack = theme.components.avatarGroup.avatarStack
|
|
205
|
-
const resolvedText = theme.components.avatarGroup.text
|
|
201
|
+
const avatarResolvers = useMemoizedThemeFactory<
|
|
202
|
+
AvatarState,
|
|
203
|
+
AvatarThemeResolvers
|
|
204
|
+
>(theme.components.avatarGroup.avatar, state)
|
|
205
|
+
const resolvedContainer = useMemoizedTheme(theme.components.avatarGroup.container, state, containerStyle)
|
|
206
|
+
const resolvedAvatarStack = useMemoizedTheme(theme.components.avatarGroup.avatarStack, state, avatarStackStyle)
|
|
207
|
+
const resolvedText = useMemoizedTheme(theme.components.avatarGroup.text, state, textStyle)
|
|
206
208
|
|
|
207
209
|
return (
|
|
208
210
|
<View
|
|
@@ -282,14 +284,14 @@ export const AvatarWithStatus = ({
|
|
|
282
284
|
status,
|
|
283
285
|
}), [size, color, status])
|
|
284
286
|
|
|
285
|
-
const avatarResolvers =
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
)
|
|
289
|
-
const resolvedStatusDot = theme.components.avatarWithStatus.statusDot
|
|
287
|
+
const avatarResolvers = useMemoizedThemeFactory<
|
|
288
|
+
AvatarWithStatusState,
|
|
289
|
+
AvatarThemeResolvers
|
|
290
|
+
>(theme.components.avatarWithStatus.avatar, state)
|
|
291
|
+
const resolvedStatusDot = useMemoizedTheme(theme.components.avatarWithStatus.statusDot, state, statusDotStyle)
|
|
290
292
|
|
|
291
293
|
return (
|
|
292
|
-
<View style={[{ position: 'relative' }, style]}>
|
|
294
|
+
<View style={[{ position: 'relative', alignSelf: 'flex-start' }, style]}>
|
|
293
295
|
<Avatar
|
|
294
296
|
{...avatarProps}
|
|
295
297
|
size={size}
|
|
@@ -14,6 +14,7 @@ import type { ChipVariant, ComponentSize } from '@helpwave/hightide-design/seman
|
|
|
14
14
|
|
|
15
15
|
import { ContentThemeOverrideProvider } from '../../global-contexts/content-theme/ContentThemeProvider'
|
|
16
16
|
import { useTheme } from '../../global-contexts/theme/ThemeContext'
|
|
17
|
+
import { useMemoizedTheme } from '../../hooks/useMemoizedTheme'
|
|
17
18
|
import type {
|
|
18
19
|
ChipIconStyle,
|
|
19
20
|
ChipState,
|
|
@@ -62,18 +63,9 @@ export const Chip = ({
|
|
|
62
63
|
variant,
|
|
63
64
|
}), [size, color, variant])
|
|
64
65
|
|
|
65
|
-
const resolvedChipStyle =
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
)
|
|
69
|
-
const resolvedIconStyle = useMemo(
|
|
70
|
-
() => theme.components.chip.icon(state, iconStyle),
|
|
71
|
-
[theme, state, iconStyle]
|
|
72
|
-
)
|
|
73
|
-
const resolvedTextStyle = useMemo(
|
|
74
|
-
() => theme.components.chip.text(state, textStyle),
|
|
75
|
-
[theme, state, textStyle]
|
|
76
|
-
)
|
|
66
|
+
const resolvedChipStyle = useMemoizedTheme(theme.components.chip.chip, state, chipStyle)
|
|
67
|
+
const resolvedIconStyle = useMemoizedTheme(theme.components.chip.icon, state, iconStyle)
|
|
68
|
+
const resolvedTextStyle = useMemoizedTheme(theme.components.chip.text, state, textStyle)
|
|
77
69
|
|
|
78
70
|
return (
|
|
79
71
|
<View
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
forwardRef
|
|
3
3
|
} from 'react'
|
|
4
|
+
import type {
|
|
5
|
+
ColorValue } from 'react-native'
|
|
4
6
|
import {
|
|
5
7
|
Text as RNText,
|
|
6
8
|
type TextProps
|
|
@@ -9,7 +11,10 @@ import {
|
|
|
9
11
|
import { useContentTheme } from '../../global-contexts/content-theme/ContentThemeContext'
|
|
10
12
|
import { useTheme } from '../../global-contexts/theme/ThemeContext'
|
|
11
13
|
|
|
12
|
-
|
|
14
|
+
import type { ThemedTextAppearance } from '../../enums/themedTextAppearance'
|
|
15
|
+
import { HexColorUtils } from '../../utils'
|
|
16
|
+
|
|
17
|
+
export type { ThemedTextAppearance }
|
|
13
18
|
|
|
14
19
|
export type ThemedTextProps = TextProps & {
|
|
15
20
|
appearance?: ThemedTextAppearance,
|
|
@@ -22,20 +27,22 @@ export const ThemedText = forwardRef<React.ComponentRef<typeof RNText>, ThemedTe
|
|
|
22
27
|
}, ref) {
|
|
23
28
|
const { theme } = useTheme()
|
|
24
29
|
const { foreground, background, textStyle } = useContentTheme()
|
|
25
|
-
|
|
30
|
+
let color: ColorValue | undefined = textStyle.color ?? foreground
|
|
31
|
+
color = appearance === 'description'
|
|
26
32
|
? theme.semantics.asDescription({
|
|
27
33
|
colorPair: {
|
|
28
34
|
color: background,
|
|
29
|
-
onColor:
|
|
35
|
+
onColor: HexColorUtils.parseColorValue(color),
|
|
30
36
|
},
|
|
31
37
|
})
|
|
32
|
-
:
|
|
38
|
+
: color
|
|
39
|
+
|
|
33
40
|
|
|
34
41
|
return (
|
|
35
42
|
<RNText
|
|
36
43
|
{...props}
|
|
37
44
|
ref={ref}
|
|
38
|
-
style={[textStyle,
|
|
45
|
+
style={[textStyle, { color }, style]}
|
|
39
46
|
/>
|
|
40
47
|
)
|
|
41
48
|
})
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { EnumUtilsType } from '@helpwave/hightide-utils/utils'
|
|
2
|
+
|
|
3
|
+
const chatMessageDirectionValues = ['incoming', 'outgoing'] as const
|
|
4
|
+
export type ChatMessageDirection = (typeof chatMessageDirectionValues)[number]
|
|
5
|
+
const allowedChatMessageDirectionValues: ReadonlySet<string> = new Set(
|
|
6
|
+
chatMessageDirectionValues
|
|
7
|
+
)
|
|
8
|
+
function isChatMessageDirectionValue(value: unknown): value is ChatMessageDirection {
|
|
9
|
+
if (typeof value !== 'string') {
|
|
10
|
+
return false
|
|
11
|
+
}
|
|
12
|
+
return allowedChatMessageDirectionValues.has(value)
|
|
13
|
+
}
|
|
14
|
+
export const ChatMessageDirectionUtils: EnumUtilsType<ChatMessageDirection> = {
|
|
15
|
+
values: chatMessageDirectionValues,
|
|
16
|
+
set: allowedChatMessageDirectionValues,
|
|
17
|
+
isValue: isChatMessageDirectionValue,
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { EnumUtilsType } from '@helpwave/hightide-utils/utils'
|
|
2
|
+
|
|
3
|
+
const chatMessageStatusValues = ['sent', 'sending', 'received', 'read'] as const
|
|
4
|
+
export type ChatMessageStatus = (typeof chatMessageStatusValues)[number]
|
|
5
|
+
const allowedChatMessageStatusValues: ReadonlySet<string> = new Set(
|
|
6
|
+
chatMessageStatusValues
|
|
7
|
+
)
|
|
8
|
+
function isChatMessageStatusValue(value: unknown): value is ChatMessageStatus {
|
|
9
|
+
if (typeof value !== 'string') {
|
|
10
|
+
return false
|
|
11
|
+
}
|
|
12
|
+
return allowedChatMessageStatusValues.has(value)
|
|
13
|
+
}
|
|
14
|
+
export const ChatMessageStatusUtils: EnumUtilsType<ChatMessageStatus> = {
|
|
15
|
+
values: chatMessageStatusValues,
|
|
16
|
+
set: allowedChatMessageStatusValues,
|
|
17
|
+
isValue: isChatMessageStatusValue,
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { EnumUtilsType } from '@helpwave/hightide-utils/utils'
|
|
2
|
+
|
|
3
|
+
const hightideThemeModesValues = ['dark', 'light'] as const
|
|
4
|
+
export type HightideThemeModes = (typeof hightideThemeModesValues)[number]
|
|
5
|
+
const allowedHightideThemeModesValues: ReadonlySet<string> = new Set(
|
|
6
|
+
hightideThemeModesValues
|
|
7
|
+
)
|
|
8
|
+
function isHightideThemeModesValue(value: unknown): value is HightideThemeModes {
|
|
9
|
+
if (typeof value !== 'string') {
|
|
10
|
+
return false
|
|
11
|
+
}
|
|
12
|
+
return allowedHightideThemeModesValues.has(value)
|
|
13
|
+
}
|
|
14
|
+
export const HightideThemeModesUtils: EnumUtilsType<HightideThemeModes> = {
|
|
15
|
+
values: hightideThemeModesValues,
|
|
16
|
+
set: allowedHightideThemeModesValues,
|
|
17
|
+
isValue: isHightideThemeModesValue,
|
|
18
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './chatMessageDirection'
|
|
2
|
+
export * from './chatMessageStatus'
|
|
3
|
+
export * from './hightideThemeModes'
|
|
4
|
+
export * from './listItemContentOrder'
|
|
5
|
+
export * from './themedTextAppearance'
|
|
6
|
+
export * from './useMultiSelectFirstHighlightBehavior'
|
|
7
|
+
export * from './useSelectFirstHighlightBehavior'
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { EnumUtilsType } from '@helpwave/hightide-utils/utils'
|
|
2
|
+
|
|
3
|
+
const listItemContentOrderValues = ['titleFirst', 'subtitleFirst'] as const
|
|
4
|
+
export type ListItemContentOrder = (typeof listItemContentOrderValues)[number]
|
|
5
|
+
const allowedListItemContentOrderValues: ReadonlySet<string> = new Set(
|
|
6
|
+
listItemContentOrderValues
|
|
7
|
+
)
|
|
8
|
+
function isListItemContentOrderValue(value: unknown): value is ListItemContentOrder {
|
|
9
|
+
if (typeof value !== 'string') {
|
|
10
|
+
return false
|
|
11
|
+
}
|
|
12
|
+
return allowedListItemContentOrderValues.has(value)
|
|
13
|
+
}
|
|
14
|
+
export const ListItemContentOrderUtils: EnumUtilsType<ListItemContentOrder> = {
|
|
15
|
+
values: listItemContentOrderValues,
|
|
16
|
+
set: allowedListItemContentOrderValues,
|
|
17
|
+
isValue: isListItemContentOrderValue,
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { EnumUtilsType } from '@helpwave/hightide-utils/utils'
|
|
2
|
+
|
|
3
|
+
const themedTextAppearanceValues = ['normal', 'description'] as const
|
|
4
|
+
export type ThemedTextAppearance = (typeof themedTextAppearanceValues)[number]
|
|
5
|
+
const allowedThemedTextAppearanceValues: ReadonlySet<string> = new Set(
|
|
6
|
+
themedTextAppearanceValues
|
|
7
|
+
)
|
|
8
|
+
function isThemedTextAppearanceValue(value: unknown): value is ThemedTextAppearance {
|
|
9
|
+
if (typeof value !== 'string') {
|
|
10
|
+
return false
|
|
11
|
+
}
|
|
12
|
+
return allowedThemedTextAppearanceValues.has(value)
|
|
13
|
+
}
|
|
14
|
+
export const ThemedTextAppearanceUtils: EnumUtilsType<ThemedTextAppearance> = {
|
|
15
|
+
values: themedTextAppearanceValues,
|
|
16
|
+
set: allowedThemedTextAppearanceValues,
|
|
17
|
+
isValue: isThemedTextAppearanceValue,
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { EnumUtilsType } from '@helpwave/hightide-utils/utils'
|
|
2
|
+
|
|
3
|
+
const useMultiSelectFirstHighlightBehaviorValues = ['first', 'last'] as const
|
|
4
|
+
export type UseMultiSelectFirstHighlightBehavior = (typeof useMultiSelectFirstHighlightBehaviorValues)[number]
|
|
5
|
+
const allowedUseMultiSelectFirstHighlightBehaviorValues: ReadonlySet<string> = new Set(
|
|
6
|
+
useMultiSelectFirstHighlightBehaviorValues
|
|
7
|
+
)
|
|
8
|
+
function isUseMultiSelectFirstHighlightBehaviorValue(value: unknown): value is UseMultiSelectFirstHighlightBehavior {
|
|
9
|
+
if (typeof value !== 'string') {
|
|
10
|
+
return false
|
|
11
|
+
}
|
|
12
|
+
return allowedUseMultiSelectFirstHighlightBehaviorValues.has(value)
|
|
13
|
+
}
|
|
14
|
+
export const UseMultiSelectFirstHighlightBehaviorUtils: EnumUtilsType<UseMultiSelectFirstHighlightBehavior> = {
|
|
15
|
+
values: useMultiSelectFirstHighlightBehaviorValues,
|
|
16
|
+
set: allowedUseMultiSelectFirstHighlightBehaviorValues,
|
|
17
|
+
isValue: isUseMultiSelectFirstHighlightBehaviorValue,
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { EnumUtilsType } from '@helpwave/hightide-utils/utils'
|
|
2
|
+
|
|
3
|
+
const useSelectFirstHighlightBehaviorValues = ['first', 'last'] as const
|
|
4
|
+
export type UseSelectFirstHighlightBehavior = (typeof useSelectFirstHighlightBehaviorValues)[number]
|
|
5
|
+
const allowedUseSelectFirstHighlightBehaviorValues: ReadonlySet<string> = new Set(
|
|
6
|
+
useSelectFirstHighlightBehaviorValues
|
|
7
|
+
)
|
|
8
|
+
function isUseSelectFirstHighlightBehaviorValue(value: unknown): value is UseSelectFirstHighlightBehavior {
|
|
9
|
+
if (typeof value !== 'string') {
|
|
10
|
+
return false
|
|
11
|
+
}
|
|
12
|
+
return allowedUseSelectFirstHighlightBehaviorValues.has(value)
|
|
13
|
+
}
|
|
14
|
+
export const UseSelectFirstHighlightBehaviorUtils: EnumUtilsType<UseSelectFirstHighlightBehavior> = {
|
|
15
|
+
values: useSelectFirstHighlightBehaviorValues,
|
|
16
|
+
set: allowedUseSelectFirstHighlightBehaviorValues,
|
|
17
|
+
isValue: isUseSelectFirstHighlightBehaviorValue,
|
|
18
|
+
}
|
|
@@ -85,20 +85,24 @@ export const ContentThemeOverrideProvider = ({
|
|
|
85
85
|
const newForeground = resolveColorOverride(foregroundOverride, parent.foreground)
|
|
86
86
|
const newBackground = resolveColorOverride(backgroundOverride, parent.background)
|
|
87
87
|
|
|
88
|
-
|
|
88
|
+
const resolvedTextStyleOverride = typeof textStyleOverride === 'function'
|
|
89
89
|
? textStyleOverride(parent.textStyle, parent.foreground)
|
|
90
|
-
: textStyleOverride
|
|
90
|
+
: textStyleOverride
|
|
91
|
+
|
|
92
|
+
let textStyle = resolvedTextStyleOverride ?? parent.textStyle
|
|
91
93
|
|
|
92
94
|
if (!isKeepingTextColor && newForeground !== undefined) {
|
|
93
|
-
textStyle = { ...textStyle, color: newForeground }
|
|
95
|
+
textStyle = { ...textStyle, color: resolvedTextStyleOverride?.color ?? newForeground }
|
|
94
96
|
}
|
|
95
97
|
|
|
96
|
-
|
|
98
|
+
const resolvedIconStyleOverride = typeof iconStyleOverride === 'function'
|
|
97
99
|
? iconStyleOverride(parent.iconStyle, parent.foreground)
|
|
98
100
|
: iconStyleOverride ?? parent.iconStyle
|
|
99
101
|
|
|
102
|
+
let iconStyle = resolvedIconStyleOverride ?? parent.iconStyle
|
|
103
|
+
|
|
100
104
|
if (!isKeepingIconColor && newForeground !== undefined) {
|
|
101
|
-
iconStyle = { ...iconStyle, color: newForeground }
|
|
105
|
+
iconStyle = { ...iconStyle, color: resolvedIconStyleOverride?.color ?? newForeground }
|
|
102
106
|
}
|
|
103
107
|
|
|
104
108
|
return {
|
|
@@ -96,7 +96,10 @@ export const ThemeProvider = ({
|
|
|
96
96
|
<ContentThemeRootProvider
|
|
97
97
|
foreground={contextValue.theme.colors.surface.onColor}
|
|
98
98
|
background={contextValue.theme.colors.surface.color}
|
|
99
|
-
textStyle={
|
|
99
|
+
textStyle={{
|
|
100
|
+
...contextValue.theme.typography.body.md,
|
|
101
|
+
//color: contextValue.theme.colors.surface.onColor,
|
|
102
|
+
}}
|
|
100
103
|
iconStyle={{
|
|
101
104
|
size: contextValue.theme.icongraphy.sizes.md,
|
|
102
105
|
strokeWidth: contextValue.theme.icongraphy.strokeWidth,
|