@codeleap/web 3.13.5 → 3.14.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/package.json +1 -1
- package/src/components/ActionIcon/index.tsx +4 -0
- package/src/components/ActivityIndicator/index.tsx +3 -0
- package/src/components/Badge/index.tsx +8 -0
- package/src/components/Button/index.tsx +9 -0
- package/src/components/Checkbox/index.tsx +5 -0
- package/src/components/Text/index.tsx +5 -17
- package/src/components/Text/types.ts +16 -0
package/package.json
CHANGED
|
@@ -7,10 +7,14 @@ import { ActionIconComposition, ActionIconParts, ActionIconPresets } from './sty
|
|
|
7
7
|
|
|
8
8
|
export * from './styles'
|
|
9
9
|
|
|
10
|
+
/** IconButton */
|
|
10
11
|
export type ActionIconProps = Omit<TouchableProps, 'styles' | 'variants'> & ComponentCommonProps & {
|
|
11
12
|
iconProps?: Partial<IconProps>
|
|
13
|
+
/** prop */
|
|
12
14
|
icon?: IconProps['name']
|
|
15
|
+
/** prop */
|
|
13
16
|
name?: IconProps['name']
|
|
17
|
+
|
|
14
18
|
styles?: StylesOf<ActionIconComposition>
|
|
15
19
|
} & ComponentVariants<typeof ActionIconPresets>
|
|
16
20
|
|
|
@@ -14,11 +14,14 @@ import { ComponentCommonProps, ComponentWithDefaultProps } from '../../types'
|
|
|
14
14
|
|
|
15
15
|
export * from './styles'
|
|
16
16
|
|
|
17
|
+
/** * LoadingIndicator */
|
|
17
18
|
export type ActivityIndicatorProps = ComponentCommonProps & {
|
|
18
19
|
style?: React.CSSProperties
|
|
19
20
|
styles?: StylesOf<ActivityIndicatorComposition>
|
|
20
21
|
css?: CSSInterpolation | CSSInterpolation[]
|
|
22
|
+
/** prop */
|
|
21
23
|
component?: React.ComponentType<Omit<ActivityIndicatorProps & {ref?: React.Ref<any>}, 'component'>>
|
|
24
|
+
/** prop */
|
|
22
25
|
size?: number
|
|
23
26
|
} & ComponentVariants<typeof ActivityIndicatorStyles>
|
|
24
27
|
|
|
@@ -7,19 +7,27 @@ import { ComponentCommonProps } from '../../types'
|
|
|
7
7
|
|
|
8
8
|
export * from './styles'
|
|
9
9
|
|
|
10
|
+
/** * Badge */
|
|
10
11
|
export type BadgeProps = ComponentVariants<typeof BadgePresets>
|
|
11
12
|
& ViewProps<'div'>
|
|
12
13
|
& ComponentCommonProps
|
|
13
14
|
& {
|
|
14
15
|
styles?: StylesOf<BadgeComposition>
|
|
16
|
+
/** prop */
|
|
15
17
|
maxCount?: number
|
|
18
|
+
/** prop */
|
|
16
19
|
minCount?: number
|
|
20
|
+
/** prop */
|
|
17
21
|
debugName?: string
|
|
18
22
|
innerWrapperProps?: Partial<PropsOf<typeof View>>
|
|
19
23
|
textProps?: Partial<PropsOf<typeof Text>>
|
|
24
|
+
/** prop */
|
|
20
25
|
getBadgeContent?: (props: BadgeContent) => string
|
|
26
|
+
/** prop */
|
|
21
27
|
renderBadgeContent?: (props: BadgeContent & { content: string }) => JSX.Element
|
|
28
|
+
/** prop */
|
|
22
29
|
disabled?: boolean
|
|
30
|
+
/** prop */
|
|
23
31
|
badge?: number | boolean
|
|
24
32
|
}
|
|
25
33
|
|
|
@@ -14,20 +14,29 @@ import { ActivityIndicator, ActivityIndicatorProps } from '../ActivityIndicator'
|
|
|
14
14
|
import { ButtonComposition, ButtonPresets, ButtonParts } from './styles'
|
|
15
15
|
import { ComponentCommonProps } from '../../types'
|
|
16
16
|
|
|
17
|
+
/** * Button */
|
|
17
18
|
export type ButtonProps =
|
|
18
19
|
ComponentVariants<typeof ButtonPresets> &
|
|
19
20
|
Partial<Omit<TouchableProps<'button'>, 'variants' | 'styles'>> &
|
|
20
21
|
ComponentCommonProps & {
|
|
22
|
+
/** prop */
|
|
21
23
|
text?: string
|
|
24
|
+
/** prop */
|
|
22
25
|
rightIcon?: IconPlaceholder
|
|
26
|
+
/** prop */
|
|
23
27
|
icon?: IconPlaceholder
|
|
28
|
+
/** prop */
|
|
24
29
|
onPress?: AnyFunction
|
|
25
30
|
styles?: StylesOf<ButtonComposition>
|
|
26
31
|
style?: React.CSSProperties
|
|
32
|
+
/** prop */
|
|
27
33
|
loading?: boolean
|
|
28
34
|
loadingShowText?: boolean
|
|
35
|
+
/** prop */
|
|
29
36
|
debugName: string
|
|
37
|
+
/** prop */
|
|
30
38
|
debounce?: number
|
|
39
|
+
/** prop */
|
|
31
40
|
selected?: boolean
|
|
32
41
|
children?: React.ReactNode | ((props: Partial<Omit<ButtonProps, 'children'>>) => JSX.Element)
|
|
33
42
|
loaderProps?: Partial<ActivityIndicatorProps>
|
|
@@ -17,15 +17,20 @@ import { ComponentCommonProps } from '../../types/utility'
|
|
|
17
17
|
|
|
18
18
|
export * from './styles'
|
|
19
19
|
|
|
20
|
+
/** * Checkbox */
|
|
20
21
|
export type CheckboxProps = Pick<
|
|
21
22
|
InputBaseProps,
|
|
22
23
|
'debugName' | 'disabled' | 'label'
|
|
23
24
|
> & ComponentCommonProps & {
|
|
24
25
|
styles?: StylesOf<CheckboxComposition>
|
|
26
|
+
/** prop */
|
|
25
27
|
value: boolean
|
|
28
|
+
/** prop */
|
|
26
29
|
onValueChange: (value: boolean) => void
|
|
27
30
|
style?: PropsOf<typeof View>['style']
|
|
31
|
+
/** prop */
|
|
28
32
|
checkboxOnLeft?: boolean
|
|
33
|
+
/** prop */
|
|
29
34
|
checkIcon?: IconPlaceholder
|
|
30
35
|
} & ComponentVariants<typeof CheckboxPresets>
|
|
31
36
|
|
|
@@ -1,22 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import React, {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { TypeGuards, useDefaultComponentStyle } from '@codeleap/common'
|
|
2
|
+
import React, { ElementType } from 'react'
|
|
3
|
+
import { TextPresets } from './styles'
|
|
4
|
+
import { TextProps } from './types'
|
|
5
5
|
|
|
6
6
|
export * from './styles'
|
|
7
|
-
|
|
8
|
-
export type TextProps<T extends ElementType> =
|
|
9
|
-
ComponentPropsWithoutRef<T> &
|
|
10
|
-
ComponentVariants<typeof TextPresets> & {
|
|
11
|
-
component?: T
|
|
12
|
-
text: string
|
|
13
|
-
styles?: StylesOf<TextComposition>
|
|
14
|
-
msg?: string
|
|
15
|
-
debugName?: string
|
|
16
|
-
debounce?: number
|
|
17
|
-
pressDisabled?: boolean
|
|
18
|
-
onPress?: (event: React.MouseEventHandler<T>) => void
|
|
19
|
-
}
|
|
7
|
+
export * from './types'
|
|
20
8
|
|
|
21
9
|
const defaultProps: Partial<TextProps<'p'>> = {
|
|
22
10
|
debugName: 'Text component',
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { StylesOf, ComponentVariants } from '@codeleap/common'
|
|
2
|
+
import { ComponentPropsWithoutRef, ElementType } from 'react'
|
|
3
|
+
import { TextComposition, TextPresets } from './styles'
|
|
4
|
+
|
|
5
|
+
export type TextProps<T extends ElementType> =
|
|
6
|
+
ComponentPropsWithoutRef<T> &
|
|
7
|
+
ComponentVariants<typeof TextPresets> & {
|
|
8
|
+
component?: T
|
|
9
|
+
text: string
|
|
10
|
+
styles?: StylesOf<TextComposition>
|
|
11
|
+
msg?: string
|
|
12
|
+
debugName?: string
|
|
13
|
+
debounce?: number
|
|
14
|
+
pressDisabled?: boolean
|
|
15
|
+
onPress?: (event: React.MouseEventHandler<T>) => void
|
|
16
|
+
}
|