@itcase/ui-react-native 1.10.86 → 1.10.87
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 +2 -2
- package/src/components/Avatar/Avatar.interface.ts +4 -3
- package/src/components/Badge/Badge.interface.ts +4 -4
- package/src/components/Button/Button.interface.ts +3 -3
- package/src/components/Button/Button.tsx +1 -7
- package/src/components/Button/stories/ButtonDefault.stories.tsx +2 -2
- package/src/components/Button/stories/ButtonGallery.stories.tsx +1 -1
- package/src/components/Button/stories/ButtonIcon.stories.tsx +1 -1
- package/src/components/Checkbox/Checkbox.interface.ts +22 -23
- package/src/components/Checkmark/Checkmark.tsx +1 -1
- package/src/components/Chips/Chips.interface.ts +7 -6
- package/src/components/Choice/Choice.interface.ts +22 -22
- package/src/components/Choice/Choice.tsx +1 -13
- package/src/components/Code/Code.interface.ts +13 -13
- package/src/components/Code/Code.tsx +1 -12
- package/src/components/ColorInput/ColorInput.interface.ts +8 -9
- package/src/components/DatePicker/DatePicker.interface.ts +3 -1
- package/src/components/Divider/Divider.interface.ts +3 -2
- package/src/components/Drawer/Drawer.interface.ts +2 -1
- package/src/components/Dropdown/Dropdown.interface.ts +4 -4
- package/src/components/HeroTitle/HeroTitle.interface.ts +2 -2
- package/src/components/Icon/Icon.interface.ts +2 -2
- package/src/components/Input/Input.interface.ts +13 -13
- package/src/components/Input/Input.tsx +3 -11
- package/src/components/InputNumber/InputNumber.interface.ts +18 -20
- package/src/components/InputNumber/InputNumber.tsx +3 -11
- package/src/components/InputPassword/InputPassword.interface.ts +21 -22
- package/src/components/InputPassword/InputPassword.tsx +3 -11
- package/src/components/Label/Label.interface.ts +3 -3
- package/src/components/Label/Label.tsx +0 -1
- package/src/components/Link/Link.interface.ts +6 -5
- package/src/components/Link/Link.tsx +3 -7
- package/src/components/Link/stories/Link.stories.tsx +1 -1
- package/src/components/List/List.interface.ts +3 -2
- package/src/components/Loader/Loader.interface.ts +3 -3
- package/src/components/Loader/Loader.tsx +1 -13
- package/src/components/MenuItem/MenuItem.interface.ts +5 -4
- package/src/components/Pagination/Pagination.tsx +5 -4
- package/src/components/Pressable/Pressable.interface.ts +2 -2
- package/src/components/Pressable/stories/PressableGallery.stories.tsx +1 -1
- package/src/components/Radio/Radio.interface.ts +15 -15
- package/src/components/Search/Search.tsx +10 -3
- package/src/components/Segmented/Segmented.interface.ts +2 -2
- package/src/components/Select/Select.interface.ts +5 -4
- package/src/components/Switch/Switch.interface.ts +10 -10
- package/src/components/Switch/Switch.tsx +2 -19
- package/src/components/Textarea/Textarea.interface.ts +16 -17
- package/src/components/Textarea/Textarea.tsx +3 -11
- package/src/components/Tile/Tile.interface.ts +4 -3
- package/src/components/Tile/stories/TileSwap.stories.tsx +3 -9
- package/src/components/Tooltip/Tooltip.interface.ts +2 -3
- package/src/components/Warning/Warning.interface.ts +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itcase/ui-react-native",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.87",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "src/index.tsx",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"typescript": "npm:@typescript/typescript6@^6.0.2",
|
|
61
61
|
"vite": "^8.2.2"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "4cd806876975ef1dce5942b06b865b7a7cdc81cb"
|
|
64
64
|
}
|
|
@@ -44,7 +44,7 @@ interface AvatarAppearanceProps {
|
|
|
44
44
|
borderColor?: BorderColorProps
|
|
45
45
|
fill?: FillProps
|
|
46
46
|
icon?: SvgIconComponent
|
|
47
|
-
iconAppearance?:
|
|
47
|
+
iconAppearance?: IconProps['appearance']
|
|
48
48
|
iconFill?: IconProps['fill']
|
|
49
49
|
iconFillSize?: IconProps['fillSize']
|
|
50
50
|
iconItemFill?: IconProps['iconFill']
|
|
@@ -75,13 +75,12 @@ type AvatarAppearanceSize = AppearancePartialRecord<
|
|
|
75
75
|
AvatarAppearanceProps,
|
|
76
76
|
'badgeAppearanceSize' | 'iconFillSize' | 'size' | 'textSize'
|
|
77
77
|
>
|
|
78
|
-
type AvatarAppearanceKey = AppearanceKeysPx | CompositeAppearancePxKeys
|
|
79
78
|
|
|
80
79
|
interface AvatarProps extends AvatarAppearanceProps {
|
|
81
80
|
isSkeleton?: boolean
|
|
82
81
|
onPress?: (event: GestureResponderEvent) => void
|
|
83
82
|
after?: ReactNode
|
|
84
|
-
appearance?:
|
|
83
|
+
appearance?: CompositeAppearancePxKeys
|
|
85
84
|
before?: ReactNode
|
|
86
85
|
charsTextColor?: TextColorProps
|
|
87
86
|
charsTextSize?: TextSizeProps
|
|
@@ -95,6 +94,8 @@ interface AvatarProps extends AvatarAppearanceProps {
|
|
|
95
94
|
style?: StyleProp<ViewStyle>
|
|
96
95
|
}
|
|
97
96
|
|
|
97
|
+
type AvatarAppearanceKey = NonNullable<AvatarProps['appearance']>
|
|
98
|
+
|
|
98
99
|
type AvatarGalleryStory = ComponentGalleryArgs &
|
|
99
100
|
Pick<
|
|
100
101
|
AvatarProps,
|
|
@@ -32,7 +32,7 @@ interface BadgeAppearanceProps {
|
|
|
32
32
|
borderColor?: BorderColorProps
|
|
33
33
|
dotFill?: IconProps['iconFill']
|
|
34
34
|
fill?: FillProps
|
|
35
|
-
iconAppearance?:
|
|
35
|
+
iconAppearance?: IconProps['appearance']
|
|
36
36
|
iconFill?: IconProps['iconFill']
|
|
37
37
|
iconShape?: IconProps['shape']
|
|
38
38
|
iconSize?: IconProps['iconSize']
|
|
@@ -55,10 +55,8 @@ type BadgeAppearanceSize = AppearancePartialRecord<
|
|
|
55
55
|
BadgeAppearanceProps,
|
|
56
56
|
'badgeTextSize' | 'iconSize' | 'size'
|
|
57
57
|
>
|
|
58
|
-
type BadgeAppearanceKey = AppearanceKeysDefault | CompositeAppearanceKeys
|
|
59
|
-
|
|
60
58
|
interface BadgeProps extends BadgeAppearanceProps {
|
|
61
|
-
appearance?:
|
|
59
|
+
appearance?: CompositeAppearanceKeys
|
|
62
60
|
dot?: boolean
|
|
63
61
|
icon?: BadgeIconProp
|
|
64
62
|
shape?: badgeShapePropsType
|
|
@@ -67,6 +65,8 @@ interface BadgeProps extends BadgeAppearanceProps {
|
|
|
67
65
|
type?: badgeTypePropsType
|
|
68
66
|
}
|
|
69
67
|
|
|
68
|
+
type BadgeAppearanceKey = NonNullable<BadgeProps['appearance']>
|
|
69
|
+
|
|
70
70
|
type BadgeGalleryStory = ComponentGalleryArgs &
|
|
71
71
|
Pick<BadgeProps, 'dot' | 'text'> & {
|
|
72
72
|
icon?: boolean
|
|
@@ -53,7 +53,6 @@ interface ButtonAppearanceProps {
|
|
|
53
53
|
textSize?: TextSizeProps
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
type ButtonAppearanceKey = AppearanceKeysDefault | CompositeAppearanceKeys
|
|
57
56
|
type ButtonConfig = AppearanceConfig<
|
|
58
57
|
AppearanceKeysDefault,
|
|
59
58
|
ButtonAppearanceProps
|
|
@@ -81,8 +80,7 @@ interface ButtonProps extends ButtonAppearanceProps {
|
|
|
81
80
|
onPressIn?: (event: GestureResponderEvent) => void
|
|
82
81
|
onPressOut?: (event: GestureResponderEvent) => void
|
|
83
82
|
after?: ReactNode
|
|
84
|
-
appearance?:
|
|
85
|
-
appearanceStyle?: AppearanceStyleKey
|
|
83
|
+
appearance?: CompositeAppearanceKeys
|
|
86
84
|
before?: ReactNode
|
|
87
85
|
label?: string
|
|
88
86
|
loader?: ReactNode
|
|
@@ -93,6 +91,8 @@ interface ButtonProps extends ButtonAppearanceProps {
|
|
|
93
91
|
width?: WidthProps
|
|
94
92
|
}
|
|
95
93
|
|
|
94
|
+
type ButtonAppearanceKey = NonNullable<ButtonProps['appearance']>
|
|
95
|
+
|
|
96
96
|
type ButtonGalleryStory = ComponentGalleryArgs &
|
|
97
97
|
Pick<ButtonProps, 'isDisabled' | 'isLoading' | 'label'>
|
|
98
98
|
|
|
@@ -5,7 +5,6 @@ import {
|
|
|
5
5
|
useAppearanceConfig,
|
|
6
6
|
useDevicePropsGenerator,
|
|
7
7
|
} from '@itcase/ui-core/hooks'
|
|
8
|
-
import { mergeAppearanceKeys } from '@itcase/ui-core/utils'
|
|
9
8
|
|
|
10
9
|
import { tokens } from '../../styles/tokens'
|
|
11
10
|
import { Loader } from '../Loader'
|
|
@@ -31,7 +30,6 @@ const Button = React.forwardRef<
|
|
|
31
30
|
appearance = 'accentPrimary sizeXXL solid rounded',
|
|
32
31
|
width,
|
|
33
32
|
label,
|
|
34
|
-
appearanceStyle,
|
|
35
33
|
loader,
|
|
36
34
|
loaderColor,
|
|
37
35
|
style,
|
|
@@ -45,12 +43,8 @@ const Button = React.forwardRef<
|
|
|
45
43
|
onPressOut,
|
|
46
44
|
} = props
|
|
47
45
|
|
|
48
|
-
const resolvedAppearance = appearanceStyle
|
|
49
|
-
? mergeAppearanceKeys(appearance, appearanceStyle)
|
|
50
|
-
: appearance
|
|
51
|
-
|
|
52
46
|
const appearanceConfig = useAppearanceConfig(
|
|
53
|
-
|
|
47
|
+
appearance,
|
|
54
48
|
buttonConfig,
|
|
55
49
|
isDisabled,
|
|
56
50
|
)
|
|
@@ -19,13 +19,13 @@ const meta = {
|
|
|
19
19
|
label: 'Button',
|
|
20
20
|
before: (
|
|
21
21
|
<Icon
|
|
22
|
-
appearance="surfacePrimary size24_24 ghost"
|
|
22
|
+
appearance="surfacePrimary size24_24 ghost rounded"
|
|
23
23
|
SVGIcon={icons24.Placeholder.Default}
|
|
24
24
|
/>
|
|
25
25
|
),
|
|
26
26
|
after: (
|
|
27
27
|
<Icon
|
|
28
|
-
appearance="surfacePrimary size24_24 ghost"
|
|
28
|
+
appearance="surfacePrimary size24_24 ghost rounded"
|
|
29
29
|
SVGIcon={icons24.Placeholder.Default}
|
|
30
30
|
/>
|
|
31
31
|
),
|
|
@@ -49,27 +49,6 @@ interface CheckboxAppearanceProps {
|
|
|
49
49
|
size?: checkboxSizePropsType
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
type CheckboxAppearanceKey =
|
|
53
|
-
AppearanceKeysState | CompositeAppearanceStateDefault
|
|
54
|
-
type CheckboxConfig = AppearanceConfig<
|
|
55
|
-
AppearanceKeysState,
|
|
56
|
-
CheckboxAppearanceProps
|
|
57
|
-
>
|
|
58
|
-
type CheckboxAppearance = CheckboxConfig['appearance']
|
|
59
|
-
type CheckboxAppearanceStyle = AppearanceRecord<
|
|
60
|
-
AppearanceStyleKey,
|
|
61
|
-
CheckboxAppearanceProps,
|
|
62
|
-
| 'borderColorCheckbox'
|
|
63
|
-
| 'borderColorCheckboxActive'
|
|
64
|
-
| 'fill'
|
|
65
|
-
| 'fillCheckbox'
|
|
66
|
-
| 'fillCheckboxActive'
|
|
67
|
-
>
|
|
68
|
-
type CheckboxAppearanceShape = AppearancePartialRecord<
|
|
69
|
-
AppearanceShapeKey,
|
|
70
|
-
CheckboxAppearanceProps,
|
|
71
|
-
'shape'
|
|
72
|
-
>
|
|
73
52
|
type CheckboxAppearanceSize = AppearancePartialRecord<
|
|
74
53
|
AppearanceSizeKey,
|
|
75
54
|
CheckboxAppearanceProps,
|
|
@@ -87,8 +66,7 @@ interface CheckboxProps extends CheckboxAppearanceProps {
|
|
|
87
66
|
onPress?: (event: GestureResponderEvent) => void
|
|
88
67
|
after?: ReactNode
|
|
89
68
|
align?: checkboxAlignPropsType
|
|
90
|
-
appearance?:
|
|
91
|
-
appearanceStyle?: AppearanceStyleKey
|
|
69
|
+
appearance?: CompositeAppearanceStateDefault
|
|
92
70
|
before?: ReactNode
|
|
93
71
|
checked?: boolean
|
|
94
72
|
desc?: string
|
|
@@ -99,6 +77,27 @@ interface CheckboxProps extends CheckboxAppearanceProps {
|
|
|
99
77
|
width?: WidthProps
|
|
100
78
|
}
|
|
101
79
|
|
|
80
|
+
type CheckboxConfig = AppearanceConfig<
|
|
81
|
+
AppearanceKeysState,
|
|
82
|
+
CheckboxAppearanceProps
|
|
83
|
+
>
|
|
84
|
+
type CheckboxAppearance = CheckboxConfig['appearance']
|
|
85
|
+
type CheckboxAppearanceStyle = AppearanceRecord<
|
|
86
|
+
AppearanceStyleKey,
|
|
87
|
+
CheckboxAppearanceProps,
|
|
88
|
+
| 'borderColorCheckbox'
|
|
89
|
+
| 'borderColorCheckboxActive'
|
|
90
|
+
| 'fill'
|
|
91
|
+
| 'fillCheckbox'
|
|
92
|
+
| 'fillCheckboxActive'
|
|
93
|
+
>
|
|
94
|
+
type CheckboxAppearanceShape = AppearancePartialRecord<
|
|
95
|
+
AppearanceShapeKey,
|
|
96
|
+
CheckboxAppearanceProps,
|
|
97
|
+
'shape'
|
|
98
|
+
>
|
|
99
|
+
type CheckboxAppearanceKey = NonNullable<CheckboxProps['appearance']>
|
|
100
|
+
|
|
102
101
|
type CheckboxGalleryStory = ComponentGalleryArgs &
|
|
103
102
|
Pick<
|
|
104
103
|
CheckboxProps,
|
|
@@ -103,7 +103,7 @@ function Checkmark(props: CheckmarkProps) {
|
|
|
103
103
|
style={[styles.checkmark__icon, iconAnimatedStyle]}
|
|
104
104
|
>
|
|
105
105
|
<Icon
|
|
106
|
-
appearance="ghost"
|
|
106
|
+
appearance="surfacePrimary size24_24 ghost rounded"
|
|
107
107
|
fill={checkmarkFill}
|
|
108
108
|
iconFill={checkmarkIconFill}
|
|
109
109
|
iconSize={checkmarkIconSize}
|
|
@@ -37,8 +37,8 @@ interface ChipsAppearanceProps {
|
|
|
37
37
|
fillActive?: FillActiveProps
|
|
38
38
|
iconAfter?: SvgIconComponent
|
|
39
39
|
iconAfterActive?: SvgIconComponent
|
|
40
|
-
iconAfterAppearance?:
|
|
41
|
-
iconAfterAppearanceActive?:
|
|
40
|
+
iconAfterAppearance?: IconProps['appearance']
|
|
41
|
+
iconAfterAppearanceActive?: IconProps['appearance']
|
|
42
42
|
iconAfterFill?: IconProps['fill']
|
|
43
43
|
iconAfterFillActiveIcon?: IconProps['iconFill']
|
|
44
44
|
iconAfterFillIcon?: IconProps['iconFill']
|
|
@@ -46,8 +46,8 @@ interface ChipsAppearanceProps {
|
|
|
46
46
|
iconAfterSize?: IconProps['size']
|
|
47
47
|
iconBefore?: SvgIconComponent
|
|
48
48
|
iconBeforeActive?: SvgIconComponent
|
|
49
|
-
iconBeforeAppearance?:
|
|
50
|
-
iconBeforeAppearanceActive?:
|
|
49
|
+
iconBeforeAppearance?: IconProps['appearance']
|
|
50
|
+
iconBeforeAppearanceActive?: IconProps['appearance']
|
|
51
51
|
iconBeforeFill?: IconProps['fill']
|
|
52
52
|
iconBeforeFillActiveIcon?: IconProps['iconFill']
|
|
53
53
|
iconBeforeFillIcon?: IconProps['iconFill']
|
|
@@ -79,7 +79,6 @@ type ChipsAppearanceSize = AppearancePartialRecord<
|
|
|
79
79
|
'iconAfterSize' | 'iconBeforeSize' | 'labelTextSize' | 'size'
|
|
80
80
|
>
|
|
81
81
|
>
|
|
82
|
-
type ChipsAppearanceKey = AppearanceKeysDefault | CompositeAppearanceKeys
|
|
83
82
|
|
|
84
83
|
interface ChipsProps extends ChipsAppearanceProps {
|
|
85
84
|
isActive?: boolean
|
|
@@ -87,7 +86,7 @@ interface ChipsProps extends ChipsAppearanceProps {
|
|
|
87
86
|
onPress?: (event: GestureResponderEvent) => void
|
|
88
87
|
onPressIconAfter?: (event: GestureResponderEvent) => void
|
|
89
88
|
onPressIconBefore?: (event: GestureResponderEvent) => void
|
|
90
|
-
appearance?:
|
|
89
|
+
appearance?: CompositeAppearanceKeys
|
|
91
90
|
children?: ReactNode
|
|
92
91
|
label?: string
|
|
93
92
|
shape?: chipsShapePropsType
|
|
@@ -95,6 +94,8 @@ interface ChipsProps extends ChipsAppearanceProps {
|
|
|
95
94
|
style?: StyleProp<ViewStyle>
|
|
96
95
|
}
|
|
97
96
|
|
|
97
|
+
type ChipsAppearanceKey = NonNullable<ChipsProps['appearance']>
|
|
98
|
+
|
|
98
99
|
type ChipsGalleryStory = {
|
|
99
100
|
appearance: string
|
|
100
101
|
iconAfter?: boolean
|
|
@@ -23,7 +23,7 @@ import type {
|
|
|
23
23
|
} from '@itcase/types-ui'
|
|
24
24
|
|
|
25
25
|
import type { ComponentGalleryArgs } from '../../storybook'
|
|
26
|
-
import type { SvgIconComponent } from '../Icon/Icon.interface'
|
|
26
|
+
import type { IconProps, SvgIconComponent } from '../Icon/Icon.interface'
|
|
27
27
|
import type { iconSizePropsType } from '../Icon/styles/iconSize'
|
|
28
28
|
import type { choiceSizePropsType } from './styles/choiceSize'
|
|
29
29
|
|
|
@@ -34,16 +34,16 @@ interface ChoiceAppearanceProps {
|
|
|
34
34
|
fillItemActive?: FillActiveProps
|
|
35
35
|
fillItemActiveDisabled?: FillDisabledProps
|
|
36
36
|
fillItemDisabled?: FillDisabledProps
|
|
37
|
-
iconAfterAppearance?:
|
|
38
|
-
iconAfterAppearanceActive?:
|
|
37
|
+
iconAfterAppearance?: IconProps['appearance']
|
|
38
|
+
iconAfterAppearanceActive?: IconProps['appearance']
|
|
39
39
|
iconAfterFill?: ItemFillActiveProps
|
|
40
40
|
iconAfterFillActive?: ItemFillActiveProps
|
|
41
41
|
iconAfterFillDisabled?: ItemFillActiveProps
|
|
42
42
|
iconAfterSize?: iconSizePropsType
|
|
43
|
-
iconAppearance?:
|
|
44
|
-
iconAppearanceActive?:
|
|
45
|
-
iconBeforeAppearance?:
|
|
46
|
-
iconBeforeAppearanceActive?:
|
|
43
|
+
iconAppearance?: IconProps['appearance']
|
|
44
|
+
iconAppearanceActive?: IconProps['appearance']
|
|
45
|
+
iconBeforeAppearance?: IconProps['appearance']
|
|
46
|
+
iconBeforeAppearanceActive?: IconProps['appearance']
|
|
47
47
|
iconBeforeFill?: ItemFillActiveProps
|
|
48
48
|
iconBeforeFillActive?: ItemFillActiveProps
|
|
49
49
|
iconBeforeFillDisabled?: ItemFillActiveProps
|
|
@@ -77,19 +77,6 @@ interface ChoiceActive {
|
|
|
77
77
|
value: ReactNode
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
type ChoiceAppearanceKey = AppearanceKeysState | CompositeAppearanceStateDefault
|
|
81
|
-
type ChoiceConfig = AppearanceConfig<AppearanceKeysState, ChoiceAppearanceProps>
|
|
82
|
-
type ChoiceAppearance = ChoiceConfig['appearance']
|
|
83
|
-
type ChoiceAppearanceStyle = AppearanceRecord<
|
|
84
|
-
AppearanceStyleKey,
|
|
85
|
-
ChoiceAppearanceProps,
|
|
86
|
-
'borderColor' | 'fill'
|
|
87
|
-
>
|
|
88
|
-
type ChoiceAppearanceShape = AppearancePartialRecord<
|
|
89
|
-
AppearanceShapeKey,
|
|
90
|
-
ChoiceAppearanceProps,
|
|
91
|
-
'shape'
|
|
92
|
-
>
|
|
93
80
|
type ChoiceAppearanceSize = AppearancePartialRecord<
|
|
94
81
|
AppearanceSizeKey,
|
|
95
82
|
ChoiceAppearanceProps,
|
|
@@ -103,8 +90,7 @@ interface ChoiceProps extends ChoiceAppearanceProps {
|
|
|
103
90
|
setActiveSegment?: (item: ChoiceOptionsItem, isChecked?: boolean) => void
|
|
104
91
|
active: ChoiceActive
|
|
105
92
|
after?: ReactNode
|
|
106
|
-
appearance?:
|
|
107
|
-
appearanceStyle?: AppearanceStyleKey
|
|
93
|
+
appearance?: CompositeAppearanceStateDefault
|
|
108
94
|
before?: ReactNode
|
|
109
95
|
dataTestId?: string
|
|
110
96
|
itemAfter?: ReactNode
|
|
@@ -113,6 +99,20 @@ interface ChoiceProps extends ChoiceAppearanceProps {
|
|
|
113
99
|
style?: StyleProp<ViewStyle>
|
|
114
100
|
}
|
|
115
101
|
|
|
102
|
+
type ChoiceConfig = AppearanceConfig<AppearanceKeysState, ChoiceAppearanceProps>
|
|
103
|
+
type ChoiceAppearance = ChoiceConfig['appearance']
|
|
104
|
+
type ChoiceAppearanceStyle = AppearanceRecord<
|
|
105
|
+
AppearanceStyleKey,
|
|
106
|
+
ChoiceAppearanceProps,
|
|
107
|
+
'borderColor' | 'fill'
|
|
108
|
+
>
|
|
109
|
+
type ChoiceAppearanceShape = AppearancePartialRecord<
|
|
110
|
+
AppearanceShapeKey,
|
|
111
|
+
ChoiceAppearanceProps,
|
|
112
|
+
'shape'
|
|
113
|
+
>
|
|
114
|
+
type ChoiceAppearanceKey = NonNullable<ChoiceProps['appearance']>
|
|
115
|
+
|
|
116
116
|
type ChoiceStoryArgs = Omit<ChoiceProps, 'appearance'> & {
|
|
117
117
|
appearanceShape: string
|
|
118
118
|
appearanceSize: string
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { useMemo } from 'react'
|
|
2
1
|
import { Pressable, View } from 'react-native'
|
|
3
2
|
|
|
4
3
|
import {
|
|
5
4
|
useAppearanceConfig,
|
|
6
5
|
useDevicePropsGenerator,
|
|
7
6
|
} from '@itcase/ui-core/hooks'
|
|
8
|
-
import { mergeAppearanceKeys } from '@itcase/ui-core/utils'
|
|
9
7
|
|
|
10
8
|
import { tokens } from '../../styles/tokens'
|
|
11
9
|
import { Icon } from '../Icon'
|
|
@@ -34,7 +32,6 @@ function Choice(props: ChoiceProps) {
|
|
|
34
32
|
appearance = 'defaultPrimary sizeL solid rounded',
|
|
35
33
|
dataTestId,
|
|
36
34
|
active,
|
|
37
|
-
appearanceStyle,
|
|
38
35
|
itemAfter,
|
|
39
36
|
itemBefore,
|
|
40
37
|
options = [],
|
|
@@ -47,17 +44,8 @@ function Choice(props: ChoiceProps) {
|
|
|
47
44
|
setActiveSegment,
|
|
48
45
|
} = props
|
|
49
46
|
|
|
50
|
-
const resolvedAppearance = useMemo(() => {
|
|
51
|
-
const appearanceTokens = appearance.split(' ')
|
|
52
|
-
const isCompositeAppearance = appearanceTokens.length > 1
|
|
53
|
-
|
|
54
|
-
return isCompositeAppearance
|
|
55
|
-
? appearance
|
|
56
|
-
: mergeAppearanceKeys(appearance, appearanceStyle || 'solid')
|
|
57
|
-
}, [appearance, appearanceStyle])
|
|
58
|
-
|
|
59
47
|
const appearanceConfig = useAppearanceConfig(
|
|
60
|
-
|
|
48
|
+
appearance,
|
|
61
49
|
choiceConfig,
|
|
62
50
|
isDisabled,
|
|
63
51
|
)
|
|
@@ -37,17 +37,6 @@ interface CodeAppearanceProps {
|
|
|
37
37
|
width?: WidthProps
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
type CodeAppearanceKey = AppearanceKeysState | CompositeAppearanceStateDefault
|
|
41
|
-
type CodeConfig = AppearanceConfig<AppearanceKeysState, CodeAppearanceProps>
|
|
42
|
-
type CodeAppearance = CodeConfig['appearance']
|
|
43
|
-
type CodeAppearanceStyle = AppearanceRecord<
|
|
44
|
-
AppearanceStyleKey,
|
|
45
|
-
CodeAppearanceProps,
|
|
46
|
-
'inputBorderColor' | 'inputFill'
|
|
47
|
-
>
|
|
48
|
-
type CodeAppearanceShape = Partial<
|
|
49
|
-
Record<AppearanceShapeKey, Partial<Pick<CodeAppearanceProps, 'shape'>>>
|
|
50
|
-
>
|
|
51
40
|
type CodeAppearanceSize = AppearancePartialRecord<
|
|
52
41
|
AppearanceSizeKey,
|
|
53
42
|
CodeAppearanceProps,
|
|
@@ -62,8 +51,7 @@ interface CodeProps extends CodeAppearanceProps {
|
|
|
62
51
|
onChange?: (otp: string) => void
|
|
63
52
|
onFocus?: () => void
|
|
64
53
|
after?: ReactNode
|
|
65
|
-
appearance?:
|
|
66
|
-
appearanceStyle?: AppearanceStyleKey
|
|
54
|
+
appearance?: CompositeAppearanceStateDefault
|
|
67
55
|
before?: ReactNode
|
|
68
56
|
dataTestId?: string
|
|
69
57
|
initialValue?: string
|
|
@@ -74,6 +62,18 @@ interface CodeProps extends CodeAppearanceProps {
|
|
|
74
62
|
style?: StyleProp<ViewStyle>
|
|
75
63
|
}
|
|
76
64
|
|
|
65
|
+
type CodeConfig = AppearanceConfig<AppearanceKeysState, CodeAppearanceProps>
|
|
66
|
+
type CodeAppearance = CodeConfig['appearance']
|
|
67
|
+
type CodeAppearanceStyle = AppearanceRecord<
|
|
68
|
+
AppearanceStyleKey,
|
|
69
|
+
CodeAppearanceProps,
|
|
70
|
+
'inputBorderColor' | 'inputFill'
|
|
71
|
+
>
|
|
72
|
+
type CodeAppearanceShape = Partial<
|
|
73
|
+
Record<AppearanceShapeKey, Partial<Pick<CodeAppearanceProps, 'shape'>>>
|
|
74
|
+
>
|
|
75
|
+
type CodeAppearanceKey = NonNullable<CodeProps['appearance']>
|
|
76
|
+
|
|
77
77
|
type CodeGalleryStory = ComponentGalleryArgs &
|
|
78
78
|
Pick<
|
|
79
79
|
CodeProps,
|
|
@@ -7,7 +7,6 @@ import {
|
|
|
7
7
|
useAppearanceConfig,
|
|
8
8
|
useDevicePropsGenerator,
|
|
9
9
|
} from '@itcase/ui-core/hooks'
|
|
10
|
-
import { mergeAppearanceKeys } from '@itcase/ui-core/utils'
|
|
11
10
|
|
|
12
11
|
import { tokens } from '../../styles/tokens'
|
|
13
12
|
import { codeAppearance } from './Code.appearance'
|
|
@@ -29,7 +28,6 @@ function Code(props: CodeProps) {
|
|
|
29
28
|
appearance = 'defaultPrimary sizeM solid rounded',
|
|
30
29
|
dataTestId,
|
|
31
30
|
initialValue = '',
|
|
32
|
-
appearanceStyle,
|
|
33
31
|
inputAutoFocus = false,
|
|
34
32
|
inputCount = 6,
|
|
35
33
|
inputPlaceholder,
|
|
@@ -45,17 +43,8 @@ function Code(props: CodeProps) {
|
|
|
45
43
|
|
|
46
44
|
const otpRef = useRef<OtpInputRef>(null)
|
|
47
45
|
|
|
48
|
-
const resolvedAppearance = useMemo(() => {
|
|
49
|
-
const appearanceTokens = appearance.split(' ')
|
|
50
|
-
const isCompositeAppearance = appearanceTokens.length > 1
|
|
51
|
-
|
|
52
|
-
return isCompositeAppearance
|
|
53
|
-
? appearance
|
|
54
|
-
: mergeAppearanceKeys(appearance, appearanceStyle || 'solid')
|
|
55
|
-
}, [appearance, appearanceStyle])
|
|
56
|
-
|
|
57
46
|
const appearanceConfig = useAppearanceConfig(
|
|
58
|
-
|
|
47
|
+
appearance,
|
|
59
48
|
codeConfig,
|
|
60
49
|
isDisabled,
|
|
61
50
|
)
|
|
@@ -26,22 +26,21 @@ interface ColorInputAppearanceProps {
|
|
|
26
26
|
textSize?: TextSizeProps
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
type ColorInputAppearanceKey =
|
|
30
|
-
AppearanceKeysState | CompositeAppearanceStateDefault
|
|
31
|
-
type ColorInputConfig = AppearanceConfig<
|
|
32
|
-
AppearanceKeysState,
|
|
33
|
-
ColorInputAppearanceProps
|
|
34
|
-
>
|
|
35
|
-
type ColorInputAppearance = ColorInputConfig['appearance']
|
|
36
|
-
|
|
37
29
|
interface ColorInputProps extends ColorInputAppearanceProps {
|
|
38
30
|
isDisabled?: boolean
|
|
39
31
|
onChangeText?: (text: string) => void
|
|
40
|
-
appearance?:
|
|
32
|
+
appearance?: CompositeAppearanceStateDefault
|
|
41
33
|
style?: StyleProp<ViewStyle>
|
|
42
34
|
value?: string
|
|
43
35
|
}
|
|
44
36
|
|
|
37
|
+
type ColorInputConfig = AppearanceConfig<
|
|
38
|
+
AppearanceKeysState,
|
|
39
|
+
ColorInputAppearanceProps
|
|
40
|
+
>
|
|
41
|
+
type ColorInputAppearance = ColorInputConfig['appearance']
|
|
42
|
+
type ColorInputAppearanceKey = NonNullable<ColorInputProps['appearance']>
|
|
43
|
+
|
|
45
44
|
type ColorInputGalleryStory = ComponentGalleryArgs &
|
|
46
45
|
Pick<ColorInputProps, 'isDisabled' | 'placeholder' | 'value'>
|
|
47
46
|
|
|
@@ -16,13 +16,15 @@ import type {
|
|
|
16
16
|
TextWeightProps,
|
|
17
17
|
} from '@itcase/types-ui'
|
|
18
18
|
|
|
19
|
+
import type { IconProps } from '../Icon/Icon.interface'
|
|
20
|
+
|
|
19
21
|
interface DatePickerAppearanceProps {
|
|
20
22
|
dayTextColor?: TextColorProps
|
|
21
23
|
dayTextShape?: ShapeProps
|
|
22
24
|
dayTextSize?: TextSizeProps
|
|
23
25
|
disablePastDays?: boolean
|
|
24
26
|
fill?: FillProps
|
|
25
|
-
iconAppearance?:
|
|
27
|
+
iconAppearance?: IconProps['appearance']
|
|
26
28
|
monthTextColor?: TextColorProps
|
|
27
29
|
monthTextSize?: TextSizeProps
|
|
28
30
|
monthTextWeight?: TextWeightProps
|
|
@@ -18,7 +18,6 @@ interface DividerAppearanceProps {
|
|
|
18
18
|
width?: WidthProps
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
type DividerAppearanceKey = AppearanceKeysDefault | CompositeAppearanceKeys
|
|
22
21
|
type DividerConfig = AppearanceConfig<
|
|
23
22
|
AppearanceKeysDefault,
|
|
24
23
|
DividerAppearanceProps
|
|
@@ -27,10 +26,12 @@ type DividerAppearance = DividerConfig['appearance']
|
|
|
27
26
|
|
|
28
27
|
interface DividerProps extends DividerAppearanceProps {
|
|
29
28
|
isDisabled?: boolean
|
|
30
|
-
appearance?:
|
|
29
|
+
appearance?: CompositeAppearanceKeys
|
|
31
30
|
style?: StyleProp<ViewStyle>
|
|
32
31
|
}
|
|
33
32
|
|
|
33
|
+
type DividerAppearanceKey = NonNullable<DividerProps['appearance']>
|
|
34
|
+
|
|
34
35
|
export type {
|
|
35
36
|
DividerAppearance,
|
|
36
37
|
DividerAppearanceKey,
|
|
@@ -15,6 +15,7 @@ import type {
|
|
|
15
15
|
} from '@itcase/types-ui'
|
|
16
16
|
|
|
17
17
|
import type { dividerSizePropsType } from '../Divider/styles/dividerSize'
|
|
18
|
+
import type { IconProps } from '../Icon/Icon.interface'
|
|
18
19
|
|
|
19
20
|
type DrawerPosition = 'bottom' | 'left' | 'right'
|
|
20
21
|
|
|
@@ -25,7 +26,7 @@ interface DrawerAppearanceProps {
|
|
|
25
26
|
dividerFill?: FillProps
|
|
26
27
|
dividerSize?: dividerSizePropsType
|
|
27
28
|
fill?: FillProps
|
|
28
|
-
iconCloseAppearance?:
|
|
29
|
+
iconCloseAppearance?: IconProps['appearance']
|
|
29
30
|
titleTextColor?: TextColorProps
|
|
30
31
|
titleTextSize?: TitleSizeProps
|
|
31
32
|
titleTextWeight?: TextWeightProps
|
|
@@ -38,11 +38,11 @@ interface DropdownAppearanceProps {
|
|
|
38
38
|
emptyMessageTextSize?: TextSizeProps
|
|
39
39
|
fill?: FillProps
|
|
40
40
|
fillActive?: FillActiveProps
|
|
41
|
-
iconAfterAppearance?:
|
|
41
|
+
iconAfterAppearance?: IconProps['appearance']
|
|
42
42
|
iconAfterFillIcon?: ItemFillActiveProps
|
|
43
43
|
iconAfterFillSize?: IconProps['fillSize']
|
|
44
44
|
iconAfterSize?: IconProps['iconSize']
|
|
45
|
-
iconBeforeAppearance?:
|
|
45
|
+
iconBeforeAppearance?: IconProps['appearance']
|
|
46
46
|
iconBeforeFillIcon?: ItemFillActiveProps
|
|
47
47
|
iconBeforeFillSize?: IconProps['fillSize']
|
|
48
48
|
iconBeforeSize?: IconProps['iconSize']
|
|
@@ -68,11 +68,11 @@ interface DropdownItemAppearanceProps {
|
|
|
68
68
|
fill?: FillProps
|
|
69
69
|
fillActive?: FillActiveProps
|
|
70
70
|
fillDisabled?: FillProps
|
|
71
|
-
iconAfterAppearance?:
|
|
71
|
+
iconAfterAppearance?: IconProps['appearance']
|
|
72
72
|
iconAfterFillIcon?: ItemFillActiveProps
|
|
73
73
|
iconAfterFillSize?: IconProps['fillSize']
|
|
74
74
|
iconAfterSize?: IconProps['iconSize']
|
|
75
|
-
iconBeforeAppearance?:
|
|
75
|
+
iconBeforeAppearance?: IconProps['appearance']
|
|
76
76
|
iconBeforeFillIcon?: ItemFillActiveProps
|
|
77
77
|
iconBeforeFillSize?: IconProps['fillSize']
|
|
78
78
|
iconBeforeSize?: IconProps['iconSize']
|
|
@@ -17,8 +17,8 @@ import type { IconProps } from '../Icon'
|
|
|
17
17
|
interface HeroTitleAppearanceProps {
|
|
18
18
|
direction?: DirectionProps
|
|
19
19
|
fill?: FillProps
|
|
20
|
-
iconAfterAppearance?:
|
|
21
|
-
iconBeforeAppearance?:
|
|
20
|
+
iconAfterAppearance?: IconProps['appearance']
|
|
21
|
+
iconBeforeAppearance?: IconProps['appearance']
|
|
22
22
|
size?: TitleSizeProps
|
|
23
23
|
textAlign?: TextAlignProps
|
|
24
24
|
textColor?: TextColorProps
|
|
@@ -16,7 +16,7 @@ import type {
|
|
|
16
16
|
AppearanceSizeKey,
|
|
17
17
|
AppearanceStyleKey,
|
|
18
18
|
BorderColorProps,
|
|
19
|
-
|
|
19
|
+
CompositeAppearanceIconKeys,
|
|
20
20
|
FillHoverProps,
|
|
21
21
|
FillProps,
|
|
22
22
|
FillSizeProps,
|
|
@@ -86,7 +86,7 @@ interface IconProps extends IconAppearanceProps {
|
|
|
86
86
|
isSkeleton?: boolean
|
|
87
87
|
onClick?: (event?: GestureResponderEvent) => void
|
|
88
88
|
onPress?: (event: GestureResponderEvent) => void
|
|
89
|
-
appearance?:
|
|
89
|
+
appearance?: CompositeAppearanceIconKeys
|
|
90
90
|
badgeCount?: number | string
|
|
91
91
|
badgeType?: badgeTypePropsType
|
|
92
92
|
badgeValue?: number | string
|