@helpwave/hightide-native 0.0.1 → 0.0.5
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 +110 -0
- package/src/components/chat/ChatConversationList.tsx +72 -0
- package/src/components/chat/ChatConversationRow.tsx +153 -0
- package/src/components/chat/ChatDateDivider.tsx +55 -0
- package/src/components/chat/ChatMessageBubble.tsx +112 -0
- package/src/components/chat/ChatMessageCard.tsx +118 -0
- package/src/components/chat/ChatMessageComposer.tsx +115 -0
- package/src/components/chat/ChatMessageList.tsx +66 -0
- package/src/components/chat/ChatQuickReplyChip.tsx +72 -0
- package/src/components/chat/ChatSystemLine.tsx +68 -0
- package/src/components/chat/ChatThreadHeader.tsx +90 -0
- package/src/components/chat/index.ts +11 -0
- package/src/components/index.ts +4 -7
- package/src/components/menu/Menu.tsx +61 -0
- package/src/components/menu/MenuActionItem.tsx +90 -0
- package/src/components/menu/MenuItem.tsx +73 -0
- package/src/components/menu/MenuNavigationItem.tsx +90 -0
- package/src/components/menu/index.ts +4 -0
- package/src/components/user-interaction/Button.tsx +101 -0
- package/src/components/{Checkbox → user-interaction}/Checkbox.tsx +38 -16
- package/src/components/user-interaction/IconButton.tsx +95 -0
- package/src/components/{Input → user-interaction}/Input.tsx +35 -14
- package/src/components/{MultiSelect → user-interaction}/MultiSelect.tsx +47 -15
- package/src/components/{Select → user-interaction}/Select.tsx +44 -12
- package/src/components/user-interaction/index.ts +6 -0
- package/src/components/{Chip → visualization-and-display}/Chip.tsx +36 -20
- package/src/components/visualization-and-display/Icon.tsx +27 -0
- package/src/components/{Chip → visualization-and-display}/index.ts +1 -0
- package/src/global-contexts/HightideContext.ts +4 -1
- package/src/global-contexts/HightideProvider.tsx +22 -10
- package/src/global-contexts/hightide-config/HightideConfigUtils.ts +15 -12
- package/src/global-contexts/localization/LocalizationProvider.tsx +4 -2
- 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 +35 -38
- 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 +38 -23
- package/src/theme/resolvers/chat.ts +418 -0
- package/src/theme/resolvers/checkbox.ts +26 -21
- package/src/theme/resolvers/chip.ts +32 -22
- package/src/theme/resolvers/coloring.ts +21 -17
- package/src/theme/resolvers/iconButton.ts +28 -18
- package/src/theme/resolvers/index.ts +2 -0
- package/src/theme/resolvers/input.ts +28 -19
- package/src/theme/resolvers/menu.ts +120 -0
- package/src/theme/resolvers/multiSelect.ts +39 -34
- package/src/theme/resolvers/select.ts +35 -30
- package/src/theme/themes/createTheme.ts +44 -15
- 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/components/checkbox.ts +33 -0
- package/src/theme/types/components/chip.ts +30 -0
- package/src/theme/types/components/hightide.ts +42 -0
- 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/components/menu.ts +57 -0
- package/src/theme/types/components/multiSelect.ts +47 -0
- package/src/theme/types/components/select.ts +47 -0
- package/src/theme/types/decoration.ts +11 -0
- package/src/theme/types/index.ts +4 -7
- package/src/theme/types/layout.ts +46 -0
- package/src/theme/types/resolver.ts +43 -1
- package/src/theme/types/theme.ts +14 -10
- package/src/theme/types/typography.ts +18 -0
- package/src/components/Button/Button.tsx +0 -101
- package/src/components/Button/index.ts +0 -1
- package/src/components/Checkbox/index.ts +0 -1
- package/src/components/IconButton/IconButton.tsx +0 -89
- 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/icons/Icon.tsx +0 -35
- package/src/icons/index.ts +0 -1
- package/src/theme/types/button.ts +0 -41
- package/src/theme/types/checkbox.ts +0 -36
- package/src/theme/types/chip.ts +0 -41
- package/src/theme/types/components.ts +0 -17
- package/src/theme/types/iconButton.ts +0 -34
- package/src/theme/types/input.ts +0 -25
- package/src/theme/types/multiSelect.ts +0 -65
- package/src/theme/types/select.ts +0 -77
|
@@ -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
|
+
}
|
package/src/theme/types/theme.ts
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
} from '
|
|
6
|
-
import type {
|
|
2
|
+
HightideColors,
|
|
3
|
+
HightideSemanticColors
|
|
4
|
+
} from '@/src/theme/types/color'
|
|
5
|
+
import type { HightideComponentThemes } from '@/src/theme/types/components/hightide'
|
|
6
|
+
import type { HightideDecoration } from '@/src/theme/types/decoration'
|
|
7
|
+
import type { HightideLayout } from '@/src/theme/types/layout'
|
|
8
|
+
import type { HightideTypography } from '@/src/theme/types/typography'
|
|
7
9
|
|
|
8
|
-
export type
|
|
9
|
-
|
|
10
|
-
semantic:
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
export type Theme = {
|
|
11
|
+
colors: Record<string, unknown> & HightideColors,
|
|
12
|
+
semantic: Record<string, unknown> & HightideSemanticColors,
|
|
13
|
+
components: Record<string, unknown> & HightideComponentThemes,
|
|
14
|
+
typography: Record<string, unknown> & HightideTypography,
|
|
15
|
+
layout: Record<string, unknown> & HightideLayout,
|
|
16
|
+
decoration: Record<string, unknown> & HightideDecoration,
|
|
13
17
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type TextStyle = {
|
|
2
|
+
fontSize: number,
|
|
3
|
+
lineHeight: number,
|
|
4
|
+
fontWeight: string,
|
|
5
|
+
fontFamily?: string,
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export type HightideTypography = {
|
|
9
|
+
fontWeights: Record<string, string>,
|
|
10
|
+
scales: {
|
|
11
|
+
headline: { large: TextStyle, medium: TextStyle, small: TextStyle },
|
|
12
|
+
title: { large: TextStyle, medium: TextStyle, small: TextStyle },
|
|
13
|
+
body: { large: TextStyle, medium: TextStyle },
|
|
14
|
+
label: { large: TextStyle, medium: TextStyle },
|
|
15
|
+
caption: { large: TextStyle, medium: TextStyle, small: TextStyle },
|
|
16
|
+
button: { large: TextStyle, medium: TextStyle, small: TextStyle },
|
|
17
|
+
},
|
|
18
|
+
}
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
coloringColors,
|
|
3
|
-
type ButtonColoringStyle,
|
|
4
|
-
type ColoringType,
|
|
5
|
-
type ElementSize
|
|
6
|
-
} from '@helpwave/hightide-design'
|
|
7
|
-
import { forwardRef, type ReactNode } from 'react'
|
|
8
|
-
import {
|
|
9
|
-
Pressable,
|
|
10
|
-
Text,
|
|
11
|
-
type PressableProps,
|
|
12
|
-
type StyleProp,
|
|
13
|
-
type TextStyle,
|
|
14
|
-
type ViewStyle
|
|
15
|
-
} from 'react-native'
|
|
16
|
-
import { useTheme } from '../../global-contexts/theme'
|
|
17
|
-
import type { ButtonState, ButtonStyle, ButtonTextStyle } from '../../theme'
|
|
18
|
-
|
|
19
|
-
export type ButtonSize = ElementSize
|
|
20
|
-
|
|
21
|
-
export type ButtonColor = ColoringType
|
|
22
|
-
|
|
23
|
-
export const ButtonUtil = {
|
|
24
|
-
colors: coloringColors,
|
|
25
|
-
sizes: ['xs', 'sm', 'md', 'lg'] as const satisfies readonly ElementSize[],
|
|
26
|
-
coloringStyles: ['outline', 'solid', 'text', 'tonal', 'tonal-outline'] as const satisfies readonly ButtonColoringStyle[],
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export type ButtonProps = Omit<PressableProps, 'children' | 'style'> & {
|
|
30
|
-
size?: ButtonSize,
|
|
31
|
-
color?: ButtonColor,
|
|
32
|
-
coloringStyle?: ButtonColoringStyle,
|
|
33
|
-
children?: ReactNode,
|
|
34
|
-
style?: StyleProp<ViewStyle>,
|
|
35
|
-
buttonStyle?: StyleProp<ViewStyle> | ((style: ButtonStyle) => StyleProp<ViewStyle>),
|
|
36
|
-
textStyle?: StyleProp<TextStyle> | ((style: ButtonTextStyle) => StyleProp<TextStyle>),
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
type PressableInteraction = {
|
|
40
|
-
pressed: boolean,
|
|
41
|
-
hovered?: boolean,
|
|
42
|
-
focused?: boolean,
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export const Button = forwardRef<React.ComponentRef<typeof Pressable>, ButtonProps>(function Button({
|
|
46
|
-
children,
|
|
47
|
-
size = 'md',
|
|
48
|
-
color = 'primary',
|
|
49
|
-
coloringStyle = 'solid',
|
|
50
|
-
disabled,
|
|
51
|
-
style,
|
|
52
|
-
buttonStyle,
|
|
53
|
-
textStyle,
|
|
54
|
-
...props
|
|
55
|
-
}, ref) {
|
|
56
|
-
const { theme } = useTheme()
|
|
57
|
-
|
|
58
|
-
const resolveStyles = (interaction: PressableInteraction) => {
|
|
59
|
-
const state: ButtonState = {
|
|
60
|
-
size,
|
|
61
|
-
color,
|
|
62
|
-
coloringStyle,
|
|
63
|
-
isDisabled: !!disabled,
|
|
64
|
-
isPressed: interaction.pressed,
|
|
65
|
-
isHovered: !!interaction.hovered,
|
|
66
|
-
isFocused: !!interaction.focused,
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
const resolvedButton = theme.components.button.button(state)
|
|
70
|
-
const resolvedText = theme.components.button.text(state)
|
|
71
|
-
|
|
72
|
-
return {
|
|
73
|
-
button: typeof buttonStyle === 'function' ? buttonStyle(resolvedButton) : [resolvedButton, buttonStyle],
|
|
74
|
-
text: typeof textStyle === 'function' ? textStyle(resolvedText) : [resolvedText, textStyle],
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
return (
|
|
79
|
-
<Pressable
|
|
80
|
-
{...props}
|
|
81
|
-
ref={ref}
|
|
82
|
-
disabled={disabled}
|
|
83
|
-
style={(pressableState) => {
|
|
84
|
-
const interaction = pressableState as PressableInteraction
|
|
85
|
-
const resolved = resolveStyles(interaction)
|
|
86
|
-
|
|
87
|
-
return [resolved.button, style]
|
|
88
|
-
}}
|
|
89
|
-
>
|
|
90
|
-
{(pressableState) => {
|
|
91
|
-
const resolved = resolveStyles(pressableState as PressableInteraction)
|
|
92
|
-
|
|
93
|
-
if (typeof children === 'string' || typeof children === 'number') {
|
|
94
|
-
return <Text style={resolved.text}>{children}</Text>
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
return children
|
|
98
|
-
}}
|
|
99
|
-
</Pressable>
|
|
100
|
-
)
|
|
101
|
-
})
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Button'
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Checkbox'
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type ButtonColoringStyle,
|
|
3
|
-
type ColoringType,
|
|
4
|
-
type ElementSize
|
|
5
|
-
} from '@helpwave/hightide-design'
|
|
6
|
-
import type { LucideIcon } from 'lucide-react-native'
|
|
7
|
-
import { forwardRef, type ReactNode } from 'react'
|
|
8
|
-
import { Pressable, type PressableProps, type StyleProp, type ViewStyle } from 'react-native'
|
|
9
|
-
import { Icon } from '../../icons/Icon'
|
|
10
|
-
import { useTheme } from '../../global-contexts/theme'
|
|
11
|
-
import type { IconButtonState, IconButtonStyle } from '../../theme'
|
|
12
|
-
|
|
13
|
-
export type IconButtonSize = ElementSize
|
|
14
|
-
|
|
15
|
-
export type IconButtonProps = Omit<PressableProps, 'children' | 'style'> & {
|
|
16
|
-
size?: IconButtonSize,
|
|
17
|
-
color?: ColoringType,
|
|
18
|
-
coloringStyle?: ButtonColoringStyle,
|
|
19
|
-
icon?: LucideIcon,
|
|
20
|
-
iconSize?: ElementSize,
|
|
21
|
-
children?: ReactNode,
|
|
22
|
-
accessibilityLabel: string,
|
|
23
|
-
style?: StyleProp<ViewStyle>,
|
|
24
|
-
buttonStyle?: StyleProp<ViewStyle> | ((style: IconButtonStyle) => StyleProp<ViewStyle>),
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
type PressableInteraction = {
|
|
28
|
-
pressed: boolean,
|
|
29
|
-
hovered?: boolean,
|
|
30
|
-
focused?: boolean,
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export const IconButton = forwardRef<React.ComponentRef<typeof Pressable>, IconButtonProps>(function IconButton({
|
|
34
|
-
children,
|
|
35
|
-
icon,
|
|
36
|
-
iconSize,
|
|
37
|
-
size = 'md',
|
|
38
|
-
color = 'neutral',
|
|
39
|
-
coloringStyle = 'solid',
|
|
40
|
-
disabled,
|
|
41
|
-
accessibilityLabel,
|
|
42
|
-
style,
|
|
43
|
-
buttonStyle,
|
|
44
|
-
...props
|
|
45
|
-
}, ref) {
|
|
46
|
-
const { theme } = useTheme()
|
|
47
|
-
|
|
48
|
-
const resolveStyles = (interaction: PressableInteraction) => {
|
|
49
|
-
const state: IconButtonState = {
|
|
50
|
-
size,
|
|
51
|
-
color,
|
|
52
|
-
coloringStyle,
|
|
53
|
-
isDisabled: !!disabled,
|
|
54
|
-
isPressed: interaction.pressed,
|
|
55
|
-
isHovered: !!interaction.hovered,
|
|
56
|
-
isFocused: !!interaction.focused,
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
const resolvedButton = theme.components.iconButton.button(state)
|
|
60
|
-
const resolvedIcon = theme.components.iconButton.icon(state)
|
|
61
|
-
|
|
62
|
-
return {
|
|
63
|
-
button: typeof buttonStyle === 'function' ? buttonStyle(resolvedButton) : [resolvedButton, buttonStyle],
|
|
64
|
-
icon: resolvedIcon,
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
return (
|
|
69
|
-
<Pressable
|
|
70
|
-
{...props}
|
|
71
|
-
ref={ref}
|
|
72
|
-
disabled={disabled}
|
|
73
|
-
accessibilityRole="button"
|
|
74
|
-
accessibilityLabel={accessibilityLabel}
|
|
75
|
-
style={(pressableState) => {
|
|
76
|
-
const resolved = resolveStyles(pressableState as PressableInteraction)
|
|
77
|
-
return [resolved.button, style]
|
|
78
|
-
}}
|
|
79
|
-
>
|
|
80
|
-
{(pressableState) => {
|
|
81
|
-
const resolved = resolveStyles(pressableState as PressableInteraction)
|
|
82
|
-
if (icon) {
|
|
83
|
-
return <Icon icon={icon} size={iconSize ?? size} color={resolved.icon.color} />
|
|
84
|
-
}
|
|
85
|
-
return children
|
|
86
|
-
}}
|
|
87
|
-
</Pressable>
|
|
88
|
-
)
|
|
89
|
-
})
|
|
@@ -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'
|
package/src/icons/Icon.tsx
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { getIconSizePx, getIconStrokeWidth, type ElementSize } from '@helpwave/hightide-design'
|
|
2
|
-
import type { LucideIcon } from 'lucide-react-native'
|
|
3
|
-
|
|
4
|
-
export type IconProps = {
|
|
5
|
-
icon: LucideIcon,
|
|
6
|
-
size?: ElementSize,
|
|
7
|
-
color?: string,
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export const Icon = ({
|
|
11
|
-
icon: IconComponent,
|
|
12
|
-
size = 'md',
|
|
13
|
-
color,
|
|
14
|
-
}: IconProps) => {
|
|
15
|
-
return (
|
|
16
|
-
<IconComponent
|
|
17
|
-
size={getIconSizePx(size)}
|
|
18
|
-
strokeWidth={getIconStrokeWidth(size)}
|
|
19
|
-
color={color}
|
|
20
|
-
/>
|
|
21
|
-
)
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export const resolveIconProps = (
|
|
25
|
-
size: ElementSize = 'md',
|
|
26
|
-
color?: string
|
|
27
|
-
): {
|
|
28
|
-
size: number,
|
|
29
|
-
strokeWidth: number,
|
|
30
|
-
color?: string,
|
|
31
|
-
} => ({
|
|
32
|
-
size: getIconSizePx(size),
|
|
33
|
-
strokeWidth: getIconStrokeWidth(size),
|
|
34
|
-
color,
|
|
35
|
-
})
|
package/src/icons/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Icon'
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
ButtonColoringStyle,
|
|
3
|
-
ColorValue,
|
|
4
|
-
ColoringType,
|
|
5
|
-
ElementSize,
|
|
6
|
-
FontWeight
|
|
7
|
-
} from '@helpwave/hightide-design'
|
|
8
|
-
import type { InteractionState, ResolverFunction } from './resolver'
|
|
9
|
-
|
|
10
|
-
export type ButtonState = InteractionState & {
|
|
11
|
-
size?: ElementSize,
|
|
12
|
-
color?: ColoringType,
|
|
13
|
-
coloringStyle?: ButtonColoringStyle,
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export type ButtonStyle = {
|
|
17
|
-
flexDirection: 'row',
|
|
18
|
-
alignItems: 'center',
|
|
19
|
-
justifyContent: 'center',
|
|
20
|
-
backgroundColor: ColorValue | 'transparent',
|
|
21
|
-
borderColor?: ColorValue,
|
|
22
|
-
borderWidth: number,
|
|
23
|
-
paddingVertical: number,
|
|
24
|
-
paddingHorizontal: number,
|
|
25
|
-
gap: number,
|
|
26
|
-
minWidth: number,
|
|
27
|
-
minHeight: number,
|
|
28
|
-
borderRadius: number,
|
|
29
|
-
opacity: number,
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export type ButtonTextStyle = {
|
|
33
|
-
color: ColorValue,
|
|
34
|
-
fontSize: number,
|
|
35
|
-
fontWeight: FontWeight,
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export type ButtonTheme = {
|
|
39
|
-
button: ResolverFunction<ButtonState, ButtonStyle>,
|
|
40
|
-
text: ResolverFunction<ButtonState, ButtonTextStyle>,
|
|
41
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { ColorValue, ElementSize } from '@helpwave/hightide-design'
|
|
2
|
-
import type { InteractionState, ResolverFunction } from './resolver'
|
|
3
|
-
|
|
4
|
-
export type CheckboxSize = 'sm' | 'md' | 'lg'
|
|
5
|
-
|
|
6
|
-
export type CheckboxState = InteractionState & {
|
|
7
|
-
size?: CheckboxSize,
|
|
8
|
-
isChecked?: boolean,
|
|
9
|
-
isIndeterminate?: boolean,
|
|
10
|
-
isInvalid?: boolean,
|
|
11
|
-
isRounded?: boolean,
|
|
12
|
-
alwaysShowCheckIcon?: boolean,
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export type CheckboxStyle = {
|
|
16
|
-
width: number,
|
|
17
|
-
height: number,
|
|
18
|
-
alignItems: 'center',
|
|
19
|
-
justifyContent: 'center',
|
|
20
|
-
borderWidth: number,
|
|
21
|
-
borderColor: ColorValue,
|
|
22
|
-
borderRadius: number,
|
|
23
|
-
backgroundColor: ColorValue,
|
|
24
|
-
opacity: number,
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export type CheckboxIconStyle = {
|
|
28
|
-
color: ColorValue,
|
|
29
|
-
size: Exclude<ElementSize, 'xs'>,
|
|
30
|
-
visible: boolean,
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export type CheckboxTheme = {
|
|
34
|
-
checkbox: ResolverFunction<CheckboxState, CheckboxStyle>,
|
|
35
|
-
icon: ResolverFunction<CheckboxState, CheckboxIconStyle>,
|
|
36
|
-
}
|
package/src/theme/types/chip.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
ChipColoringStyle,
|
|
3
|
-
ColorValue,
|
|
4
|
-
ColoringType,
|
|
5
|
-
ElementSize,
|
|
6
|
-
FontWeight
|
|
7
|
-
} from '@helpwave/hightide-design'
|
|
8
|
-
import type { InteractionState, ResolverFunction } from './resolver'
|
|
9
|
-
|
|
10
|
-
export type ChipState = InteractionState & {
|
|
11
|
-
size?: ElementSize,
|
|
12
|
-
color?: ColoringType,
|
|
13
|
-
coloringStyle?: ChipColoringStyle,
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export type ChipStyle = {
|
|
17
|
-
flexDirection: 'row',
|
|
18
|
-
alignItems: 'center',
|
|
19
|
-
justifyContent: 'center',
|
|
20
|
-
alignSelf: 'flex-start',
|
|
21
|
-
backgroundColor: ColorValue | 'transparent',
|
|
22
|
-
borderColor?: ColorValue,
|
|
23
|
-
borderWidth: number,
|
|
24
|
-
paddingVertical: number,
|
|
25
|
-
paddingHorizontal: number,
|
|
26
|
-
gap: number,
|
|
27
|
-
minHeight: number,
|
|
28
|
-
borderRadius: number,
|
|
29
|
-
opacity: number,
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export type ChipTextStyle = {
|
|
33
|
-
color: ColorValue,
|
|
34
|
-
fontSize: number,
|
|
35
|
-
fontWeight: FontWeight,
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export type ChipTheme = {
|
|
39
|
-
chip: ResolverFunction<ChipState, ChipStyle>,
|
|
40
|
-
text: ResolverFunction<ChipState, ChipTextStyle>,
|
|
41
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { ButtonTheme } from './button'
|
|
2
|
-
import type { CheckboxTheme } from './checkbox'
|
|
3
|
-
import type { ChipTheme } from './chip'
|
|
4
|
-
import type { IconButtonTheme } from './iconButton'
|
|
5
|
-
import type { InputTheme } from './input'
|
|
6
|
-
import type { MultiSelectTheme } from './multiSelect'
|
|
7
|
-
import type { SelectTheme } from './select'
|
|
8
|
-
|
|
9
|
-
export type ComponentThemes = {
|
|
10
|
-
button: ButtonTheme,
|
|
11
|
-
iconButton: IconButtonTheme,
|
|
12
|
-
chip: ChipTheme,
|
|
13
|
-
checkbox: CheckboxTheme,
|
|
14
|
-
input: InputTheme,
|
|
15
|
-
select: SelectTheme,
|
|
16
|
-
multiSelect: MultiSelectTheme,
|
|
17
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
ButtonColoringStyle,
|
|
3
|
-
ColorValue,
|
|
4
|
-
ColoringType,
|
|
5
|
-
ElementSize
|
|
6
|
-
} from '@helpwave/hightide-design'
|
|
7
|
-
import type { InteractionState, ResolverFunction } from './resolver'
|
|
8
|
-
|
|
9
|
-
export type IconButtonState = InteractionState & {
|
|
10
|
-
size?: ElementSize,
|
|
11
|
-
color?: ColoringType,
|
|
12
|
-
coloringStyle?: ButtonColoringStyle,
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export type IconButtonStyle = {
|
|
16
|
-
alignItems: 'center',
|
|
17
|
-
justifyContent: 'center',
|
|
18
|
-
backgroundColor: ColorValue | 'transparent',
|
|
19
|
-
borderColor?: ColorValue,
|
|
20
|
-
borderWidth: number,
|
|
21
|
-
width: number,
|
|
22
|
-
height: number,
|
|
23
|
-
borderRadius: number,
|
|
24
|
-
opacity: number,
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export type IconButtonIconStyle = {
|
|
28
|
-
color: ColorValue,
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export type IconButtonTheme = {
|
|
32
|
-
button: ResolverFunction<IconButtonState, IconButtonStyle>,
|
|
33
|
-
icon: ResolverFunction<IconButtonState, IconButtonIconStyle>,
|
|
34
|
-
}
|
package/src/theme/types/input.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { ColorValue } from '@helpwave/hightide-design'
|
|
2
|
-
import type { InteractionState, ResolverFunction } from './resolver'
|
|
3
|
-
|
|
4
|
-
export type InputState = InteractionState & {
|
|
5
|
-
isInvalid?: boolean,
|
|
6
|
-
isReadOnly?: boolean,
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export type InputStyle = {
|
|
10
|
-
minHeight: number,
|
|
11
|
-
paddingHorizontal: number,
|
|
12
|
-
paddingVertical: number,
|
|
13
|
-
borderRadius: number,
|
|
14
|
-
borderWidth: number,
|
|
15
|
-
borderColor: ColorValue,
|
|
16
|
-
backgroundColor: ColorValue,
|
|
17
|
-
color: ColorValue,
|
|
18
|
-
fontSize: number,
|
|
19
|
-
opacity: number,
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export type InputTheme = {
|
|
23
|
-
input: ResolverFunction<InputState, InputStyle>,
|
|
24
|
-
placeholderColor: ResolverFunction<InputState, ColorValue>,
|
|
25
|
-
}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import type { ColorValue, FontWeight } from '@helpwave/hightide-design'
|
|
2
|
-
import type { ResolverFunction } from './resolver'
|
|
3
|
-
import type {
|
|
4
|
-
SelectMenuStyle,
|
|
5
|
-
SelectOptionState,
|
|
6
|
-
SelectOverlayStyle,
|
|
7
|
-
SelectSearchStyle,
|
|
8
|
-
SelectState,
|
|
9
|
-
SelectTriggerStyle,
|
|
10
|
-
SelectTriggerTextStyle
|
|
11
|
-
} from './select'
|
|
12
|
-
|
|
13
|
-
export type MultiSelectState = SelectState & {
|
|
14
|
-
hasSelections?: boolean,
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export type MultiSelectOptionState = SelectOptionState
|
|
18
|
-
|
|
19
|
-
export type MultiSelectTriggerStyle = SelectTriggerStyle & {
|
|
20
|
-
gap: number,
|
|
21
|
-
}
|
|
22
|
-
|
|
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
|
-
}
|
|
32
|
-
|
|
33
|
-
export type MultiSelectOptionTextStyle = {
|
|
34
|
-
color: ColorValue,
|
|
35
|
-
fontWeight: FontWeight,
|
|
36
|
-
}
|
|
37
|
-
|
|
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
|
-
}
|
|
48
|
-
|
|
49
|
-
export type MultiSelectCheckboxIconStyle = {
|
|
50
|
-
color: ColorValue,
|
|
51
|
-
visible: boolean,
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export type MultiSelectTheme = {
|
|
55
|
-
trigger: ResolverFunction<MultiSelectState, MultiSelectTriggerStyle>,
|
|
56
|
-
triggerText: ResolverFunction<MultiSelectState, SelectTriggerTextStyle>,
|
|
57
|
-
overlay: ResolverFunction<MultiSelectState, SelectOverlayStyle>,
|
|
58
|
-
menu: ResolverFunction<MultiSelectState, SelectMenuStyle>,
|
|
59
|
-
search: ResolverFunction<MultiSelectState, SelectSearchStyle>,
|
|
60
|
-
searchPlaceholderColor: ResolverFunction<MultiSelectState, ColorValue>,
|
|
61
|
-
option: ResolverFunction<MultiSelectOptionState, MultiSelectOptionStyle>,
|
|
62
|
-
optionText: ResolverFunction<MultiSelectOptionState, MultiSelectOptionTextStyle>,
|
|
63
|
-
checkbox: ResolverFunction<MultiSelectOptionState, MultiSelectCheckboxStyle>,
|
|
64
|
-
checkboxIcon: ResolverFunction<MultiSelectOptionState, MultiSelectCheckboxIconStyle>,
|
|
65
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import type { ColorValue, FontWeight } from '@helpwave/hightide-design'
|
|
2
|
-
import type { InteractionState, ResolverFunction } from './resolver'
|
|
3
|
-
|
|
4
|
-
export type SelectState = InteractionState & {
|
|
5
|
-
isInvalid?: boolean,
|
|
6
|
-
isReadOnly?: boolean,
|
|
7
|
-
isOpen?: boolean,
|
|
8
|
-
hasValue?: boolean,
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export type SelectOptionState = InteractionState & {
|
|
12
|
-
isSelected?: boolean,
|
|
13
|
-
isHighlighted?: boolean,
|
|
14
|
-
}
|
|
15
|
-
|
|
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
|
-
}
|
|
27
|
-
|
|
28
|
-
export type SelectTriggerTextStyle = {
|
|
29
|
-
color: ColorValue,
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export type SelectOverlayStyle = {
|
|
33
|
-
flex: 1,
|
|
34
|
-
backgroundColor: ColorValue,
|
|
35
|
-
justifyContent: 'center',
|
|
36
|
-
padding: number,
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export type SelectMenuStyle = {
|
|
40
|
-
maxHeight: number,
|
|
41
|
-
borderRadius: number,
|
|
42
|
-
backgroundColor: ColorValue,
|
|
43
|
-
borderWidth: number,
|
|
44
|
-
borderColor: ColorValue,
|
|
45
|
-
overflow: 'hidden',
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export type SelectSearchStyle = {
|
|
49
|
-
paddingHorizontal: number,
|
|
50
|
-
paddingVertical: number,
|
|
51
|
-
borderBottomWidth: number,
|
|
52
|
-
borderBottomColor: ColorValue,
|
|
53
|
-
color: ColorValue,
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export type SelectOptionStyle = {
|
|
57
|
-
paddingHorizontal: number,
|
|
58
|
-
paddingVertical: number,
|
|
59
|
-
backgroundColor: ColorValue | 'transparent',
|
|
60
|
-
opacity: number,
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export type SelectOptionTextStyle = {
|
|
64
|
-
color: ColorValue,
|
|
65
|
-
fontWeight: FontWeight,
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export type SelectTheme = {
|
|
69
|
-
trigger: ResolverFunction<SelectState, SelectTriggerStyle>,
|
|
70
|
-
triggerText: ResolverFunction<SelectState, SelectTriggerTextStyle>,
|
|
71
|
-
overlay: ResolverFunction<SelectState, SelectOverlayStyle>,
|
|
72
|
-
menu: ResolverFunction<SelectState, SelectMenuStyle>,
|
|
73
|
-
search: ResolverFunction<SelectState, SelectSearchStyle>,
|
|
74
|
-
searchPlaceholderColor: ResolverFunction<SelectState, ColorValue>,
|
|
75
|
-
option: ResolverFunction<SelectOptionState, SelectOptionStyle>,
|
|
76
|
-
optionText: ResolverFunction<SelectOptionState, SelectOptionTextStyle>,
|
|
77
|
-
}
|