@helpwave/hightide-native 0.0.2 → 0.0.6
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 +4 -3
- package/src/components/chat/ChatAttachmentCard.tsx +26 -13
- package/src/components/chat/ChatConversationList.tsx +12 -8
- package/src/components/chat/ChatConversationRow.tsx +21 -13
- package/src/components/chat/ChatDateDivider.tsx +18 -8
- package/src/components/chat/ChatMessageBubble.tsx +23 -13
- package/src/components/chat/ChatMessageCard.tsx +25 -14
- package/src/components/chat/ChatMessageComposer.tsx +14 -9
- package/src/components/chat/ChatMessageList.tsx +12 -5
- package/src/components/chat/ChatQuickReplyChip.tsx +7 -6
- package/src/components/chat/ChatSystemLine.tsx +21 -10
- package/src/components/chat/ChatThreadHeader.tsx +19 -9
- package/src/components/menu/Menu.tsx +16 -6
- package/src/components/menu/MenuActionItem.tsx +10 -5
- package/src/components/menu/MenuItem.tsx +16 -6
- package/src/components/menu/MenuNavigationItem.tsx +11 -6
- package/src/components/user-interaction/Button.tsx +18 -11
- package/src/components/user-interaction/Checkbox.tsx +26 -7
- package/src/components/user-interaction/IconButton.tsx +23 -9
- package/src/components/user-interaction/Input.tsx +22 -5
- package/src/components/user-interaction/MultiSelect.tsx +14 -7
- package/src/components/user-interaction/Select.tsx +11 -4
- package/src/components/visualization-and-display/Chip.tsx +21 -9
- package/src/components/visualization-and-display/Icon.tsx +27 -0
- package/src/components/visualization-and-display/index.ts +1 -0
- package/src/global-contexts/HightideContext.ts +4 -1
- package/src/global-contexts/HightideProvider.tsx +21 -9
- package/src/global-contexts/hightide-config/HightideConfigUtils.ts +15 -12
- package/src/global-contexts/localization/LocalizationProvider.tsx +3 -1
- package/src/global-contexts/localization/forward-exports.ts +1 -0
- package/src/global-contexts/theme/ThemeContext.ts +11 -6
- package/src/global-contexts/theme/ThemeProvider.tsx +34 -37
- package/src/hooks/useMultiSelect.ts +1 -0
- package/src/hooks/useNativeKeyValueStore.ts +7 -1
- package/src/hooks/useSelect.ts +1 -0
- package/src/theme/resolvers/button.ts +33 -20
- package/src/theme/resolvers/chat.ts +370 -336
- package/src/theme/resolvers/checkbox.ts +22 -18
- package/src/theme/resolvers/chip.ts +27 -19
- package/src/theme/resolvers/coloring.ts +21 -17
- package/src/theme/resolvers/iconButton.ts +25 -17
- package/src/theme/resolvers/input.ts +25 -18
- package/src/theme/resolvers/menu.ts +37 -29
- package/src/theme/resolvers/multiSelect.ts +20 -16
- package/src/theme/resolvers/select.ts +20 -16
- package/src/theme/themes/createTheme.ts +42 -17
- package/src/theme/themes/nativeThemes.ts +7 -6
- package/src/theme/types/color.ts +60 -0
- package/src/theme/types/components/button.ts +30 -0
- package/src/theme/types/components/chat.ts +198 -0
- package/src/theme/types/{checkbox.ts → components/checkbox.ts} +11 -5
- package/src/theme/types/components/chip.ts +30 -0
- package/src/theme/types/{components.ts → components/hightide.ts} +22 -1
- package/src/theme/types/components/iconButton.ts +30 -0
- package/src/theme/types/components/index.ts +10 -0
- package/src/theme/types/components/input.ts +19 -0
- package/src/theme/types/{menu.ts → components/menu.ts} +21 -14
- package/src/theme/types/{multiSelect.ts → components/multiSelect.ts} +13 -9
- package/src/theme/types/{select.ts → components/select.ts} +18 -11
- package/src/theme/types/decoration.ts +11 -0
- package/src/theme/types/index.ts +4 -9
- package/src/theme/types/layout.ts +46 -0
- package/src/theme/types/theme.ts +14 -10
- package/src/theme/types/typography.ts +18 -0
- package/src/icons/Icon.tsx +0 -35
- package/src/icons/index.ts +0 -1
- package/src/theme/types/button.ts +0 -18
- package/src/theme/types/chat.ts +0 -141
- package/src/theme/types/chip.ts +0 -18
- package/src/theme/types/iconButton.ts +0 -20
- package/src/theme/types/input.ts +0 -15
package/src/hooks/useSelect.ts
CHANGED
|
@@ -1,15 +1,28 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
TextStyle,
|
|
3
|
+
ViewStyle
|
|
4
|
+
} from 'react-native'
|
|
5
|
+
|
|
1
6
|
import {
|
|
2
7
|
componentLayouts,
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
} from '@helpwave/hightide-design'
|
|
9
|
-
|
|
10
|
-
import
|
|
8
|
+
fontWeights
|
|
9
|
+
} from '@helpwave/hightide-design/tokens'
|
|
10
|
+
import type {
|
|
11
|
+
HightideDesignTokens as DesignTokensTheme,
|
|
12
|
+
ElementSize
|
|
13
|
+
} from '@helpwave/hightide-design/types'
|
|
14
|
+
|
|
15
|
+
import {
|
|
16
|
+
isOutlineColoringStyle,
|
|
17
|
+
resolveColoringStyles
|
|
18
|
+
} from './coloring'
|
|
19
|
+
import type { HightideSemanticColors } from '../types/color'
|
|
20
|
+
import type {
|
|
21
|
+
ButtonState,
|
|
22
|
+
ButtonTheme
|
|
23
|
+
} from '../types/components/button'
|
|
24
|
+
import type { HightideComponentThemes } from '../types/components/hightide'
|
|
11
25
|
import { createStyleResolver } from '../types/resolver'
|
|
12
|
-
import { isOutlineColoringStyle, resolveColoringStyles } from './coloring'
|
|
13
26
|
|
|
14
27
|
const buttonFontSizes: Record<ElementSize, number> = {
|
|
15
28
|
xs: 12,
|
|
@@ -19,8 +32,8 @@ const buttonFontSizes: Record<ElementSize, number> = {
|
|
|
19
32
|
}
|
|
20
33
|
|
|
21
34
|
export type CreateButtonThemeOptions = {
|
|
22
|
-
semantic:
|
|
23
|
-
coloring:
|
|
35
|
+
semantic: HightideSemanticColors,
|
|
36
|
+
coloring: HightideComponentThemes['coloring'],
|
|
24
37
|
}
|
|
25
38
|
|
|
26
39
|
export const createButtonTheme = ({
|
|
@@ -44,19 +57,19 @@ export const createButtonTheme = ({
|
|
|
44
57
|
backgroundColor: resolved.backgroundColor,
|
|
45
58
|
borderColor: resolved.borderColor,
|
|
46
59
|
borderWidth: resolved.borderWidth,
|
|
47
|
-
paddingVertical:
|
|
48
|
-
paddingHorizontal:
|
|
49
|
-
gap:
|
|
50
|
-
minWidth:
|
|
51
|
-
minHeight:
|
|
52
|
-
borderRadius:
|
|
60
|
+
paddingVertical: outlinePadding ? padding.paddingYOutline : padding.paddingY,
|
|
61
|
+
paddingHorizontal: outlinePadding ? padding.paddingXOutline : padding.paddingX,
|
|
62
|
+
gap: padding.gap,
|
|
63
|
+
minWidth: padding.minWidth,
|
|
64
|
+
minHeight: sizing.height,
|
|
65
|
+
borderRadius: padding.borderRadius,
|
|
53
66
|
opacity: state.isDisabled ? 0.6 : 1,
|
|
54
67
|
}
|
|
55
68
|
|
|
56
69
|
const text: TextStyle = {
|
|
57
70
|
color: resolved.color,
|
|
58
71
|
fontSize: buttonFontSizes[size],
|
|
59
|
-
fontWeight:
|
|
72
|
+
fontWeight: fontWeights.semibold,
|
|
60
73
|
}
|
|
61
74
|
|
|
62
75
|
return { button, text }
|
|
@@ -70,7 +83,7 @@ export const createButtonTheme = ({
|
|
|
70
83
|
|
|
71
84
|
export const createButtonThemeFromDesign = (theme: DesignTokensTheme): ButtonTheme => {
|
|
72
85
|
return createButtonTheme({
|
|
73
|
-
semantic: theme.
|
|
74
|
-
coloring: theme.coloring,
|
|
86
|
+
semantic: theme.semanticColors,
|
|
87
|
+
coloring: theme.coloring as HightideComponentThemes['coloring'],
|
|
75
88
|
})
|
|
76
89
|
}
|