@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
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import type { ColorPairToken } from '@helpwave/hightide-design/theme-tokens'
|
|
2
|
+
import type {
|
|
3
|
+
TextStyle,
|
|
4
|
+
ViewStyle
|
|
5
|
+
} from 'react-native'
|
|
6
|
+
|
|
7
|
+
import type {
|
|
8
|
+
InteractionState,
|
|
9
|
+
StyleResolverFunction
|
|
10
|
+
} from '../resolver'
|
|
11
|
+
import type { IconStyle } from '../../../icons'
|
|
12
|
+
|
|
13
|
+
export type ListItemState = {
|
|
14
|
+
color?: ColorPairToken,
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export type ListItemStyle = ViewStyle
|
|
18
|
+
|
|
19
|
+
export type ListItemLeadingItemContainerStyle = ViewStyle
|
|
20
|
+
|
|
21
|
+
export type ListItemContentStyle = ViewStyle
|
|
22
|
+
|
|
23
|
+
export type ListItemTrailingItemContainerStyle = ViewStyle
|
|
24
|
+
|
|
25
|
+
export type ListItemDescriptionStyle = TextStyle
|
|
26
|
+
|
|
27
|
+
export type ListItemTitleStyle = TextStyle
|
|
28
|
+
|
|
29
|
+
export type ListItemIconStyle = IconStyle
|
|
30
|
+
|
|
31
|
+
export type ListItemDefaultThemeResolvers = {
|
|
32
|
+
container: StyleResolverFunction<ListItemState, ListItemStyle>,
|
|
33
|
+
leadingItemContainer: StyleResolverFunction<ListItemState, ListItemLeadingItemContainerStyle>,
|
|
34
|
+
content: StyleResolverFunction<ListItemState, ListItemContentStyle>,
|
|
35
|
+
trailingItemContainer: StyleResolverFunction<ListItemState, ListItemTrailingItemContainerStyle>,
|
|
36
|
+
descriptionText: StyleResolverFunction<ListItemState, ListItemDescriptionStyle>,
|
|
37
|
+
titleText: StyleResolverFunction<ListItemState, ListItemTitleStyle>,
|
|
38
|
+
icon: StyleResolverFunction<ListItemState, ListItemIconStyle>,
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export type ListActionItemState = InteractionState & {
|
|
42
|
+
color?: ColorPairToken,
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export type ListActionItemStyle = ViewStyle
|
|
46
|
+
|
|
47
|
+
export type ListActionItemLeadingItemContainerStyle = ViewStyle
|
|
48
|
+
|
|
49
|
+
export type ListActionItemContentStyle = ViewStyle
|
|
50
|
+
|
|
51
|
+
export type ListActionItemTrailingItemContainerStyle = ViewStyle
|
|
52
|
+
|
|
53
|
+
export type ListActionItemTitleStyle = TextStyle
|
|
54
|
+
|
|
55
|
+
export type ListActionItemIconStyle = IconStyle
|
|
56
|
+
|
|
57
|
+
export type ListActionItemThemeResolvers = {
|
|
58
|
+
container: StyleResolverFunction<ListActionItemState, ListActionItemStyle>,
|
|
59
|
+
leadingItemContainer: StyleResolverFunction<ListActionItemState, ListActionItemLeadingItemContainerStyle>,
|
|
60
|
+
content: StyleResolverFunction<ListActionItemState, ListActionItemContentStyle>,
|
|
61
|
+
trailingItemContainer: StyleResolverFunction<ListActionItemState, ListActionItemTrailingItemContainerStyle>,
|
|
62
|
+
titleText: StyleResolverFunction<ListActionItemState, ListActionItemTitleStyle>,
|
|
63
|
+
icon: StyleResolverFunction<ListActionItemState, ListActionItemIconStyle>,
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export type ListNavigationItemState = ListActionItemState
|
|
67
|
+
|
|
68
|
+
export type ListNavigationItemStyle = ListActionItemStyle
|
|
69
|
+
|
|
70
|
+
export type ListNavigationItemLeadingItemContainerStyle = ListActionItemLeadingItemContainerStyle
|
|
71
|
+
|
|
72
|
+
export type ListNavigationItemContentStyle = ListActionItemContentStyle
|
|
73
|
+
|
|
74
|
+
export type ListNavigationItemTrailingItemContainerStyle = ListActionItemTrailingItemContainerStyle
|
|
75
|
+
|
|
76
|
+
export type ListNavigationItemTitleStyle = ListActionItemTitleStyle
|
|
77
|
+
|
|
78
|
+
export type ListNavigationItemIconStyle = ListActionItemIconStyle
|
|
79
|
+
|
|
80
|
+
export type ListNavigationItemThemeResolvers = ListActionItemThemeResolvers
|
|
81
|
+
|
|
82
|
+
export type ListItemThemeResolvers = {
|
|
83
|
+
default: ListItemDefaultThemeResolvers,
|
|
84
|
+
action: ListActionItemThemeResolvers,
|
|
85
|
+
navigation: ListNavigationItemThemeResolvers,
|
|
86
|
+
}
|
|
@@ -3,16 +3,21 @@ import type {
|
|
|
3
3
|
ViewStyle
|
|
4
4
|
} from 'react-native'
|
|
5
5
|
|
|
6
|
-
import type { Color } from '../color'
|
|
7
6
|
import type {
|
|
7
|
+
SelectEmptyTextStyle,
|
|
8
|
+
SelectHeaderStyle,
|
|
9
|
+
SelectMenuState,
|
|
8
10
|
SelectMenuStyle,
|
|
9
11
|
SelectOptionState,
|
|
10
12
|
SelectOverlayStyle,
|
|
11
|
-
SelectSearchStyle,
|
|
12
13
|
SelectState,
|
|
13
14
|
SelectTriggerTextStyle
|
|
14
15
|
} from './select'
|
|
15
|
-
import type {
|
|
16
|
+
import type {
|
|
17
|
+
SimpleStyleResolver,
|
|
18
|
+
StyleResolverFunction
|
|
19
|
+
} from '../resolver'
|
|
20
|
+
import type { IconStyle } from '../../../icons'
|
|
16
21
|
|
|
17
22
|
export type MultiSelectState = SelectState & {
|
|
18
23
|
hasSelections?: boolean,
|
|
@@ -28,20 +33,17 @@ export type MultiSelectOptionTextStyle = TextStyle
|
|
|
28
33
|
|
|
29
34
|
export type MultiSelectCheckboxStyle = ViewStyle
|
|
30
35
|
|
|
31
|
-
export type MultiSelectCheckboxIconStyle =
|
|
32
|
-
color: Color,
|
|
33
|
-
visible: boolean,
|
|
34
|
-
}
|
|
36
|
+
export type MultiSelectCheckboxIconStyle = IconStyle
|
|
35
37
|
|
|
36
|
-
export type
|
|
38
|
+
export type MultiSelectThemeResolvers = {
|
|
37
39
|
trigger: StyleResolverFunction<MultiSelectState, MultiSelectTriggerStyle>,
|
|
38
40
|
triggerText: StyleResolverFunction<MultiSelectState, SelectTriggerTextStyle>,
|
|
39
|
-
overlay:
|
|
40
|
-
menu: StyleResolverFunction<
|
|
41
|
-
|
|
42
|
-
searchPlaceholderColor: StyleResolverFunction<MultiSelectState, Color>,
|
|
41
|
+
overlay: SimpleStyleResolver<SelectOverlayStyle>,
|
|
42
|
+
menu: StyleResolverFunction<SelectMenuState, SelectMenuStyle>,
|
|
43
|
+
header: SimpleStyleResolver<SelectHeaderStyle>,
|
|
43
44
|
option: StyleResolverFunction<MultiSelectOptionState, MultiSelectOptionStyle>,
|
|
44
45
|
optionText: StyleResolverFunction<MultiSelectOptionState, MultiSelectOptionTextStyle>,
|
|
46
|
+
emptyText: SimpleStyleResolver<SelectEmptyTextStyle>,
|
|
45
47
|
checkbox: StyleResolverFunction<MultiSelectOptionState, MultiSelectCheckboxStyle>,
|
|
46
48
|
checkboxIcon: StyleResolverFunction<MultiSelectOptionState, MultiSelectCheckboxIconStyle>,
|
|
47
49
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { TextStyle, ViewStyle } from 'react-native'
|
|
2
|
+
|
|
3
|
+
import type { ColorPairToken } from '@helpwave/hightide-design/theme-tokens'
|
|
4
|
+
|
|
5
|
+
import type {
|
|
6
|
+
InteractionState,
|
|
7
|
+
StyleResolverFunction
|
|
8
|
+
} from '../resolver'
|
|
9
|
+
|
|
10
|
+
export type SearchBarState = InteractionState & {
|
|
11
|
+
color?: ColorPairToken,
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export type SearchBarContainerStyle = ViewStyle
|
|
15
|
+
|
|
16
|
+
export type SearchBarInputStyle = TextStyle
|
|
17
|
+
|
|
18
|
+
export type SearchBarPlaceholderStyle = TextStyle
|
|
19
|
+
|
|
20
|
+
export type SearchBarIconButtonStyle = ViewStyle
|
|
21
|
+
|
|
22
|
+
export type SearchBarThemeResolvers = {
|
|
23
|
+
container: StyleResolverFunction<SearchBarState, SearchBarContainerStyle>,
|
|
24
|
+
input: StyleResolverFunction<SearchBarState, SearchBarInputStyle>,
|
|
25
|
+
placeholder: StyleResolverFunction<SearchBarState, SearchBarPlaceholderStyle>,
|
|
26
|
+
iconButton: StyleResolverFunction<SearchBarState, SearchBarIconButtonStyle>,
|
|
27
|
+
iconButtonColor: StyleResolverFunction<SearchBarState, ColorPairToken>,
|
|
28
|
+
}
|
|
@@ -3,20 +3,23 @@ import type {
|
|
|
3
3
|
ViewStyle
|
|
4
4
|
} from 'react-native'
|
|
5
5
|
|
|
6
|
-
import type {
|
|
6
|
+
import type { ColorPairToken } from '@helpwave/hightide-design/theme-tokens'
|
|
7
|
+
|
|
7
8
|
import type {
|
|
8
9
|
InteractionState,
|
|
10
|
+
SimpleStyleResolver,
|
|
9
11
|
StyleResolverFunction
|
|
10
12
|
} from '../resolver'
|
|
13
|
+
import type { IconStyle } from '../../../icons'
|
|
11
14
|
|
|
12
15
|
export type SelectState = InteractionState & {
|
|
13
|
-
|
|
14
|
-
isReadOnly?: boolean,
|
|
16
|
+
color?: ColorPairToken,
|
|
15
17
|
isOpen?: boolean,
|
|
16
18
|
hasValue?: boolean,
|
|
17
19
|
}
|
|
18
20
|
|
|
19
21
|
export type SelectOptionState = InteractionState & {
|
|
22
|
+
color?: ColorPairToken,
|
|
20
23
|
isSelected?: boolean,
|
|
21
24
|
isHighlighted?: boolean,
|
|
22
25
|
}
|
|
@@ -25,23 +28,32 @@ export type SelectTriggerStyle = ViewStyle
|
|
|
25
28
|
|
|
26
29
|
export type SelectTriggerTextStyle = TextStyle
|
|
27
30
|
|
|
31
|
+
export type SelectIconStyle = IconStyle
|
|
32
|
+
|
|
33
|
+
export type SelectMenuState = {
|
|
34
|
+
hasSearch?: boolean,
|
|
35
|
+
}
|
|
36
|
+
|
|
28
37
|
export type SelectOverlayStyle = ViewStyle
|
|
29
38
|
|
|
30
39
|
export type SelectMenuStyle = ViewStyle
|
|
31
40
|
|
|
32
|
-
export type
|
|
41
|
+
export type SelectHeaderStyle = ViewStyle
|
|
33
42
|
|
|
34
43
|
export type SelectOptionStyle = ViewStyle
|
|
35
44
|
|
|
36
45
|
export type SelectOptionTextStyle = TextStyle
|
|
37
46
|
|
|
38
|
-
export type
|
|
47
|
+
export type SelectEmptyTextStyle = TextStyle
|
|
48
|
+
|
|
49
|
+
export type SelectThemeResolvers = {
|
|
39
50
|
trigger: StyleResolverFunction<SelectState, SelectTriggerStyle>,
|
|
40
51
|
triggerText: StyleResolverFunction<SelectState, SelectTriggerTextStyle>,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
52
|
+
icon: StyleResolverFunction<SelectState, SelectIconStyle>,
|
|
53
|
+
overlay: SimpleStyleResolver<SelectOverlayStyle>,
|
|
54
|
+
menu: StyleResolverFunction<SelectMenuState, SelectMenuStyle>,
|
|
55
|
+
header: SimpleStyleResolver<SelectHeaderStyle>,
|
|
45
56
|
option: StyleResolverFunction<SelectOptionState, SelectOptionStyle>,
|
|
46
57
|
optionText: StyleResolverFunction<SelectOptionState, SelectOptionTextStyle>,
|
|
58
|
+
emptyText: SimpleStyleResolver<SelectEmptyTextStyle>,
|
|
47
59
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ViewStyle } from 'react-native'
|
|
2
|
+
|
|
3
|
+
import type {
|
|
4
|
+
InteractionState,
|
|
5
|
+
StyleResolverFunction
|
|
6
|
+
} from '../resolver'
|
|
7
|
+
|
|
8
|
+
export type SwitchState = InteractionState & {
|
|
9
|
+
isActive?: boolean,
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type SwitchContainerStyle = ViewStyle
|
|
13
|
+
|
|
14
|
+
export type SwitchTrackStyle = ViewStyle
|
|
15
|
+
|
|
16
|
+
export type SwitchThumbStyle = ViewStyle
|
|
17
|
+
|
|
18
|
+
export type SwitchThemeResolvers = {
|
|
19
|
+
container: StyleResolverFunction<SwitchState, SwitchContainerStyle>,
|
|
20
|
+
track: StyleResolverFunction<SwitchState, SwitchTrackStyle>,
|
|
21
|
+
thumb: StyleResolverFunction<SwitchState, SwitchThumbStyle>,
|
|
22
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { TextStyle, ViewStyle } from 'react-native'
|
|
2
|
+
|
|
3
|
+
import type {
|
|
4
|
+
ColoringColorVariant,
|
|
5
|
+
ColoringStyle,
|
|
6
|
+
ComponentSize
|
|
7
|
+
} from '@helpwave/hightide-design/semantic-token-resolvers'
|
|
8
|
+
import type { ColorPairToken } from '@helpwave/hightide-design/theme-tokens'
|
|
9
|
+
|
|
10
|
+
import type {
|
|
11
|
+
InteractionState,
|
|
12
|
+
StyleResolverFunction
|
|
13
|
+
} from '../resolver'
|
|
14
|
+
|
|
15
|
+
export type ThemedPressableState = InteractionState & {
|
|
16
|
+
size?: ComponentSize,
|
|
17
|
+
color?: ColorPairToken,
|
|
18
|
+
coloringStyle?: ColoringStyle,
|
|
19
|
+
coloringColorVariant?: ColoringColorVariant,
|
|
20
|
+
hasAdditionalHorizontalPadding?: boolean,
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export type ThemedPressableStyle = ViewStyle
|
|
24
|
+
|
|
25
|
+
export type ThemedPressableTextStyle = TextStyle
|
|
26
|
+
|
|
27
|
+
export type ThemedPressableThemeResolvers = {
|
|
28
|
+
container: StyleResolverFunction<ThemedPressableState, ThemedPressableStyle>,
|
|
29
|
+
stateLayer: StyleResolverFunction<ThemedPressableState, ThemedPressableStyle>,
|
|
30
|
+
text: StyleResolverFunction<ThemedPressableState, ThemedPressableTextStyle>,
|
|
31
|
+
}
|
package/src/theme/types/index.ts
CHANGED
|
@@ -1,58 +1,26 @@
|
|
|
1
|
-
|
|
1
|
+
import type {
|
|
2
|
+
ElementLayoutTokens
|
|
3
|
+
} from '@helpwave/hightide-design/semantic-token-resolvers'
|
|
4
|
+
import type {
|
|
5
|
+
ThemeBorderWidthTokens,
|
|
6
|
+
ThemeElevationTokens,
|
|
7
|
+
ThemeShapeTokens,
|
|
8
|
+
ThemeSpacingTokens
|
|
9
|
+
} from '@helpwave/hightide-design/theme-tokens'
|
|
2
10
|
|
|
3
|
-
export type
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
paddingX: number,
|
|
20
|
-
paddingYOutline: number,
|
|
21
|
-
paddingXOutline: number,
|
|
22
|
-
gap: number,
|
|
23
|
-
minWidth: number,
|
|
24
|
-
borderRadius: number,
|
|
25
|
-
}>,
|
|
26
|
-
iconButton: Record<ElementSize, {
|
|
27
|
-
paddingYOutline: number,
|
|
28
|
-
paddingXOutline: number,
|
|
29
|
-
borderRadius: number,
|
|
30
|
-
}>,
|
|
31
|
-
icon: Record<ElementSize, { size: number, strokeWidth: number }>,
|
|
32
|
-
input: Record<'md', {
|
|
33
|
-
height: number,
|
|
34
|
-
paddingX: number,
|
|
35
|
-
paddingY: number,
|
|
36
|
-
borderRadius: number,
|
|
37
|
-
}>,
|
|
38
|
-
chip: Record<ElementSize, {
|
|
39
|
-
minHeight: number,
|
|
40
|
-
paddingVertical: number,
|
|
41
|
-
paddingHorizontal: number,
|
|
42
|
-
gap: number,
|
|
43
|
-
borderRadius: number,
|
|
44
|
-
fontSize: number,
|
|
45
|
-
}>,
|
|
46
|
-
avatar: Record<ElementSize, {
|
|
47
|
-
size: number,
|
|
48
|
-
padding: number,
|
|
49
|
-
fontSize: number,
|
|
50
|
-
statusDotSize: number,
|
|
51
|
-
statusDotBorderWidth: number,
|
|
52
|
-
}>,
|
|
53
|
-
avatarGroup: {
|
|
54
|
-
overlap: number,
|
|
55
|
-
maxShown: number,
|
|
56
|
-
gap: number,
|
|
57
|
-
},
|
|
58
|
-
}
|
|
11
|
+
export type HightideSpacing = ThemeSpacingTokens
|
|
12
|
+
|
|
13
|
+
export type HightideElements = ElementLayoutTokens
|
|
14
|
+
|
|
15
|
+
export type HightideBorderRadius = ThemeShapeTokens['borderRadius']
|
|
16
|
+
|
|
17
|
+
export type HightideBorder = ThemeBorderWidthTokens
|
|
18
|
+
|
|
19
|
+
export type HightideShadowToken = ThemeElevationTokens[keyof ThemeElevationTokens]
|
|
20
|
+
|
|
21
|
+
export type HightideShadow = {
|
|
22
|
+
raised: HightideShadowToken,
|
|
23
|
+
container: HightideShadowToken,
|
|
24
|
+
popover: HightideShadowToken,
|
|
25
|
+
dialog: HightideShadowToken,
|
|
26
|
+
}
|
|
@@ -1,12 +1,45 @@
|
|
|
1
|
+
import type { ThemeTokens } from '@helpwave/hightide-design/theme-tokens'
|
|
2
|
+
import type { SemanticTokenResolvers } from '@helpwave/hightide-design/semantic-token-resolvers'
|
|
3
|
+
import type {
|
|
4
|
+
ComponentTokenResolvers,
|
|
5
|
+
PressableState,
|
|
6
|
+
PressableStateValue
|
|
7
|
+
} from '@helpwave/hightide-design/component-token-resolvers'
|
|
8
|
+
|
|
1
9
|
export type InteractionState = {
|
|
2
10
|
isDisabled?: boolean,
|
|
3
11
|
isHovered?: boolean,
|
|
4
12
|
isFocused?: boolean,
|
|
13
|
+
isFocusVisible?: boolean,
|
|
5
14
|
isPressed?: boolean,
|
|
6
|
-
|
|
15
|
+
isReadonly?: boolean,
|
|
7
16
|
isInvalid?: boolean,
|
|
8
17
|
}
|
|
9
18
|
|
|
19
|
+
export const toPressableInteractionState = (
|
|
20
|
+
state: InteractionState = {}
|
|
21
|
+
): PressableState => {
|
|
22
|
+
const active = new Set<PressableStateValue>()
|
|
23
|
+
|
|
24
|
+
if (state.isDisabled) {
|
|
25
|
+
active.add('disabled')
|
|
26
|
+
}
|
|
27
|
+
if (state.isFocused) {
|
|
28
|
+
active.add('focused')
|
|
29
|
+
}
|
|
30
|
+
if (state.isFocusVisible) {
|
|
31
|
+
active.add('focusVisible')
|
|
32
|
+
}
|
|
33
|
+
if (state.isHovered) {
|
|
34
|
+
active.add('hovered')
|
|
35
|
+
}
|
|
36
|
+
if (state.isPressed) {
|
|
37
|
+
active.add('pressed')
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return active
|
|
41
|
+
}
|
|
42
|
+
|
|
10
43
|
export type StyleOverwrite<TState, TStyle> =
|
|
11
44
|
TStyle | ((prev: TStyle, state: TState) => TStyle)
|
|
12
45
|
|
|
@@ -15,6 +48,14 @@ export type StyleResolverFunction<TState, TStyle> = (
|
|
|
15
48
|
overwrite?: StyleOverwrite<TState, TStyle>,
|
|
16
49
|
) => TStyle
|
|
17
50
|
|
|
51
|
+
export type SimpleStyleResolver<TStyle> = StyleResolverFunction<Record<string, never>, TStyle>
|
|
52
|
+
|
|
53
|
+
export type ComponentThemeResolver<TTheme> = (params: {
|
|
54
|
+
themeTokens: ThemeTokens,
|
|
55
|
+
semanticTokens: SemanticTokenResolvers,
|
|
56
|
+
componentTokens: ComponentTokenResolvers,
|
|
57
|
+
}) => TTheme
|
|
58
|
+
|
|
18
59
|
export const createStyleResolver = <TState, TStyle>(
|
|
19
60
|
resolve: (props: TState) => TStyle
|
|
20
61
|
): StyleResolverFunction<TState, TStyle> => {
|
|
@@ -33,6 +74,12 @@ export const createStyleResolver = <TState, TStyle>(
|
|
|
33
74
|
}
|
|
34
75
|
}
|
|
35
76
|
|
|
77
|
+
export const createSimpleStyleResolver = <TStyle>(
|
|
78
|
+
resolve: () => TStyle
|
|
79
|
+
): SimpleStyleResolver<TStyle> => {
|
|
80
|
+
return createStyleResolver<Record<string, never>, TStyle>(resolve)
|
|
81
|
+
}
|
|
82
|
+
|
|
36
83
|
export const createValueResolver = <TState, TValue>(
|
|
37
84
|
resolve: (props: TState) => TValue
|
|
38
85
|
): StyleResolverFunction<TState, TValue> => {
|
|
@@ -50,3 +97,9 @@ export const createValueResolver = <TState, TValue>(
|
|
|
50
97
|
return overwrite
|
|
51
98
|
}
|
|
52
99
|
}
|
|
100
|
+
|
|
101
|
+
export const createSimpleValueResolver = <TValue>(
|
|
102
|
+
resolve: () => TValue
|
|
103
|
+
): SimpleStyleResolver<TValue> => {
|
|
104
|
+
return createValueResolver<Record<string, never>, TValue>(resolve)
|
|
105
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { ColorToken, HexColorToken } from '@helpwave/hightide-design/primitive-tokens'
|
|
2
|
+
import type {
|
|
3
|
+
Appearance,
|
|
4
|
+
ColoringColorTokens,
|
|
5
|
+
ColoringColorVariant,
|
|
6
|
+
ColoringStyle,
|
|
7
|
+
ColoringToken,
|
|
8
|
+
ContainerLayoutToken,
|
|
9
|
+
ControlElementLayoutToken,
|
|
10
|
+
InputColoringTokens,
|
|
11
|
+
InsideControlElementLayoutToken,
|
|
12
|
+
PressableColoringTokens,
|
|
13
|
+
ButtonVariant
|
|
14
|
+
} from '@helpwave/hightide-design/semantic-token-resolvers'
|
|
15
|
+
import type { InputState } from '@helpwave/hightide-design/component-token-resolvers'
|
|
16
|
+
import type { PressableState } from '@helpwave/hightide-design/component-token-resolvers'
|
|
17
|
+
import type {
|
|
18
|
+
ColorPairToken,
|
|
19
|
+
ThemeLayoutSize,
|
|
20
|
+
ThemeTypographySize,
|
|
21
|
+
TintStrength
|
|
22
|
+
} from '@helpwave/hightide-design/theme-tokens'
|
|
23
|
+
|
|
24
|
+
export type BoundSemanticResolver<TParameter, TResult> = (parameter: TParameter) => TResult
|
|
25
|
+
|
|
26
|
+
export type HightideThemeSemantics = {
|
|
27
|
+
coloringColorVariant: BoundSemanticResolver<{
|
|
28
|
+
colorPair: ColorPairToken,
|
|
29
|
+
variant: ColoringColorVariant,
|
|
30
|
+
}, ColoringColorTokens>,
|
|
31
|
+
coloringStyle: BoundSemanticResolver<{
|
|
32
|
+
coloring: ColoringColorTokens,
|
|
33
|
+
style: ColoringStyle,
|
|
34
|
+
}, ColoringToken>,
|
|
35
|
+
pressableColoring: BoundSemanticResolver<{
|
|
36
|
+
coloring: ColoringToken,
|
|
37
|
+
variant: ButtonVariant,
|
|
38
|
+
state: PressableState,
|
|
39
|
+
}, PressableColoringTokens>,
|
|
40
|
+
pressableStateLayerTint: BoundSemanticResolver<{
|
|
41
|
+
states: PressableState,
|
|
42
|
+
color: ColorToken,
|
|
43
|
+
}, ColorToken>,
|
|
44
|
+
inputColoring: BoundSemanticResolver<{
|
|
45
|
+
state: InputState,
|
|
46
|
+
color?: ColorPairToken,
|
|
47
|
+
}, InputColoringTokens>,
|
|
48
|
+
controlLayout: BoundSemanticResolver<{
|
|
49
|
+
size: ThemeLayoutSize,
|
|
50
|
+
}, ControlElementLayoutToken>,
|
|
51
|
+
touchTargetSize: BoundSemanticResolver<object, number>,
|
|
52
|
+
containerLayout: BoundSemanticResolver<{
|
|
53
|
+
size: ThemeLayoutSize,
|
|
54
|
+
}, ContainerLayoutToken>,
|
|
55
|
+
insideControlLayout: BoundSemanticResolver<{
|
|
56
|
+
size: ThemeTypographySize,
|
|
57
|
+
}, InsideControlElementLayoutToken>,
|
|
58
|
+
tintedSurface: BoundSemanticResolver<{
|
|
59
|
+
tintColor: HexColorToken,
|
|
60
|
+
tintStrength?: TintStrength,
|
|
61
|
+
}, HexColorToken>,
|
|
62
|
+
withAppearance: BoundSemanticResolver<{
|
|
63
|
+
color: HexColorToken,
|
|
64
|
+
appearance: Appearance,
|
|
65
|
+
}, HexColorToken>,
|
|
66
|
+
asFaded: BoundSemanticResolver<{
|
|
67
|
+
color: HexColorToken,
|
|
68
|
+
}, HexColorToken>,
|
|
69
|
+
asDescription: BoundSemanticResolver<{
|
|
70
|
+
color: HexColorToken,
|
|
71
|
+
}, HexColorToken>,
|
|
72
|
+
}
|
package/src/theme/types/theme.ts
CHANGED
|
@@ -1,26 +1,39 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
HightideSemanticColors
|
|
4
|
-
} from './color'
|
|
1
|
+
import type { ThemeColorTokens } from '@helpwave/hightide-design/theme-tokens'
|
|
2
|
+
|
|
5
3
|
import type { HightideComponentThemes } from './components/hightide'
|
|
6
|
-
import type {
|
|
7
|
-
import type {
|
|
4
|
+
import type { HightideIcongraphy } from './icongraphy'
|
|
5
|
+
import type {
|
|
6
|
+
HightideBorder,
|
|
7
|
+
HightideBorderRadius,
|
|
8
|
+
HightideElements,
|
|
9
|
+
HightideShadow,
|
|
10
|
+
HightideSpacing
|
|
11
|
+
} from './layout'
|
|
12
|
+
import type { HightideThemeSemantics } from './semantics'
|
|
8
13
|
import type { HightideTypography } from './typography'
|
|
9
14
|
|
|
10
15
|
export type Theme = {
|
|
11
16
|
colors: Record<string, unknown>,
|
|
12
|
-
|
|
17
|
+
semantics: Record<string, unknown>,
|
|
13
18
|
components: Record<string, unknown>,
|
|
14
19
|
typography: Record<string, unknown>,
|
|
15
|
-
|
|
16
|
-
|
|
20
|
+
icongraphy: Record<string, unknown>,
|
|
21
|
+
spacing: Record<string, unknown>,
|
|
22
|
+
elements: Record<string, unknown>,
|
|
23
|
+
borderRadius: Record<string, unknown>,
|
|
24
|
+
border: Record<string, unknown>,
|
|
25
|
+
shadow: Record<string, unknown>,
|
|
17
26
|
}
|
|
18
27
|
|
|
19
28
|
export type HightideTheme = Theme & {
|
|
20
|
-
colors:
|
|
21
|
-
|
|
29
|
+
colors: ThemeColorTokens & Theme['colors'],
|
|
30
|
+
semantics: HightideThemeSemantics & Theme['semantics'],
|
|
22
31
|
components: HightideComponentThemes & Theme['components'],
|
|
23
32
|
typography: HightideTypography & Theme['typography'],
|
|
24
|
-
|
|
25
|
-
|
|
33
|
+
icongraphy: HightideIcongraphy & Theme['icongraphy'],
|
|
34
|
+
spacing: HightideSpacing & Theme['spacing'],
|
|
35
|
+
elements: HightideElements & Theme['elements'],
|
|
36
|
+
borderRadius: HightideBorderRadius & Theme['borderRadius'],
|
|
37
|
+
border: HightideBorder & Theme['border'],
|
|
38
|
+
shadow: HightideShadow & Theme['shadow'],
|
|
26
39
|
}
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
1
|
+
import type {
|
|
2
|
+
ThemeTypographyTokens,
|
|
3
|
+
ThemeTypographySize,
|
|
4
|
+
TypographyStyleToken
|
|
5
|
+
} from '@helpwave/hightide-design/theme-tokens'
|
|
7
6
|
|
|
8
|
-
export type
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
7
|
+
export type TextStyle = TypographyStyleToken
|
|
8
|
+
|
|
9
|
+
export type HightideTypography = ThemeTypographyTokens
|
|
10
|
+
|
|
11
|
+
export type HightideFontFamilies = ThemeTypographyTokens['fontFamilies']
|
|
12
|
+
|
|
13
|
+
export type HightideFontWeights = ThemeTypographyTokens['fontWeights']
|
|
14
|
+
|
|
15
|
+
export type TypographySizes = ThemeTypographySize
|
|
16
|
+
|
|
17
|
+
export type { TypographyStyleToken }
|