@telus-uds/components-base 1.71.0 → 1.73.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/CHANGELOG.md +37 -2
- package/lib/Box/Box.js +17 -6
- package/lib/ColourToggle/ColourBubble.js +135 -0
- package/lib/ColourToggle/ColourToggle.js +101 -0
- package/lib/ColourToggle/index.js +10 -0
- package/lib/FlexGrid/Col/Col.js +42 -19
- package/lib/FlexGrid/FlexGrid.js +40 -17
- package/lib/FlexGrid/Row/Row.js +45 -22
- package/lib/Listbox/ListboxGroup.js +7 -1
- package/lib/Modal/ModalContent.js +4 -6
- package/lib/MultiSelectFilter/MultiSelectFilter.js +1 -0
- package/lib/Notification/Notification.js +13 -5
- package/lib/OrderedList/Item.js +180 -0
- package/lib/OrderedList/ItemBase.js +54 -0
- package/lib/OrderedList/OrderedList.js +71 -0
- package/lib/OrderedList/OrderedListBase.js +47 -0
- package/lib/OrderedList/index.js +10 -0
- package/lib/Responsive/Responsive.js +24 -14
- package/lib/Responsive/ResponsiveProp.js +46 -0
- package/lib/Responsive/ResponsiveWithMediaQueryStyleSheet.js +72 -0
- package/lib/ThemeProvider/ThemeProvider.js +5 -2
- package/lib/ThemeProvider/index.js +9 -1
- package/lib/ThemeProvider/useResponsiveThemeTokens.js +89 -0
- package/lib/Typography/Typography.js +48 -22
- package/lib/index.js +16 -0
- package/lib/server.js +40 -0
- package/lib/utils/ssr-media-query/create-stylesheet/create-stylesheet-mobile.js +56 -0
- package/lib/utils/ssr-media-query/create-stylesheet/index.android.js +10 -0
- package/lib/utils/ssr-media-query/create-stylesheet/index.ios.js +10 -0
- package/lib/utils/ssr-media-query/create-stylesheet/index.js +44 -0
- package/lib/utils/ssr-media-query/utils/create-media-query-styles.js +39 -6
- package/lib-module/Box/Box.js +17 -6
- package/lib-module/ColourToggle/ColourBubble.js +125 -0
- package/lib-module/ColourToggle/ColourToggle.js +92 -0
- package/lib-module/ColourToggle/index.js +2 -0
- package/lib-module/FlexGrid/Col/Col.js +42 -19
- package/lib-module/FlexGrid/FlexGrid.js +40 -17
- package/lib-module/FlexGrid/Row/Row.js +45 -22
- package/lib-module/Listbox/ListboxGroup.js +7 -1
- package/lib-module/Modal/ModalContent.js +4 -6
- package/lib-module/MultiSelectFilter/MultiSelectFilter.js +1 -0
- package/lib-module/Notification/Notification.js +13 -5
- package/lib-module/OrderedList/Item.js +171 -0
- package/lib-module/OrderedList/ItemBase.js +43 -0
- package/lib-module/OrderedList/OrderedList.js +61 -0
- package/lib-module/OrderedList/OrderedListBase.js +36 -0
- package/lib-module/OrderedList/index.js +2 -0
- package/lib-module/Responsive/Responsive.js +24 -15
- package/lib-module/Responsive/ResponsiveProp.js +39 -0
- package/lib-module/Responsive/ResponsiveWithMediaQueryStyleSheet.js +64 -0
- package/lib-module/ThemeProvider/ThemeProvider.js +5 -2
- package/lib-module/ThemeProvider/index.js +1 -0
- package/lib-module/ThemeProvider/useResponsiveThemeTokens.js +81 -0
- package/lib-module/Typography/Typography.js +50 -24
- package/lib-module/index.js +2 -0
- package/lib-module/server.js +4 -0
- package/lib-module/utils/ssr-media-query/create-stylesheet/create-stylesheet-mobile.js +48 -0
- package/lib-module/utils/ssr-media-query/create-stylesheet/index.android.js +2 -0
- package/lib-module/utils/ssr-media-query/create-stylesheet/index.ios.js +2 -0
- package/lib-module/utils/ssr-media-query/create-stylesheet/index.js +36 -0
- package/lib-module/utils/ssr-media-query/utils/create-media-query-styles.js +36 -6
- package/package.json +13 -2
- package/src/Box/Box.jsx +35 -17
- package/src/ColourToggle/ColourBubble.jsx +111 -0
- package/src/ColourToggle/ColourToggle.jsx +83 -0
- package/src/ColourToggle/index.js +3 -0
- package/src/FlexGrid/Col/Col.jsx +42 -13
- package/src/FlexGrid/FlexGrid.jsx +40 -11
- package/src/FlexGrid/Row/Row.jsx +40 -16
- package/src/Listbox/ListboxGroup.jsx +9 -2
- package/src/Modal/ModalContent.jsx +4 -6
- package/src/MultiSelectFilter/MultiSelectFilter.jsx +2 -0
- package/src/Notification/Notification.jsx +15 -3
- package/src/OrderedList/Item.jsx +152 -0
- package/src/OrderedList/ItemBase.jsx +43 -0
- package/src/OrderedList/OrderedList.jsx +61 -0
- package/src/OrderedList/OrderedListBase.jsx +33 -0
- package/src/OrderedList/index.js +3 -0
- package/src/Responsive/Responsive.jsx +24 -11
- package/src/Responsive/ResponsiveProp.jsx +33 -0
- package/src/Responsive/ResponsiveWithMediaQueryStyleSheet.jsx +58 -0
- package/src/ThemeProvider/ThemeProvider.jsx +5 -2
- package/src/ThemeProvider/index.js +1 -0
- package/src/ThemeProvider/useResponsiveThemeTokens.js +85 -0
- package/src/Typography/Typography.jsx +72 -24
- package/src/index.js +2 -0
- package/src/server.js +4 -0
- package/src/utils/ssr-media-query/create-stylesheet/create-stylesheet-mobile.js +41 -0
- package/src/utils/ssr-media-query/create-stylesheet/index.android.js +3 -0
- package/src/utils/ssr-media-query/create-stylesheet/index.ios.js +3 -0
- package/src/utils/ssr-media-query/create-stylesheet/index.js +33 -0
- package/src/utils/ssr-media-query/utils/create-media-query-styles.js +21 -6
- package/types/Badge.d.ts +28 -0
- package/types/Box.d.ts +52 -0
- package/types/ChevronLink.d.ts +47 -0
- package/types/Common.d.ts +106 -0
- package/types/Divider.d.ts +19 -0
- package/types/ExpandCollapse.d.ts +65 -0
- package/types/HorizontalScrollButton.d.ts +16 -0
- package/types/Icon.d.ts +21 -0
- package/types/Link.d.ts +48 -0
- package/types/List.d.ts +48 -0
- package/types/Search.d.ts +38 -0
- package/types/Select.d.ts +57 -0
- package/types/Spacer.d.ts +5 -0
- package/types/StackView.d.ts +28 -0
- package/types/Tabs.d.ts +46 -0
- package/types/TextButton.d.ts +11 -0
- package/types/ToggleSwitch.d.ts +54 -0
- package/types/ToolTip.d.ts +40 -0
- package/types/Typography.d.ts +39 -0
- package/types/index.d.ts +62 -0
- package/lib/utils/ssr-media-query/create-stylesheet.js +0 -76
- package/lib-module/utils/ssr-media-query/create-stylesheet.js +0 -68
- package/src/utils/ssr-media-query/create-stylesheet.js +0 -61
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { IconProps, IconPositionLeftRight } from './Icon'
|
|
2
|
+
import { LinkAndTextButtonVariants } from './Link'
|
|
3
|
+
|
|
4
|
+
type ChevronLinkTokens = {
|
|
5
|
+
fontSize?: number
|
|
6
|
+
color?: string
|
|
7
|
+
outerBorderColor?: string
|
|
8
|
+
leftIcon?: IconProps
|
|
9
|
+
rightIcon?: IconProps
|
|
10
|
+
iconDisplace?: number
|
|
11
|
+
iconSize?: number
|
|
12
|
+
iconSpace?: number
|
|
13
|
+
textLine?: string
|
|
14
|
+
textLineStyle?: string
|
|
15
|
+
outerBorderWidth?: number
|
|
16
|
+
outerBorderOutline?: string
|
|
17
|
+
borderRadius?: number
|
|
18
|
+
blockFontName?: string
|
|
19
|
+
blockFontWeight?: number
|
|
20
|
+
blockFontSize?: number
|
|
21
|
+
blockLineHeight?: number
|
|
22
|
+
icon?: IconProps
|
|
23
|
+
iconTranslateX?: number
|
|
24
|
+
iconTranslateY?: number
|
|
25
|
+
alignSelf?: 'auto' | 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'baseline'
|
|
26
|
+
}
|
|
27
|
+
export interface ChevronLinkProps {
|
|
28
|
+
testID?: string
|
|
29
|
+
children?: React.ReactNode
|
|
30
|
+
onPress?: () => void
|
|
31
|
+
onPressIn?: () => void
|
|
32
|
+
onPressOut?: () => void
|
|
33
|
+
disabled?: boolean
|
|
34
|
+
href?: string
|
|
35
|
+
hrefAttrs?: HrefProps
|
|
36
|
+
accessibilityRole?: string
|
|
37
|
+
accessibilityLabel?: string
|
|
38
|
+
tokens?: ChevronLinkTokens
|
|
39
|
+
direction?: IconPositionLeftRight
|
|
40
|
+
variant?: LinkAndTextButtonVariants
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface HrefProps {
|
|
44
|
+
download: string
|
|
45
|
+
rel: string
|
|
46
|
+
target: string
|
|
47
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
export type TextTransform = {
|
|
4
|
+
CAPITALIZE: 'capitalize'
|
|
5
|
+
LOWERCASE: 'lowercase'
|
|
6
|
+
UPPERCASE: 'uppercase'
|
|
7
|
+
NONE: 'none'
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export type LetterSpacing = {
|
|
11
|
+
NORMAL: 'normal'
|
|
12
|
+
LENGTH: number
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export type CopyType = {
|
|
16
|
+
EN: 'en'
|
|
17
|
+
FR: 'fr'
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export type Size = {
|
|
21
|
+
margin?: number
|
|
22
|
+
padding?: number
|
|
23
|
+
height?: number | string
|
|
24
|
+
width?: number | string
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export type Position = 'auto' | 'above' | 'below' | 'right' | 'left'
|
|
28
|
+
|
|
29
|
+
export type DisplaySize = {
|
|
30
|
+
LARGE: 'large'
|
|
31
|
+
MEDIUM: 'medium'
|
|
32
|
+
SMALL: 'small'
|
|
33
|
+
MICRO: 'micro'
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export enum Sizes {
|
|
37
|
+
xs = 'xs',
|
|
38
|
+
sm = 'sm',
|
|
39
|
+
md = 'md',
|
|
40
|
+
lg = 'lg',
|
|
41
|
+
xl = 'xl'
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export type ResponsiveSpacing = {
|
|
45
|
+
[key in Sizes]?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export type Direction = 'column' | 'row' | 'column-reverse' | 'row-reverse'
|
|
49
|
+
|
|
50
|
+
export type ResponsiveDirection = {
|
|
51
|
+
[key in Sizes]?: Direction
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export type SemanticTag =
|
|
55
|
+
| 'h1'
|
|
56
|
+
| 'h2'
|
|
57
|
+
| 'h3'
|
|
58
|
+
| 'h4'
|
|
59
|
+
| 'h5'
|
|
60
|
+
| 'h6'
|
|
61
|
+
| 'article'
|
|
62
|
+
| 'aside'
|
|
63
|
+
| 'blockquote'
|
|
64
|
+
| 'footer'
|
|
65
|
+
| 'figure'
|
|
66
|
+
| 'form'
|
|
67
|
+
| 'header'
|
|
68
|
+
| 'ul'
|
|
69
|
+
| 'li'
|
|
70
|
+
| 'main'
|
|
71
|
+
| 'nav'
|
|
72
|
+
| 'section'
|
|
73
|
+
| 'label'
|
|
74
|
+
|
|
75
|
+
type headingType = {
|
|
76
|
+
H1: 'h1'
|
|
77
|
+
H2: 'h2'
|
|
78
|
+
H3: 'h1'
|
|
79
|
+
H4: 'h2'
|
|
80
|
+
H5: 'h1'
|
|
81
|
+
H6: 'h2'
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
type tagType = {
|
|
85
|
+
HEADING: headingType
|
|
86
|
+
BLOCKQUOTE: 'blockquote'
|
|
87
|
+
CODE: 'code'
|
|
88
|
+
DEL: 'del'
|
|
89
|
+
EM: 'em'
|
|
90
|
+
INS: 'ins'
|
|
91
|
+
LI: 'li'
|
|
92
|
+
STRONG: 'strong'
|
|
93
|
+
LABEL: 'label'
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
type alignType = {
|
|
97
|
+
AUTO: 'auto'
|
|
98
|
+
LEFT: 'left'
|
|
99
|
+
RIGHT: 'right'
|
|
100
|
+
CENTER: 'center'
|
|
101
|
+
JUSTIFY: 'justify'
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export type FlexAlign = 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'baseline'
|
|
105
|
+
|
|
106
|
+
export type FlexJustify = 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around'
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ResponsiveSpacing, Size } from './Common'
|
|
2
|
+
type DividerVariants = {
|
|
3
|
+
weight?: 'regular' | 'thick'
|
|
4
|
+
decorative?: boolean
|
|
5
|
+
inverse?: boolean
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface DividerProps {
|
|
9
|
+
testID?: string
|
|
10
|
+
vertical?: boolean
|
|
11
|
+
space?: number | ResponsiveSpacing
|
|
12
|
+
tokens?: DividerTokens
|
|
13
|
+
variant?: DividerVariants
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface DividerTokens {
|
|
17
|
+
width?: Size
|
|
18
|
+
color?: string
|
|
19
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import React, { ReactPropTypes } from 'react'
|
|
2
|
+
|
|
3
|
+
type ExpandCollapseVariants = {
|
|
4
|
+
compact: boolean
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
type ExpandCollapseTokens = {
|
|
8
|
+
borderColor?: string
|
|
9
|
+
borderWidth?: number
|
|
10
|
+
borderStyle?: string
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
type ExpandCollapseControlTokens = {
|
|
14
|
+
backgroundColor?: string
|
|
15
|
+
borderBottomLeftRadius?: number | string
|
|
16
|
+
borderBottomRightRadius?: number | string
|
|
17
|
+
borderColor?: string
|
|
18
|
+
borderTopLeftRadius?: number | string
|
|
19
|
+
borderTopRightRadius?: number | string
|
|
20
|
+
borderWidth?: number | string
|
|
21
|
+
icon?: string
|
|
22
|
+
iconColor?: string
|
|
23
|
+
iconGap?: number | string
|
|
24
|
+
iconPaddingTop?: number | string
|
|
25
|
+
iconPosition?: string
|
|
26
|
+
iconSize?: number
|
|
27
|
+
justifyContent?: string
|
|
28
|
+
paddingBottom?: number | string
|
|
29
|
+
paddingLeft?: number | string
|
|
30
|
+
paddingRight?: number | string
|
|
31
|
+
paddingTop?: number | string
|
|
32
|
+
textLine?: string
|
|
33
|
+
verticalAlign?: string
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
type ExpandFnProps = {
|
|
37
|
+
openIds: string[]
|
|
38
|
+
onToggle: (panelId: string) => void
|
|
39
|
+
resetValues: () => void
|
|
40
|
+
setValues: (ids: string[]) => void
|
|
41
|
+
unsetValues: (ids: string[]) => void
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export type ExpandCollapseProps = {
|
|
45
|
+
tokens?: ExpandCollapseTokens
|
|
46
|
+
children: (expandProps: ExpandFnProps) => React.ReactNode
|
|
47
|
+
maxOpen?: number
|
|
48
|
+
open?: string[]
|
|
49
|
+
onChange?: (open: string[]) => void
|
|
50
|
+
initialOpen?: string[]
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export type ExpandCollapsePanelProps = {
|
|
54
|
+
variant?: ExpandCollapseVariants
|
|
55
|
+
tokens?: ExpandCollapseTokens
|
|
56
|
+
openIds?: string[]
|
|
57
|
+
panelId: string
|
|
58
|
+
onToggle?: (panelId: string) => void
|
|
59
|
+
onPress?: (panelId: string) => void
|
|
60
|
+
children: React.ReactNode | ((expandProps: ExpandFnProps) => React.ReactNode)
|
|
61
|
+
control?: React.ReactNode
|
|
62
|
+
controlTokens?: ExpandCollapseControlTokens
|
|
63
|
+
controlRef?: React.Ref
|
|
64
|
+
content?: boolean
|
|
65
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface HorizontalScrollButtonTokens {
|
|
2
|
+
backgroundColor?: string
|
|
3
|
+
borderColor?: string
|
|
4
|
+
borderRadius?: number | string
|
|
5
|
+
borderWidth?: number | string
|
|
6
|
+
iconColor?: string
|
|
7
|
+
iconScale?: number | string
|
|
8
|
+
iconSize?: number | string
|
|
9
|
+
iconTranslateX?: number
|
|
10
|
+
iconTranslateY?: number
|
|
11
|
+
outerBorderColor?: string
|
|
12
|
+
outerBorderGap?: number | string
|
|
13
|
+
outerBorderWidth?: number | string
|
|
14
|
+
padding?: number | string
|
|
15
|
+
shadow?: string
|
|
16
|
+
}
|
package/types/Icon.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface IconProps {
|
|
2
|
+
scalesWithText?: boolean
|
|
3
|
+
variant?: IconVariant
|
|
4
|
+
tokens?: IconTokens
|
|
5
|
+
icon: React.ReactNode
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface IconTokens {
|
|
9
|
+
size?: number | string
|
|
10
|
+
color?: string
|
|
11
|
+
scale?: number
|
|
12
|
+
translateX?: number
|
|
13
|
+
translateY?: number
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type IconVariant = {
|
|
17
|
+
color?: 'default' | 'brand' | 'subtle' | 'success' | 'warning' | 'danger' | 'inverse'
|
|
18
|
+
size?: 'micro' | 'small' | 'large' | 'extraLarge'
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type IconPositionLeftRight = 'left' | 'right'
|
package/types/Link.d.ts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { IconPositionLeftRight, IconProps } from './Icon'
|
|
2
|
+
|
|
3
|
+
export interface LinkProps {
|
|
4
|
+
href: string
|
|
5
|
+
onPress: () => void
|
|
6
|
+
tokens?: LinkTokens
|
|
7
|
+
accessibilityRole?: string
|
|
8
|
+
accessibilityLabel?: string
|
|
9
|
+
variant?: LinkAndTextButtonVariants
|
|
10
|
+
iconProps?: IconProps
|
|
11
|
+
icon?: React.ReactNode
|
|
12
|
+
iconPosition?: IconPositionLeftRight
|
|
13
|
+
testID?: string
|
|
14
|
+
children?: React.ReactNode
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export enum LinkSize {
|
|
18
|
+
micro = 'micro',
|
|
19
|
+
small = 'small',
|
|
20
|
+
large = 'large'
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export type LinkAndTextButtonVariants = {
|
|
24
|
+
size?: 'large' | 'small' | 'micro'
|
|
25
|
+
alternative?: boolean
|
|
26
|
+
inverse?: boolean
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export type LinkTokens = {
|
|
30
|
+
color?: string
|
|
31
|
+
textLine?: string
|
|
32
|
+
textLineStyle?: string
|
|
33
|
+
outerBorderColor?: string
|
|
34
|
+
outerBorderWidth?: number
|
|
35
|
+
outerBorderGap?: number | string
|
|
36
|
+
outerBorderOutline?: string
|
|
37
|
+
borderRadius?: number
|
|
38
|
+
blockFontName?: string
|
|
39
|
+
blockFontWeight?: number
|
|
40
|
+
blockFontSize?: number
|
|
41
|
+
blockLineHeight?: number
|
|
42
|
+
icon?: string
|
|
43
|
+
iconSize?: number
|
|
44
|
+
iconSpace?: number
|
|
45
|
+
iconTranslateX?: number
|
|
46
|
+
iconTranslateY?: number
|
|
47
|
+
alignSelf?: string
|
|
48
|
+
}
|
package/types/List.d.ts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { TextAlign } from '@telus-uds/components-web/types/common'
|
|
2
|
+
import { ReactElement, ReactNode } from 'react'
|
|
3
|
+
|
|
4
|
+
type ListVariants = {
|
|
5
|
+
size?: 'small' | 'medium' | 'large'
|
|
6
|
+
compact?: boolean
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
type ListTokens = {
|
|
10
|
+
interItemMargin?: number
|
|
11
|
+
interItemMarginWithDivider?: number
|
|
12
|
+
dividerColor?: string
|
|
13
|
+
dividerSize?: number
|
|
14
|
+
itemBulletContainerWidth?: number
|
|
15
|
+
itemBulletContainerAlign?: TextAlign
|
|
16
|
+
itemBulletWidth?: number
|
|
17
|
+
itemBulletHeight?: number
|
|
18
|
+
itemBulletColor?: string
|
|
19
|
+
itemIconSize?: number
|
|
20
|
+
itemIconColor?: string
|
|
21
|
+
listGutter?: number
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface ListProps {
|
|
25
|
+
tokens?: ListTokens
|
|
26
|
+
variant?: ListVariants
|
|
27
|
+
children: ReactNode | ReactElement
|
|
28
|
+
showDivider?: boolean
|
|
29
|
+
testID?: string
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface ListItemProps {
|
|
33
|
+
tokens?: ListItemTokens
|
|
34
|
+
children: ReactNode | ReactElement
|
|
35
|
+
icon?: ReactNode | string
|
|
36
|
+
iconColor?: string
|
|
37
|
+
iconSize?: number
|
|
38
|
+
title?: string
|
|
39
|
+
testID?: string
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface ListItemTokens {
|
|
43
|
+
iconMarginTop?: number
|
|
44
|
+
itemFontWeight?: number
|
|
45
|
+
itemFontSize?: number
|
|
46
|
+
itemLineHeight?: number
|
|
47
|
+
itemFontName?: string
|
|
48
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { CopyType, Size } from './Common'
|
|
2
|
+
|
|
3
|
+
export type SearchTokens = {
|
|
4
|
+
backgroundColor?: string
|
|
5
|
+
color?: string
|
|
6
|
+
borderWidth?: number
|
|
7
|
+
borderColor?: string
|
|
8
|
+
borderRadius?: number
|
|
9
|
+
paddingTop?: Size
|
|
10
|
+
paddingBottom?: Size
|
|
11
|
+
paddingLeft?: Size
|
|
12
|
+
paddingRight?: Size
|
|
13
|
+
outerBackgroundColor?: string
|
|
14
|
+
outerBorderWidth?: number
|
|
15
|
+
outerBorderColor?: string
|
|
16
|
+
outerBorderRadius?: number
|
|
17
|
+
fontName?: string
|
|
18
|
+
fontWeight?: number
|
|
19
|
+
fontSize?: Size
|
|
20
|
+
lineHeight?: number
|
|
21
|
+
placeholderColor?: string
|
|
22
|
+
buttonsGap?: Size
|
|
23
|
+
clearButtonIcon?: React.ReactNode
|
|
24
|
+
submitButtonIcon?: React.ReactNode
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface SearchProps {
|
|
28
|
+
testID?: string
|
|
29
|
+
copy?: CopyType
|
|
30
|
+
initialValue?: string
|
|
31
|
+
placeholder?: string
|
|
32
|
+
inactive?: boolean
|
|
33
|
+
onChange?: (value: string) => void
|
|
34
|
+
onSubmit?: (value: string) => void
|
|
35
|
+
onClear?: () => void
|
|
36
|
+
onFocus?: () => void
|
|
37
|
+
tokens?: SearchTokens
|
|
38
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { IconProps } from './Icon'
|
|
3
|
+
|
|
4
|
+
export type SelectTokens = {
|
|
5
|
+
backgroundColor?: string
|
|
6
|
+
color?: string
|
|
7
|
+
borderWidth?: number | string
|
|
8
|
+
borderColor?: string
|
|
9
|
+
borderRadius?: number | string
|
|
10
|
+
paddingTop?: number | string
|
|
11
|
+
paddingBottom?: number | string
|
|
12
|
+
paddingLeft?: number | string
|
|
13
|
+
paddingRight?: number | string
|
|
14
|
+
height?: number | string
|
|
15
|
+
outerBackgroundColor?: string
|
|
16
|
+
outerBorderWidth?: number | string
|
|
17
|
+
outerBorderColor?: string
|
|
18
|
+
fontSize?: number
|
|
19
|
+
fontName?: string
|
|
20
|
+
fontWeight?: number
|
|
21
|
+
icon?: IconProps
|
|
22
|
+
iconSize?: number | string
|
|
23
|
+
iconColor?: string
|
|
24
|
+
validationIcon?: IconProps
|
|
25
|
+
validationIconSize?: number | string
|
|
26
|
+
validationIconColor?: string
|
|
27
|
+
feedbackBackgroundColor?: string
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface SelectProps {
|
|
31
|
+
children: string | React.ReactNode
|
|
32
|
+
label: string
|
|
33
|
+
initialValue?: string
|
|
34
|
+
feedback?: string
|
|
35
|
+
validation?: string
|
|
36
|
+
value?: string
|
|
37
|
+
onChange?: () => void
|
|
38
|
+
nativeID?: string
|
|
39
|
+
hint?: string
|
|
40
|
+
hintPosition?: string
|
|
41
|
+
tooltip?: string
|
|
42
|
+
inactive?: boolean
|
|
43
|
+
readOnly?: boolean
|
|
44
|
+
placeholder?: string
|
|
45
|
+
tokens?: SelectTokens
|
|
46
|
+
testID?: string
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface SelectItemProps {
|
|
50
|
+
children: string | React.ReactNode
|
|
51
|
+
value: string
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface SelectGroupProps {
|
|
55
|
+
children: string | React.ReactNode
|
|
56
|
+
label: string
|
|
57
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ReactNode } from 'react'
|
|
2
|
+
import {
|
|
3
|
+
Direction,
|
|
4
|
+
FlexAlign,
|
|
5
|
+
FlexJustify,
|
|
6
|
+
ResponsiveSpacing,
|
|
7
|
+
ResponsiveDirection,
|
|
8
|
+
SemanticTag
|
|
9
|
+
} from './Common'
|
|
10
|
+
import { DividerProps } from './Divider'
|
|
11
|
+
|
|
12
|
+
type StackViewTokens = {
|
|
13
|
+
alignItems?: FlexAlign
|
|
14
|
+
justifyContent?: FlexJustify
|
|
15
|
+
flexGrow?: number
|
|
16
|
+
flexShrink?: number
|
|
17
|
+
width?: number
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface StackViewProps {
|
|
21
|
+
space?: ResponsiveSpacing | number
|
|
22
|
+
direction?: Direction | ResponsiveDirection
|
|
23
|
+
tokens?: StackViewTokens
|
|
24
|
+
divider?: boolean | DividerProps
|
|
25
|
+
tag?: SemanticTag
|
|
26
|
+
children: ReactNode
|
|
27
|
+
testID?: string
|
|
28
|
+
}
|
package/types/Tabs.d.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Size } from './Common'
|
|
2
|
+
import { IconProps } from './Icon'
|
|
3
|
+
import { TypographyVariants, TypographyTokens } from './Typography'
|
|
4
|
+
import { HorizontalScrollButtonTokens } from './HorizontalScrollButton'
|
|
5
|
+
|
|
6
|
+
type TabsItem = {
|
|
7
|
+
label: string
|
|
8
|
+
href: string
|
|
9
|
+
id: string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
type TabsVariant = {
|
|
13
|
+
equalWidth?: string
|
|
14
|
+
inverse?: boolean
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface TabsProps {
|
|
18
|
+
items: Array<TabsItem>
|
|
19
|
+
value?: string
|
|
20
|
+
initialValue?: string
|
|
21
|
+
onChange?: () => void
|
|
22
|
+
itemTokens?: TabsItem
|
|
23
|
+
scrollButtonTokens?: HorizontalScrollButtonTokens
|
|
24
|
+
variant?: TabsVariant
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export type TabsTokens = {
|
|
28
|
+
nextIcon?: IconProps
|
|
29
|
+
previousIcon?: IconProps
|
|
30
|
+
space?: number
|
|
31
|
+
buttonClearance?: Size
|
|
32
|
+
gutter?: Size
|
|
33
|
+
borderBottomColor?: string
|
|
34
|
+
borderBottomWidth?: number
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface TabSelectorProps {
|
|
38
|
+
items: TabsItem[]
|
|
39
|
+
initialValue?: string
|
|
40
|
+
value?: string
|
|
41
|
+
onChange?: (value: string) => void
|
|
42
|
+
labelVariant?: TypographyVariants
|
|
43
|
+
labelTokens?: TypographyTokens
|
|
44
|
+
testID?: string
|
|
45
|
+
selectedTestID?: string
|
|
46
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { LinkTokens, LinkAndTextButtonVariants } from './Link'
|
|
3
|
+
|
|
4
|
+
export interface TextButtonProps {
|
|
5
|
+
onPress: () => void
|
|
6
|
+
accessibilityLabel: string
|
|
7
|
+
children: string | React.ReactNode
|
|
8
|
+
variant?: LinkAndTextButtonVariants
|
|
9
|
+
tokens?: LinkTokens
|
|
10
|
+
testID?: string
|
|
11
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { CopyType } from './Common'
|
|
2
|
+
|
|
3
|
+
type ToggleSwitchTokens = {
|
|
4
|
+
borderColor?: string
|
|
5
|
+
borderWidth?: number
|
|
6
|
+
borderRadius?: number
|
|
7
|
+
outerBorderColor?: string
|
|
8
|
+
outerBorderWidth?: number
|
|
9
|
+
outerBorderGap?: number
|
|
10
|
+
outerBackgroundColor?: string
|
|
11
|
+
backgroundColor?: string
|
|
12
|
+
opacity?: number
|
|
13
|
+
paddingLeft?: number
|
|
14
|
+
paddingRight?: number
|
|
15
|
+
paddingTop?: number
|
|
16
|
+
paddingBottom?: number
|
|
17
|
+
shadow?: string
|
|
18
|
+
alignSelf?: string
|
|
19
|
+
space?: number
|
|
20
|
+
icon?: React.ReactNode
|
|
21
|
+
trackHeight?: number
|
|
22
|
+
outerBorderGapButton?: number
|
|
23
|
+
width?: number
|
|
24
|
+
trackBorderWidth?: number
|
|
25
|
+
trackBorderColor?: string
|
|
26
|
+
trackBorderRadius?: number
|
|
27
|
+
iconSize?: number
|
|
28
|
+
iconColor?: string
|
|
29
|
+
labelColor?: string
|
|
30
|
+
labelFontName?: string
|
|
31
|
+
labelFontWeight?: number
|
|
32
|
+
labelLineHeight?: number
|
|
33
|
+
labelMarginLeft?: number
|
|
34
|
+
switchSize?: number
|
|
35
|
+
switchColor?: string
|
|
36
|
+
switchBorderColor?: string
|
|
37
|
+
switchBorderWidth?: number
|
|
38
|
+
switchBorderRadius?: number
|
|
39
|
+
switchShadow?: string
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface ToggleSwitchProps {
|
|
43
|
+
label?: string
|
|
44
|
+
initialValue?: boolean
|
|
45
|
+
value?: boolean
|
|
46
|
+
onChange?: (value: boolean) => void
|
|
47
|
+
accessibilityLabel?: string
|
|
48
|
+
tooltip?: string
|
|
49
|
+
inactive?: boolean
|
|
50
|
+
copy?: CopyType
|
|
51
|
+
id?: string
|
|
52
|
+
testID?: string
|
|
53
|
+
tokens?: ToggleSwitchTokens
|
|
54
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ReactNode } from 'react'
|
|
2
|
+
import { CopyType, Position } from './Common'
|
|
3
|
+
|
|
4
|
+
type TooltipTokens = {
|
|
5
|
+
backgroundColor?: string
|
|
6
|
+
paddingTop?: number
|
|
7
|
+
paddingBottom?: number
|
|
8
|
+
paddingLeft?: number
|
|
9
|
+
paddingRight?: number
|
|
10
|
+
borderRadius?: number
|
|
11
|
+
shadow?: string
|
|
12
|
+
color?: string
|
|
13
|
+
fontSize?: number
|
|
14
|
+
lineHeight?: number
|
|
15
|
+
fontName?: string
|
|
16
|
+
fontWeight?: number
|
|
17
|
+
arrowWidth?: number
|
|
18
|
+
arrowBorderRadius?: number
|
|
19
|
+
arrowOffset?: number
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
type TooltipVariants = {
|
|
23
|
+
inverse?: boolean
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface TooltipProps {
|
|
27
|
+
children?: ReactNode
|
|
28
|
+
content: string | ReactNode
|
|
29
|
+
copy?: CopyType
|
|
30
|
+
position?: Position
|
|
31
|
+
inline?: boolean
|
|
32
|
+
onPress?: () => void
|
|
33
|
+
nativeID?: string
|
|
34
|
+
tokens?: TooltipTokens
|
|
35
|
+
variant?: TooltipVariants
|
|
36
|
+
accessibilityRole?: string
|
|
37
|
+
accessibilityLabel?: string
|
|
38
|
+
accessible?: boolean
|
|
39
|
+
testID?: string
|
|
40
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { LetterSpacing, TextTransform } from './Common'
|
|
2
|
+
|
|
3
|
+
export interface TypographyProps {
|
|
4
|
+
tag?: tagType | string
|
|
5
|
+
block?: boolean
|
|
6
|
+
align?: alignType | string
|
|
7
|
+
strikeThrough?: boolean
|
|
8
|
+
tokens?: TypographyTokens
|
|
9
|
+
variant?: TypographyVariants
|
|
10
|
+
heading?: headingType | string
|
|
11
|
+
accessible?: boolean
|
|
12
|
+
accessibilityLabel?: string
|
|
13
|
+
children?: React.ReactNode
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type TypographyVariants = {
|
|
17
|
+
color?: string
|
|
18
|
+
secondColor?: string
|
|
19
|
+
animationDuration?: number
|
|
20
|
+
size?: number | string
|
|
21
|
+
radius?: number
|
|
22
|
+
baseWidth?: number
|
|
23
|
+
characters?: number
|
|
24
|
+
spaceBetweenLines?: number
|
|
25
|
+
squareRadius?: number
|
|
26
|
+
inverse?: boolean
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export type TypographyTokens = {
|
|
30
|
+
fontName?: string
|
|
31
|
+
superScriptFontSize?: number
|
|
32
|
+
fontWeight?: number
|
|
33
|
+
fontSize?: number
|
|
34
|
+
color?: string
|
|
35
|
+
lineHeight?: number
|
|
36
|
+
textTransform?: TextTransform
|
|
37
|
+
fontScaleCap?: number
|
|
38
|
+
letterSpacing?: LetterSpacing
|
|
39
|
+
}
|