@helpwave/hightide-native 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +56 -0
- package/package.json +3 -3
- package/src/components/chat/ChatAttachmentCard.tsx +97 -0
- package/src/components/chat/ChatConversationList.tsx +68 -0
- package/src/components/chat/ChatConversationRow.tsx +145 -0
- package/src/components/chat/ChatDateDivider.tsx +45 -0
- package/src/components/chat/ChatMessageBubble.tsx +102 -0
- package/src/components/chat/ChatMessageCard.tsx +107 -0
- package/src/components/chat/ChatMessageComposer.tsx +110 -0
- package/src/components/chat/ChatMessageList.tsx +59 -0
- package/src/components/chat/ChatQuickReplyChip.tsx +71 -0
- package/src/components/chat/ChatSystemLine.tsx +57 -0
- package/src/components/chat/ChatThreadHeader.tsx +80 -0
- package/src/components/chat/index.ts +11 -0
- package/src/components/index.ts +4 -7
- package/src/components/menu/Menu.tsx +51 -0
- package/src/components/menu/MenuActionItem.tsx +85 -0
- package/src/components/menu/MenuItem.tsx +63 -0
- package/src/components/menu/MenuNavigationItem.tsx +85 -0
- package/src/components/menu/index.ts +4 -0
- package/src/components/{Button → user-interaction}/Button.tsx +22 -29
- package/src/components/{Checkbox → user-interaction}/Checkbox.tsx +14 -11
- package/src/components/{IconButton → user-interaction}/IconButton.tsx +17 -25
- package/src/components/{Input → user-interaction}/Input.tsx +15 -11
- package/src/components/{MultiSelect → user-interaction}/MultiSelect.tsx +34 -9
- package/src/components/{Select → user-interaction}/Select.tsx +33 -8
- package/src/components/user-interaction/index.ts +6 -0
- package/src/components/{Chip → visualization-and-display}/Chip.tsx +17 -13
- package/src/theme/resolvers/button.ts +7 -5
- package/src/theme/resolvers/chat.ts +384 -0
- package/src/theme/resolvers/checkbox.ts +5 -4
- package/src/theme/resolvers/chip.ts +7 -5
- package/src/theme/resolvers/iconButton.ts +6 -4
- package/src/theme/resolvers/index.ts +2 -0
- package/src/theme/resolvers/input.ts +6 -4
- package/src/theme/resolvers/menu.ts +112 -0
- package/src/theme/resolvers/multiSelect.ts +20 -19
- package/src/theme/resolvers/select.ts +16 -15
- package/src/theme/themes/createTheme.ts +4 -0
- package/src/theme/types/button.ts +7 -30
- package/src/theme/types/chat.ts +141 -0
- package/src/theme/types/checkbox.ts +5 -14
- package/src/theme/types/chip.ts +7 -30
- package/src/theme/types/components.ts +4 -0
- package/src/theme/types/iconButton.ts +6 -20
- package/src/theme/types/index.ts +2 -0
- package/src/theme/types/input.ts +5 -15
- package/src/theme/types/menu.ts +50 -0
- package/src/theme/types/multiSelect.ts +17 -39
- package/src/theme/types/resolver.ts +43 -1
- package/src/theme/types/select.ts +18 -55
- package/src/components/Button/index.ts +0 -1
- package/src/components/Checkbox/index.ts +0 -1
- package/src/components/IconButton/index.ts +0 -1
- package/src/components/Input/index.ts +0 -1
- package/src/components/MultiSelect/index.ts +0 -1
- package/src/components/Select/index.ts +0 -1
- /package/src/components/{Chip → visualization-and-display}/index.ts +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type { ColorValue
|
|
2
|
-
import type {
|
|
1
|
+
import type { ColorValue } from '@helpwave/hightide-design'
|
|
2
|
+
import type { StyleProp, TextStyle, ViewStyle } from 'react-native'
|
|
3
|
+
import type { StyleResolverFunction } from './resolver'
|
|
3
4
|
import type {
|
|
4
5
|
SelectMenuStyle,
|
|
5
6
|
SelectOptionState,
|
|
6
7
|
SelectOverlayStyle,
|
|
7
8
|
SelectSearchStyle,
|
|
8
9
|
SelectState,
|
|
9
|
-
SelectTriggerStyle,
|
|
10
10
|
SelectTriggerTextStyle
|
|
11
11
|
} from './select'
|
|
12
12
|
|
|
@@ -16,35 +16,13 @@ export type MultiSelectState = SelectState & {
|
|
|
16
16
|
|
|
17
17
|
export type MultiSelectOptionState = SelectOptionState
|
|
18
18
|
|
|
19
|
-
export type MultiSelectTriggerStyle =
|
|
20
|
-
gap: number,
|
|
21
|
-
}
|
|
19
|
+
export type MultiSelectTriggerStyle = StyleProp<ViewStyle>
|
|
22
20
|
|
|
23
|
-
export type MultiSelectOptionStyle =
|
|
24
|
-
paddingHorizontal: number,
|
|
25
|
-
paddingVertical: number,
|
|
26
|
-
backgroundColor: ColorValue | 'transparent',
|
|
27
|
-
opacity: number,
|
|
28
|
-
flexDirection: 'row',
|
|
29
|
-
alignItems: 'center',
|
|
30
|
-
gap: number,
|
|
31
|
-
}
|
|
21
|
+
export type MultiSelectOptionStyle = StyleProp<ViewStyle>
|
|
32
22
|
|
|
33
|
-
export type MultiSelectOptionTextStyle =
|
|
34
|
-
color: ColorValue,
|
|
35
|
-
fontWeight: FontWeight,
|
|
36
|
-
}
|
|
23
|
+
export type MultiSelectOptionTextStyle = StyleProp<TextStyle>
|
|
37
24
|
|
|
38
|
-
export type MultiSelectCheckboxStyle =
|
|
39
|
-
width: number,
|
|
40
|
-
height: number,
|
|
41
|
-
borderRadius: number,
|
|
42
|
-
borderWidth: number,
|
|
43
|
-
borderColor: ColorValue,
|
|
44
|
-
backgroundColor: ColorValue | 'transparent',
|
|
45
|
-
alignItems: 'center',
|
|
46
|
-
justifyContent: 'center',
|
|
47
|
-
}
|
|
25
|
+
export type MultiSelectCheckboxStyle = StyleProp<ViewStyle>
|
|
48
26
|
|
|
49
27
|
export type MultiSelectCheckboxIconStyle = {
|
|
50
28
|
color: ColorValue,
|
|
@@ -52,14 +30,14 @@ export type MultiSelectCheckboxIconStyle = {
|
|
|
52
30
|
}
|
|
53
31
|
|
|
54
32
|
export type MultiSelectTheme = {
|
|
55
|
-
trigger:
|
|
56
|
-
triggerText:
|
|
57
|
-
overlay:
|
|
58
|
-
menu:
|
|
59
|
-
search:
|
|
60
|
-
searchPlaceholderColor:
|
|
61
|
-
option:
|
|
62
|
-
optionText:
|
|
63
|
-
checkbox:
|
|
64
|
-
checkboxIcon:
|
|
33
|
+
trigger: StyleResolverFunction<MultiSelectState, MultiSelectTriggerStyle>,
|
|
34
|
+
triggerText: StyleResolverFunction<MultiSelectState, SelectTriggerTextStyle>,
|
|
35
|
+
overlay: StyleResolverFunction<MultiSelectState, SelectOverlayStyle>,
|
|
36
|
+
menu: StyleResolverFunction<MultiSelectState, SelectMenuStyle>,
|
|
37
|
+
search: StyleResolverFunction<MultiSelectState, SelectSearchStyle>,
|
|
38
|
+
searchPlaceholderColor: StyleResolverFunction<MultiSelectState, ColorValue>,
|
|
39
|
+
option: StyleResolverFunction<MultiSelectOptionState, MultiSelectOptionStyle>,
|
|
40
|
+
optionText: StyleResolverFunction<MultiSelectOptionState, MultiSelectOptionTextStyle>,
|
|
41
|
+
checkbox: StyleResolverFunction<MultiSelectOptionState, MultiSelectCheckboxStyle>,
|
|
42
|
+
checkboxIcon: StyleResolverFunction<MultiSelectOptionState, MultiSelectCheckboxIconStyle>,
|
|
65
43
|
}
|
|
@@ -7,4 +7,46 @@ export type InteractionState = {
|
|
|
7
7
|
isInvalid?: boolean,
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
export type
|
|
10
|
+
export type StyleOverwrite<TState, TStyle> =
|
|
11
|
+
TStyle | ((prev: TStyle, state: TState) => TStyle)
|
|
12
|
+
|
|
13
|
+
export type StyleResolverFunction<TState, TStyle> = (
|
|
14
|
+
props: TState,
|
|
15
|
+
overwrite?: StyleOverwrite<TState, TStyle>,
|
|
16
|
+
) => TStyle
|
|
17
|
+
|
|
18
|
+
export const createStyleResolver = <TState, TStyle>(
|
|
19
|
+
resolve: (props: TState) => TStyle
|
|
20
|
+
): StyleResolverFunction<TState, TStyle> => {
|
|
21
|
+
return (props, overwrite) => {
|
|
22
|
+
const base = resolve(props)
|
|
23
|
+
|
|
24
|
+
if (overwrite === undefined) {
|
|
25
|
+
return base
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (typeof overwrite === 'function') {
|
|
29
|
+
return (overwrite as (prev: TStyle, state: TState) => TStyle)(base, props)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return [base, overwrite] as TStyle
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export const createValueResolver = <TState, TValue>(
|
|
37
|
+
resolve: (props: TState) => TValue
|
|
38
|
+
): StyleResolverFunction<TState, TValue> => {
|
|
39
|
+
return (props, overwrite) => {
|
|
40
|
+
const base = resolve(props)
|
|
41
|
+
|
|
42
|
+
if (overwrite === undefined) {
|
|
43
|
+
return base
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (typeof overwrite === 'function') {
|
|
47
|
+
return (overwrite as (prev: TValue, state: TState) => TValue)(base, props)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return overwrite
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { ColorValue
|
|
2
|
-
import type {
|
|
1
|
+
import type { ColorValue } from '@helpwave/hightide-design'
|
|
2
|
+
import type { StyleProp, TextStyle, ViewStyle } from 'react-native'
|
|
3
|
+
import type { InteractionState, StyleResolverFunction } from './resolver'
|
|
3
4
|
|
|
4
5
|
export type SelectState = InteractionState & {
|
|
5
6
|
isInvalid?: boolean,
|
|
@@ -13,65 +14,27 @@ export type SelectOptionState = InteractionState & {
|
|
|
13
14
|
isHighlighted?: boolean,
|
|
14
15
|
}
|
|
15
16
|
|
|
16
|
-
export type SelectTriggerStyle =
|
|
17
|
-
minHeight: number,
|
|
18
|
-
paddingHorizontal: number,
|
|
19
|
-
paddingVertical: number,
|
|
20
|
-
borderRadius: number,
|
|
21
|
-
borderWidth: number,
|
|
22
|
-
borderColor: ColorValue,
|
|
23
|
-
backgroundColor: ColorValue,
|
|
24
|
-
justifyContent: 'center',
|
|
25
|
-
opacity: number,
|
|
26
|
-
}
|
|
17
|
+
export type SelectTriggerStyle = StyleProp<ViewStyle>
|
|
27
18
|
|
|
28
|
-
export type SelectTriggerTextStyle =
|
|
29
|
-
color: ColorValue,
|
|
30
|
-
}
|
|
19
|
+
export type SelectTriggerTextStyle = StyleProp<TextStyle>
|
|
31
20
|
|
|
32
|
-
export type SelectOverlayStyle =
|
|
33
|
-
flex: 1,
|
|
34
|
-
backgroundColor: ColorValue,
|
|
35
|
-
justifyContent: 'center',
|
|
36
|
-
padding: number,
|
|
37
|
-
}
|
|
21
|
+
export type SelectOverlayStyle = StyleProp<ViewStyle>
|
|
38
22
|
|
|
39
|
-
export type SelectMenuStyle =
|
|
40
|
-
maxHeight: number,
|
|
41
|
-
borderRadius: number,
|
|
42
|
-
backgroundColor: ColorValue,
|
|
43
|
-
borderWidth: number,
|
|
44
|
-
borderColor: ColorValue,
|
|
45
|
-
overflow: 'hidden',
|
|
46
|
-
}
|
|
23
|
+
export type SelectMenuStyle = StyleProp<ViewStyle>
|
|
47
24
|
|
|
48
|
-
export type SelectSearchStyle =
|
|
49
|
-
paddingHorizontal: number,
|
|
50
|
-
paddingVertical: number,
|
|
51
|
-
borderBottomWidth: number,
|
|
52
|
-
borderBottomColor: ColorValue,
|
|
53
|
-
color: ColorValue,
|
|
54
|
-
}
|
|
25
|
+
export type SelectSearchStyle = StyleProp<TextStyle>
|
|
55
26
|
|
|
56
|
-
export type SelectOptionStyle =
|
|
57
|
-
paddingHorizontal: number,
|
|
58
|
-
paddingVertical: number,
|
|
59
|
-
backgroundColor: ColorValue | 'transparent',
|
|
60
|
-
opacity: number,
|
|
61
|
-
}
|
|
27
|
+
export type SelectOptionStyle = StyleProp<ViewStyle>
|
|
62
28
|
|
|
63
|
-
export type SelectOptionTextStyle =
|
|
64
|
-
color: ColorValue,
|
|
65
|
-
fontWeight: FontWeight,
|
|
66
|
-
}
|
|
29
|
+
export type SelectOptionTextStyle = StyleProp<TextStyle>
|
|
67
30
|
|
|
68
31
|
export type SelectTheme = {
|
|
69
|
-
trigger:
|
|
70
|
-
triggerText:
|
|
71
|
-
overlay:
|
|
72
|
-
menu:
|
|
73
|
-
search:
|
|
74
|
-
searchPlaceholderColor:
|
|
75
|
-
option:
|
|
76
|
-
optionText:
|
|
32
|
+
trigger: StyleResolverFunction<SelectState, SelectTriggerStyle>,
|
|
33
|
+
triggerText: StyleResolverFunction<SelectState, SelectTriggerTextStyle>,
|
|
34
|
+
overlay: StyleResolverFunction<SelectState, SelectOverlayStyle>,
|
|
35
|
+
menu: StyleResolverFunction<SelectState, SelectMenuStyle>,
|
|
36
|
+
search: StyleResolverFunction<SelectState, SelectSearchStyle>,
|
|
37
|
+
searchPlaceholderColor: StyleResolverFunction<SelectState, ColorValue>,
|
|
38
|
+
option: StyleResolverFunction<SelectOptionState, SelectOptionStyle>,
|
|
39
|
+
optionText: StyleResolverFunction<SelectOptionState, SelectOptionTextStyle>,
|
|
77
40
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Button'
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Checkbox'
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './IconButton'
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Input'
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './MultiSelect'
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Select'
|
|
File without changes
|