@helpwave/hightide-native 0.0.7 → 0.1.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/README.md +4 -4
- package/package.json +8 -19
- package/src/components/card/Card.tsx +41 -0
- package/src/components/card/index.ts +1 -0
- package/src/components/chat/ChatAttachmentMessageBubble.tsx +246 -0
- package/src/components/chat/ChatConversationRow.tsx +21 -16
- package/src/components/chat/ChatDateDivider.tsx +2 -2
- package/src/components/chat/ChatMessageBubble.tsx +62 -52
- package/src/components/chat/ChatMessageComposer.tsx +16 -14
- package/src/components/chat/ChatQuickReplyChip.tsx +41 -43
- package/src/components/chat/ChatSystemLine.tsx +14 -7
- package/src/components/chat/ChatThreadHeader.tsx +60 -6
- package/src/components/chat/index.ts +1 -2
- package/src/components/index.ts +3 -1
- package/src/components/layout/Divider.tsx +60 -0
- package/src/components/layout/index.ts +1 -0
- package/src/components/list/ListActionItem.tsx +99 -0
- package/src/components/list/ListItem.tsx +96 -0
- package/src/components/list/ListNavigationItem.tsx +102 -0
- package/src/components/list/index.ts +3 -0
- package/src/components/user-interaction/Button.tsx +80 -31
- package/src/components/user-interaction/Checkbox.tsx +72 -32
- package/src/components/user-interaction/IconButton.tsx +68 -30
- package/src/components/user-interaction/Input.tsx +61 -14
- package/src/components/user-interaction/MultiSelect.tsx +142 -75
- package/src/components/user-interaction/SearchBar.tsx +222 -0
- package/src/components/user-interaction/Select.tsx +129 -58
- package/src/components/user-interaction/Switch.tsx +207 -0
- package/src/components/user-interaction/ThemedPressable.tsx +136 -0
- package/src/components/user-interaction/index.ts +3 -0
- package/src/components/visualization-and-display/Avatar.tsx +112 -93
- package/src/components/visualization-and-display/Chip.tsx +22 -22
- package/src/components/visualization-and-display/ThemedIcon.tsx +72 -0
- package/src/components/visualization-and-display/ThemedText.tsx +38 -0
- package/src/components/visualization-and-display/index.ts +2 -1
- package/src/global-contexts/HightideProvider.tsx +19 -10
- package/src/global-contexts/content-theme/ContentThemeContext.ts +22 -0
- package/src/global-contexts/content-theme/ContentThemeProvider.tsx +32 -0
- package/src/global-contexts/content-theme/index.ts +2 -0
- package/src/global-contexts/debug/forward-exports.ts +10 -0
- package/src/global-contexts/debug/index.ts +1 -0
- package/src/global-contexts/index.ts +2 -0
- package/src/global-contexts/theme/ThemeProvider.tsx +7 -1
- package/src/icons/HightideIconRegistry.ts +33 -0
- package/src/icons/index.ts +2 -0
- package/src/icons/types.ts +11 -0
- package/src/theme/adapters/container-adapter.ts +323 -0
- package/src/theme/adapters/defined.ts +11 -0
- package/src/theme/adapters/icon-style-adapter.ts +10 -0
- package/src/theme/adapters/index.ts +4 -0
- package/src/theme/adapters/text-style-adapter.ts +16 -0
- package/src/theme/index.ts +1 -0
- package/src/theme/resolvers/avatar.ts +385 -186
- package/src/theme/resolvers/button.ts +50 -82
- package/src/theme/resolvers/card.ts +27 -0
- package/src/theme/resolvers/chat/attachment-message-bubble.ts +163 -0
- package/src/theme/resolvers/chat/chat-theme.ts +69 -0
- package/src/theme/resolvers/chat/conversation-list.ts +35 -0
- package/src/theme/resolvers/chat/conversation-row.ts +64 -0
- package/src/theme/resolvers/chat/date-divider.ts +31 -0
- package/src/theme/resolvers/chat/index.ts +11 -0
- package/src/theme/resolvers/chat/message-bubble.ts +57 -0
- package/src/theme/resolvers/chat/message-composer.ts +38 -0
- package/src/theme/resolvers/chat/message-list.ts +27 -0
- package/src/theme/resolvers/chat/quick-reply-chip.ts +80 -0
- package/src/theme/resolvers/chat/system-line.ts +41 -0
- package/src/theme/resolvers/chat/thread-header.ts +85 -0
- package/src/theme/resolvers/checkbox.ts +87 -74
- package/src/theme/resolvers/chip.ts +30 -67
- package/src/theme/resolvers/colorScheme.ts +136 -0
- package/src/theme/resolvers/divider.ts +34 -0
- package/src/theme/resolvers/icon.ts +21 -0
- package/src/theme/resolvers/iconButton.ts +45 -61
- package/src/theme/resolvers/index.ts +8 -2
- package/src/theme/resolvers/input.ts +64 -42
- package/src/theme/resolvers/listItem.ts +115 -0
- package/src/theme/resolvers/multiSelect.ts +159 -84
- package/src/theme/resolvers/searchBar.ts +121 -0
- package/src/theme/resolvers/select.ts +141 -66
- package/src/theme/resolvers/switch.ts +71 -0
- package/src/theme/resolvers/themedPressable.ts +54 -0
- package/src/theme/themes/createHightideTheme.ts +214 -49
- package/src/theme/themes/hightideThemes.ts +10 -6
- package/src/theme/types/color.ts +2 -59
- package/src/theme/types/components/avatar.ts +37 -36
- package/src/theme/types/components/button.ts +13 -14
- package/src/theme/types/components/card.ts +9 -0
- package/src/theme/types/components/chat.ts +124 -103
- package/src/theme/types/components/checkbox.ts +11 -12
- package/src/theme/types/components/chip.ts +8 -14
- package/src/theme/types/components/divider.ts +18 -0
- package/src/theme/types/components/hightide.ts +41 -40
- package/src/theme/types/components/iconButton.ts +19 -14
- package/src/theme/types/components/index.ts +6 -1
- package/src/theme/types/components/input.ts +17 -8
- package/src/theme/types/components/listItem.ts +86 -0
- package/src/theme/types/components/multiSelect.ts +14 -12
- package/src/theme/types/components/searchBar.ts +28 -0
- package/src/theme/types/components/select.ts +21 -9
- package/src/theme/types/components/switch.ts +22 -0
- package/src/theme/types/components/themedPressable.ts +31 -0
- package/src/theme/types/decoration.ts +1 -11
- package/src/theme/types/icongraphy.ts +8 -0
- package/src/theme/types/index.ts +2 -0
- package/src/theme/types/layout.ts +25 -57
- package/src/theme/types/resolver.ts +54 -1
- package/src/theme/types/semantics.ts +72 -0
- package/src/theme/types/theme.ts +26 -13
- package/src/theme/types/typography.ts +16 -17
- package/src/utils/hitBoxOverlay.ts +44 -0
- package/src/utils/index.ts +2 -0
- package/src/utils/minimumTouchTargetHitSlop.ts +68 -0
- package/src/components/chat/ChatAttachmentCard.tsx +0 -110
- package/src/components/chat/ChatMessageCard.tsx +0 -118
- package/src/components/menu/Menu.tsx +0 -61
- package/src/components/menu/MenuActionItem.tsx +0 -90
- package/src/components/menu/MenuItem.tsx +0 -73
- package/src/components/menu/MenuNavigationItem.tsx +0 -90
- package/src/components/menu/index.ts +0 -4
- package/src/components/visualization-and-display/Icon.tsx +0 -27
- package/src/storybook/helper.tsx +0 -36
- package/src/theme/resolvers/chat.ts +0 -418
- package/src/theme/resolvers/coloring.ts +0 -94
- package/src/theme/resolvers/menu.ts +0 -120
- package/src/theme/types/components/menu.ts +0 -57
|
@@ -1,57 +1,222 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { componentTokenResolvers } from '@helpwave/hightide-design/component-token-resolvers'
|
|
2
|
+
import {
|
|
3
|
+
hightideSemanticTokenResolvers,
|
|
4
|
+
resolveContainerLayout,
|
|
5
|
+
resolveControlLayout,
|
|
6
|
+
resolveInsideControlLayout,
|
|
7
|
+
type ElementLayoutTokens
|
|
8
|
+
} from '@helpwave/hightide-design/semantic-token-resolvers'
|
|
9
|
+
import type { ThemeLayoutSize, ThemeTokens, ThemeTypographySize } from '@helpwave/hightide-design/theme-tokens'
|
|
5
10
|
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
} from '../
|
|
11
|
+
import {
|
|
12
|
+
toAvatarGroupThemeResolvers,
|
|
13
|
+
toAvatarThemeResolvers,
|
|
14
|
+
toAvatarWithStatusThemeResolvers
|
|
15
|
+
} from '../resolvers/avatar'
|
|
16
|
+
import { toButtonThemeResolvers } from '../resolvers/button'
|
|
17
|
+
import { toCardThemeResolvers } from '../resolvers/card'
|
|
18
|
+
import { toChatThemeResolvers } from '../resolvers/chat/chat-theme'
|
|
19
|
+
import { toCheckboxThemeResolvers } from '../resolvers/checkbox'
|
|
20
|
+
import { toChipThemeResolvers } from '../resolvers/chip'
|
|
21
|
+
import { toDividerThemeResolvers } from '../resolvers/divider'
|
|
22
|
+
import { toIconThemeResolvers } from '../resolvers/icon'
|
|
23
|
+
import { toIconButtonThemeResolvers } from '../resolvers/iconButton'
|
|
24
|
+
import { toInputThemeResolvers } from '../resolvers/input'
|
|
25
|
+
import { toSearchBarThemeResolvers } from '../resolvers/searchBar'
|
|
26
|
+
import {
|
|
27
|
+
toListItemThemeResolvers
|
|
28
|
+
} from '../resolvers/listItem'
|
|
29
|
+
import { toMultiSelectThemeResolvers } from '../resolvers/multiSelect'
|
|
30
|
+
import { toSelectThemeResolvers } from '../resolvers/select'
|
|
31
|
+
import { toSwitchThemeResolvers } from '../resolvers/switch'
|
|
32
|
+
import { toThemedPressableThemeResolvers } from '../resolvers/themedPressable'
|
|
33
|
+
import type { HightideThemeSemantics } from '../types/semantics'
|
|
21
34
|
import type { HightideTheme } from '../types/theme'
|
|
22
35
|
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
return token.value
|
|
26
|
-
}
|
|
27
|
-
return token.value
|
|
28
|
-
}
|
|
36
|
+
const layoutSizes = ['xs', 'sm', 'md', 'lg', 'xl'] as const satisfies readonly ThemeLayoutSize[]
|
|
37
|
+
const typographySizes = ['sm', 'md', 'lg'] as const satisfies readonly ThemeTypographySize[]
|
|
29
38
|
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
39
|
+
const resolveElementLayouts = (themeTokens: ThemeTokens): ElementLayoutTokens => ({
|
|
40
|
+
control: Object.fromEntries(
|
|
41
|
+
layoutSizes.map((size) => [
|
|
42
|
+
size,
|
|
43
|
+
resolveControlLayout({ themeTokens, size }),
|
|
44
|
+
])
|
|
45
|
+
) as ElementLayoutTokens['control'],
|
|
46
|
+
container: Object.fromEntries(
|
|
47
|
+
layoutSizes.map((size) => [
|
|
48
|
+
size,
|
|
49
|
+
resolveContainerLayout({ themeTokens, size }),
|
|
50
|
+
])
|
|
51
|
+
) as ElementLayoutTokens['container'],
|
|
52
|
+
insideControl: Object.fromEntries(
|
|
53
|
+
typographySizes.map((size) => [
|
|
54
|
+
size,
|
|
55
|
+
resolveInsideControlLayout({ themeTokens, size }),
|
|
56
|
+
])
|
|
57
|
+
) as ElementLayoutTokens['insideControl'],
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
const bindSemantics = (themeTokens: ThemeTokens): HightideThemeSemantics => ({
|
|
61
|
+
coloringColorVariant: (parameter) => hightideSemanticTokenResolvers.coloringColorVariant({
|
|
62
|
+
themeTokens,
|
|
63
|
+
...parameter,
|
|
64
|
+
}),
|
|
65
|
+
coloringStyle: (parameter) => hightideSemanticTokenResolvers.coloringStyle({
|
|
66
|
+
themeTokens,
|
|
67
|
+
...parameter,
|
|
68
|
+
}),
|
|
69
|
+
pressableColoring: (parameter) => hightideSemanticTokenResolvers.pressableColoring({
|
|
70
|
+
themeTokens,
|
|
71
|
+
...parameter,
|
|
72
|
+
}),
|
|
73
|
+
pressableStateLayerTint: (parameter) => hightideSemanticTokenResolvers.pressableStateLayerTint({
|
|
74
|
+
themeTokens,
|
|
75
|
+
...parameter,
|
|
76
|
+
}),
|
|
77
|
+
inputColoring: (parameter) => hightideSemanticTokenResolvers.inputColoring({
|
|
78
|
+
themeTokens,
|
|
79
|
+
...parameter,
|
|
80
|
+
}),
|
|
81
|
+
controlLayout: (parameter) => hightideSemanticTokenResolvers.controlLayout({
|
|
82
|
+
themeTokens,
|
|
83
|
+
...parameter,
|
|
84
|
+
}),
|
|
85
|
+
touchTargetSize: (parameter) => hightideSemanticTokenResolvers.touchTargetSize({
|
|
86
|
+
themeTokens,
|
|
87
|
+
...parameter,
|
|
88
|
+
}),
|
|
89
|
+
containerLayout: (parameter) => hightideSemanticTokenResolvers.containerLayout({
|
|
90
|
+
themeTokens,
|
|
91
|
+
...parameter,
|
|
92
|
+
}),
|
|
93
|
+
insideControlLayout: (parameter) => hightideSemanticTokenResolvers.insideControlLayout({
|
|
94
|
+
themeTokens,
|
|
95
|
+
...parameter,
|
|
96
|
+
}),
|
|
97
|
+
tintedSurface: (parameter) => hightideSemanticTokenResolvers.tintedSurface({
|
|
98
|
+
themeTokens,
|
|
99
|
+
...parameter,
|
|
100
|
+
}),
|
|
101
|
+
withAppearance: (parameter) => hightideSemanticTokenResolvers.withAppearance({
|
|
102
|
+
themeTokens,
|
|
103
|
+
...parameter,
|
|
104
|
+
}),
|
|
105
|
+
asFaded: (parameter) => hightideSemanticTokenResolvers.asFaded({
|
|
106
|
+
themeTokens,
|
|
107
|
+
...parameter,
|
|
108
|
+
}),
|
|
109
|
+
asDescription: (parameter) => hightideSemanticTokenResolvers.asDescription({
|
|
110
|
+
themeTokens,
|
|
111
|
+
...parameter,
|
|
112
|
+
}),
|
|
113
|
+
})
|
|
37
114
|
|
|
38
|
-
export const createHightideTheme = (
|
|
39
|
-
colors:
|
|
40
|
-
|
|
41
|
-
typography:
|
|
42
|
-
|
|
43
|
-
|
|
115
|
+
export const createHightideTheme = (themeTokens: ThemeTokens): HightideTheme => ({
|
|
116
|
+
colors: themeTokens.color,
|
|
117
|
+
semantics: bindSemantics(themeTokens),
|
|
118
|
+
typography: themeTokens.typography,
|
|
119
|
+
icongraphy: themeTokens.icongraphy,
|
|
120
|
+
spacing: themeTokens.spacing,
|
|
121
|
+
elements: resolveElementLayouts(themeTokens),
|
|
122
|
+
borderRadius: themeTokens.shape.borderRadius,
|
|
123
|
+
border: themeTokens.borderWidth,
|
|
124
|
+
shadow: {
|
|
125
|
+
raised: themeTokens.elevation.level1,
|
|
126
|
+
container: themeTokens.elevation.level2,
|
|
127
|
+
popover: themeTokens.elevation.level3,
|
|
128
|
+
dialog: themeTokens.elevation.level4,
|
|
129
|
+
},
|
|
44
130
|
components: {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
131
|
+
button: toButtonThemeResolvers({
|
|
132
|
+
themeTokens,
|
|
133
|
+
semanticTokens: hightideSemanticTokenResolvers,
|
|
134
|
+
componentTokens: componentTokenResolvers,
|
|
135
|
+
}),
|
|
136
|
+
iconButton: toIconButtonThemeResolvers({
|
|
137
|
+
themeTokens,
|
|
138
|
+
semanticTokens: hightideSemanticTokenResolvers,
|
|
139
|
+
componentTokens: componentTokenResolvers,
|
|
140
|
+
}),
|
|
141
|
+
themedPressable: toThemedPressableThemeResolvers({
|
|
142
|
+
themeTokens,
|
|
143
|
+
semanticTokens: hightideSemanticTokenResolvers,
|
|
144
|
+
componentTokens: componentTokenResolvers,
|
|
145
|
+
}),
|
|
146
|
+
chip: toChipThemeResolvers({
|
|
147
|
+
themeTokens,
|
|
148
|
+
semanticTokens: hightideSemanticTokenResolvers,
|
|
149
|
+
componentTokens: componentTokenResolvers,
|
|
150
|
+
}),
|
|
151
|
+
checkbox: toCheckboxThemeResolvers({
|
|
152
|
+
themeTokens,
|
|
153
|
+
semanticTokens: hightideSemanticTokenResolvers,
|
|
154
|
+
componentTokens: componentTokenResolvers,
|
|
155
|
+
}),
|
|
156
|
+
switch: toSwitchThemeResolvers({
|
|
157
|
+
themeTokens,
|
|
158
|
+
semanticTokens: hightideSemanticTokenResolvers,
|
|
159
|
+
componentTokens: componentTokenResolvers,
|
|
160
|
+
}),
|
|
161
|
+
input: toInputThemeResolvers({
|
|
162
|
+
themeTokens,
|
|
163
|
+
semanticTokens: hightideSemanticTokenResolvers,
|
|
164
|
+
componentTokens: componentTokenResolvers,
|
|
165
|
+
}),
|
|
166
|
+
searchBar: toSearchBarThemeResolvers({
|
|
167
|
+
themeTokens,
|
|
168
|
+
semanticTokens: hightideSemanticTokenResolvers,
|
|
169
|
+
componentTokens: componentTokenResolvers,
|
|
170
|
+
}),
|
|
171
|
+
select: toSelectThemeResolvers({
|
|
172
|
+
themeTokens,
|
|
173
|
+
semanticTokens: hightideSemanticTokenResolvers,
|
|
174
|
+
componentTokens: componentTokenResolvers,
|
|
175
|
+
}),
|
|
176
|
+
multiSelect: toMultiSelectThemeResolvers({
|
|
177
|
+
themeTokens,
|
|
178
|
+
semanticTokens: hightideSemanticTokenResolvers,
|
|
179
|
+
componentTokens: componentTokenResolvers,
|
|
180
|
+
}),
|
|
181
|
+
chat: toChatThemeResolvers({
|
|
182
|
+
themeTokens,
|
|
183
|
+
semanticTokens: hightideSemanticTokenResolvers,
|
|
184
|
+
componentTokens: componentTokenResolvers,
|
|
185
|
+
}),
|
|
186
|
+
card: toCardThemeResolvers({
|
|
187
|
+
themeTokens,
|
|
188
|
+
semanticTokens: hightideSemanticTokenResolvers,
|
|
189
|
+
componentTokens: componentTokenResolvers,
|
|
190
|
+
}),
|
|
191
|
+
divider: toDividerThemeResolvers({
|
|
192
|
+
themeTokens,
|
|
193
|
+
semanticTokens: hightideSemanticTokenResolvers,
|
|
194
|
+
componentTokens: componentTokenResolvers,
|
|
195
|
+
}),
|
|
196
|
+
listItem: toListItemThemeResolvers({
|
|
197
|
+
themeTokens,
|
|
198
|
+
semanticTokens: hightideSemanticTokenResolvers,
|
|
199
|
+
componentTokens: componentTokenResolvers,
|
|
200
|
+
}),
|
|
201
|
+
avatar: toAvatarThemeResolvers({
|
|
202
|
+
themeTokens,
|
|
203
|
+
semanticTokens: hightideSemanticTokenResolvers,
|
|
204
|
+
componentTokens: componentTokenResolvers,
|
|
205
|
+
}),
|
|
206
|
+
avatarWithStatus: toAvatarWithStatusThemeResolvers({
|
|
207
|
+
themeTokens,
|
|
208
|
+
semanticTokens: hightideSemanticTokenResolvers,
|
|
209
|
+
componentTokens: componentTokenResolvers,
|
|
210
|
+
}),
|
|
211
|
+
avatarGroup: toAvatarGroupThemeResolvers({
|
|
212
|
+
themeTokens,
|
|
213
|
+
semanticTokens: hightideSemanticTokenResolvers,
|
|
214
|
+
componentTokens: componentTokenResolvers,
|
|
215
|
+
}),
|
|
216
|
+
icon: toIconThemeResolvers({
|
|
217
|
+
themeTokens,
|
|
218
|
+
semanticTokens: hightideSemanticTokenResolvers,
|
|
219
|
+
componentTokens: componentTokenResolvers,
|
|
220
|
+
}),
|
|
56
221
|
},
|
|
57
222
|
})
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { hightideDesignSystem } from '@helpwave/hightide-design/design-system'
|
|
2
2
|
import { createHightideTheme } from './createHightideTheme'
|
|
3
3
|
|
|
4
|
-
export const
|
|
5
|
-
|
|
4
|
+
export const hightideLightTheme = createHightideTheme(
|
|
5
|
+
hightideDesignSystem.tokenThemes.light
|
|
6
|
+
)
|
|
7
|
+
export const hightideDarkTheme = createHightideTheme(
|
|
8
|
+
hightideDesignSystem.tokenThemes.dark
|
|
9
|
+
)
|
|
6
10
|
|
|
7
11
|
export const themes = {
|
|
8
|
-
light:
|
|
9
|
-
dark:
|
|
12
|
+
light: hightideLightTheme,
|
|
13
|
+
dark: hightideDarkTheme,
|
|
10
14
|
} as const
|
|
11
15
|
|
|
12
16
|
export type HightideThemeModes = 'dark' | 'light'
|
|
13
17
|
|
|
14
|
-
export type ThemeMode = string | HightideThemeModes
|
|
18
|
+
export type ThemeMode = string | HightideThemeModes
|
package/src/theme/types/color.ts
CHANGED
|
@@ -1,60 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
import type { ColorToken } from '@helpwave/hightide-design/primitive-tokens'
|
|
2
2
|
|
|
3
|
-
export type
|
|
4
|
-
|
|
5
|
-
export type HightideColors = {
|
|
6
|
-
white: Color,
|
|
7
|
-
black: Color,
|
|
8
|
-
gray: ColorPalette,
|
|
9
|
-
green: ColorPalette,
|
|
10
|
-
orange: ColorPalette,
|
|
11
|
-
purple: ColorPalette,
|
|
12
|
-
blue: ColorPalette,
|
|
13
|
-
red: ColorPalette,
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export type HightideSemanticColors = {
|
|
17
|
-
background: Color,
|
|
18
|
-
onBackground: Color,
|
|
19
|
-
warning: Color,
|
|
20
|
-
onWarning: Color,
|
|
21
|
-
warningHover: Color,
|
|
22
|
-
positive: Color,
|
|
23
|
-
onPositive: Color,
|
|
24
|
-
positiveHover: Color,
|
|
25
|
-
negative: Color,
|
|
26
|
-
onNegative: Color,
|
|
27
|
-
negativeHover: Color,
|
|
28
|
-
disabled: Color,
|
|
29
|
-
onDisabled: Color,
|
|
30
|
-
surface: Color,
|
|
31
|
-
onSurface: Color,
|
|
32
|
-
surfaceHover: Color,
|
|
33
|
-
surfaceVariant: Color,
|
|
34
|
-
onSurfaceVariant: Color,
|
|
35
|
-
surfaceWarning: Color,
|
|
36
|
-
onSurfaceWarning: Color,
|
|
37
|
-
textPrimary: Color,
|
|
38
|
-
textSecondary: Color,
|
|
39
|
-
textTertiary: Color,
|
|
40
|
-
placeholder: Color,
|
|
41
|
-
description: Color,
|
|
42
|
-
label: Color,
|
|
43
|
-
primary: Color,
|
|
44
|
-
onPrimary: Color,
|
|
45
|
-
primaryHover: Color,
|
|
46
|
-
secondary: Color,
|
|
47
|
-
onSecondary: Color,
|
|
48
|
-
secondaryHover: Color,
|
|
49
|
-
neutral: Color,
|
|
50
|
-
onNeutral: Color,
|
|
51
|
-
neutralHover: Color,
|
|
52
|
-
neutralText: Color,
|
|
53
|
-
neutralTextHover: Color,
|
|
54
|
-
neutralOutline: Color,
|
|
55
|
-
neutralOutlineHover: Color,
|
|
56
|
-
neutralTonalText: Color,
|
|
57
|
-
neutralTonalBackground: Color,
|
|
58
|
-
faded: Color,
|
|
59
|
-
highlight: Color,
|
|
60
|
-
}
|
|
3
|
+
export type Color = ColorToken
|
|
@@ -4,29 +4,35 @@ import type {
|
|
|
4
4
|
ViewStyle
|
|
5
5
|
} from 'react-native'
|
|
6
6
|
|
|
7
|
-
import type {
|
|
7
|
+
import type { ColorPairToken } from '@helpwave/hightide-design/theme-tokens'
|
|
8
|
+
import {
|
|
9
|
+
avatarStatuses,
|
|
10
|
+
type AvatarSize,
|
|
11
|
+
type AvatarStatus
|
|
12
|
+
} from '@helpwave/hightide-design/component-token-resolvers'
|
|
8
13
|
|
|
9
14
|
import type { StyleResolverFunction } from '../resolver'
|
|
15
|
+
import type { IconStyle } from '../../../icons'
|
|
10
16
|
|
|
11
|
-
export type
|
|
17
|
+
export type { AvatarSize, AvatarStatus }
|
|
18
|
+
export { avatarStatuses }
|
|
12
19
|
|
|
13
20
|
export type AvatarState = {
|
|
14
|
-
size?:
|
|
21
|
+
size?: AvatarSize | number,
|
|
15
22
|
isGrouped?: boolean,
|
|
16
23
|
groupIndex?: number,
|
|
24
|
+
color?: ColorPairToken,
|
|
17
25
|
}
|
|
18
26
|
|
|
19
27
|
export type AvatarWithStatusState = {
|
|
20
|
-
size?:
|
|
28
|
+
size?: AvatarSize | number,
|
|
29
|
+
color?: ColorPairToken,
|
|
21
30
|
status?: AvatarStatus,
|
|
22
31
|
}
|
|
23
32
|
|
|
24
|
-
export type AvatarWithLabelState = {
|
|
25
|
-
size?: ElementSize,
|
|
26
|
-
}
|
|
27
|
-
|
|
28
33
|
export type AvatarGroupState = {
|
|
29
|
-
size?:
|
|
34
|
+
size?: AvatarSize | number,
|
|
35
|
+
color?: ColorPairToken,
|
|
30
36
|
count?: number,
|
|
31
37
|
}
|
|
32
38
|
|
|
@@ -36,42 +42,37 @@ export type AvatarImageStyle = ImageStyle
|
|
|
36
42
|
|
|
37
43
|
export type AvatarTextStyle = TextStyle
|
|
38
44
|
|
|
39
|
-
export type AvatarIconStyle =
|
|
40
|
-
size: number,
|
|
41
|
-
strokeWidth: number,
|
|
42
|
-
color: string,
|
|
43
|
-
}
|
|
45
|
+
export type AvatarIconStyle = IconStyle
|
|
44
46
|
|
|
45
47
|
export type AvatarStatusDotStyle = ViewStyle
|
|
46
48
|
|
|
47
|
-
export type AvatarWithStatusContainerStyle = ViewStyle
|
|
48
|
-
|
|
49
|
-
export type AvatarWithLabelContainerStyle = ViewStyle
|
|
50
|
-
|
|
51
|
-
export type AvatarWithLabelTextStyle = TextStyle
|
|
52
|
-
|
|
53
49
|
export type AvatarGroupContainerStyle = ViewStyle
|
|
54
50
|
|
|
55
51
|
export type AvatarGroupStackStyle = ViewStyle
|
|
56
52
|
|
|
57
|
-
export type
|
|
53
|
+
export type AvatarGroupTextStyle = TextStyle
|
|
58
54
|
|
|
59
|
-
export type
|
|
60
|
-
|
|
55
|
+
export type AvatarThemeResolvers = {
|
|
56
|
+
container: StyleResolverFunction<AvatarState, AvatarStyle>,
|
|
61
57
|
image: StyleResolverFunction<AvatarState, AvatarImageStyle>,
|
|
62
58
|
text: StyleResolverFunction<AvatarState, AvatarTextStyle>,
|
|
63
59
|
icon: StyleResolverFunction<AvatarState, AvatarIconStyle>,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export type AvatarWithStatusThemeResolvers = {
|
|
63
|
+
avatar: StyleResolverFunction<
|
|
64
|
+
AvatarWithStatusState,
|
|
65
|
+
AvatarThemeResolvers
|
|
66
|
+
>,
|
|
67
|
+
statusDot: StyleResolverFunction<AvatarWithStatusState, AvatarStatusDotStyle>,
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export type AvatarGroupThemeResolvers = {
|
|
71
|
+
avatar: StyleResolverFunction<
|
|
72
|
+
AvatarGroupState,
|
|
73
|
+
AvatarThemeResolvers
|
|
74
|
+
>,
|
|
75
|
+
container: StyleResolverFunction<AvatarGroupState, AvatarGroupContainerStyle>,
|
|
76
|
+
avatarStack: StyleResolverFunction<AvatarGroupState, AvatarGroupStackStyle>,
|
|
77
|
+
text: StyleResolverFunction<AvatarGroupState, AvatarGroupTextStyle>,
|
|
77
78
|
}
|
|
@@ -1,30 +1,29 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
TextStyle,
|
|
3
|
-
ViewStyle
|
|
4
|
-
} from 'react-native'
|
|
1
|
+
import type { ViewStyle, TextStyle } from 'react-native'
|
|
5
2
|
|
|
6
|
-
import type {
|
|
7
|
-
import type {
|
|
8
|
-
ButtonColoringStyle,
|
|
9
|
-
ElementSize
|
|
10
|
-
} from '@helpwave/hightide-design/types'
|
|
3
|
+
import type { ComponentSize, ButtonVariant } from '@helpwave/hightide-design/semantic-token-resolvers'
|
|
4
|
+
import type { ColorPairToken } from '@helpwave/hightide-design/theme-tokens'
|
|
11
5
|
|
|
12
6
|
import type {
|
|
13
7
|
InteractionState,
|
|
14
8
|
StyleResolverFunction
|
|
15
9
|
} from '../resolver'
|
|
10
|
+
import type { IconStyle } from '../../../icons'
|
|
16
11
|
|
|
17
12
|
export type ButtonState = InteractionState & {
|
|
18
|
-
size?:
|
|
19
|
-
color?:
|
|
20
|
-
|
|
13
|
+
size?: ComponentSize,
|
|
14
|
+
color?: ColorPairToken,
|
|
15
|
+
variant?: ButtonVariant,
|
|
21
16
|
}
|
|
22
17
|
|
|
23
18
|
export type ButtonStyle = ViewStyle
|
|
24
19
|
|
|
25
20
|
export type ButtonTextStyle = TextStyle
|
|
26
21
|
|
|
27
|
-
export type
|
|
28
|
-
|
|
22
|
+
export type ButtonIconStyle = IconStyle
|
|
23
|
+
|
|
24
|
+
export type ButtonThemeResolvers = {
|
|
25
|
+
container: StyleResolverFunction<ButtonState, ButtonStyle>,
|
|
26
|
+
stateLayer: StyleResolverFunction<ButtonState, ButtonStyle>,
|
|
27
|
+
icon: StyleResolverFunction<ButtonState, ButtonIconStyle>,
|
|
29
28
|
text: StyleResolverFunction<ButtonState, ButtonTextStyle>,
|
|
30
29
|
}
|