-
Notifications
You must be signed in to change notification settings - Fork 734
b+c components - api docs #1650
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
8d249d9
Badge
Inbal-Tish 40f792f
Chip, defaults
Inbal-Tish 43336c0
ChipsInput
Inbal-Tish c5b7b1d
New components and fixes
Inbal-Tish 80a588b
Update src/components/connectionStatusBar/connectionStatusBar.api.json
Inbal-Tish cf7a2e3
pr comments
Inbal-Tish fe743ab
Merge branch 'infra/Docs_B_components' of github.com:wix/react-native…
Inbal-Tish ab99713
replace notes key with note
Inbal-Tish bf46e8d
Merge branch 'master' of github.com:wix/react-native-ui-lib into infr…
Inbal-Tish 057eac8
Merge branch 'master' of github.com:wix/react-native-ui-lib into infr…
Inbal-Tish File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"name": "Badge", | ||
"category": "basic", | ||
"description": "Round colored badge, typically used to show a number", | ||
"extends": ["TouchableOpacity", "View"], | ||
"extendsLink": [ | ||
"https://github.com/wix/react-native-ui-lib/blob/master/src/components/touchableOpacity/index.tsx", | ||
"https://github.com/wix/react-native-ui-lib/blob/master/src/components/view/index.tsx" | ||
], | ||
"example": "https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/BadgesScreen.tsx", | ||
"images": ["https://user-images.githubusercontent.com/33805983/34480753-df7a868a-efb6-11e7-9072-80f5c110a4f3.png"], | ||
"props": [ | ||
{"name": "size", "type": "number", "description": "Badge's size"}, | ||
{ | ||
"name": "label", | ||
"type": "string", | ||
"description": "Text to show inside the badge", | ||
"note": "Passing a label (undefined) will present a pimple badge" | ||
}, | ||
{"name": "labelStyle", "type": "TextStyle", "description": "Additional styles for the badge label"}, | ||
{"name": "onPress", "type": "(props: any) => void", "description": "Called when the badge is pressed"}, | ||
{ | ||
"name": "hitSlop", | ||
"type": "ViewProps['hitSlop']", | ||
"description": "Defines how far a touch event can start away from the badge" | ||
}, | ||
{"name": "backgroundColor", "type": "string", "description": "Background color"}, | ||
{"name": "borderWidth", "type": "number", "description": "Width of border around the badge"}, | ||
{"name": "borderRadius", "type": "number", "description": "Radius of border around the badge"}, | ||
{"name": "borderColor", "type": "ImageStyle['borderColor']", "description": "Color of border around the badge"}, | ||
{ | ||
"name": "labelFormatterLimit", | ||
"type": "LabelFormatterValues", | ||
"description": "Receives a number from 1 to 4, representing the label's max digit length", | ||
"note": "Beyond the max number for that digit length, a '+' will show at the end. \nIf set to a value not included in LABEL_FORMATTER_VALUES, no formatting will occur. \nExample: labelLengthFormatter={2}, label={124}, label will present '99+'" | ||
}, | ||
{"name": "icon", "type": "ImageSourcePropType", "description": "Renders an icon badge"}, | ||
{"name": "iconStyle", "type": "ImageStyle", "description": "Additional styling to badge icon"}, | ||
{"name": "iconProps", "type": "ImageProps", "description": "Additional props passed to icon"}, | ||
{"name": "customElement", "type": "JSX.Element", "description": "Custom element to render instead of an icon"}, | ||
{"name": "containerStyle", "type": "ViewStyle", "description": "Additional styles for the top container"} | ||
] | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"name": "Card.Image", | ||
"category": "basic", | ||
"description": "Inner component for the Card component (better be a direct child)", | ||
"extends": ["Image"], | ||
"extendsLink": ["https://github.com/wix/react-native-ui-lib/blob/master/src/components/image/index.tsx"], | ||
"example": "https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/CardsScreen.tsx", | ||
"props": [ | ||
{"name": "width", "type": "number", "description": "Width"}, | ||
{"name": "height", "type": "number", "description": "Height"}, | ||
{ | ||
"name": "position", | ||
"type": "string[]", | ||
"description": "The Image position which determines the appropriate flex-ness of the image and border radius (for Android) this prop derived automatically from Card parent component if it rendered as a direct child of the Card component" | ||
} | ||
] | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"name": "Card.Section", | ||
"category": "basic", | ||
"description": "Inner component for rendering content easily inside a Card component", | ||
"extends": ["View"], | ||
"extendsLink": ["https://github.com/wix/react-native-ui-lib/blob/master/src/components/view/index.tsx"], | ||
"example": "https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/CardsScreen.tsx", | ||
"props": [ | ||
{ | ||
"name": "content", | ||
"type": "ContentType[]", | ||
"description": "Text content. Example: content={[{text: 'You’re Invited!', text70: true, grey10: true}]}" | ||
}, | ||
{"name": "contentStyle", "type": "ViewStyle", "description": "Component's container style"}, | ||
{"name": "backgroundColor", "type": "string", "description": "Background color"}, | ||
{ | ||
"name": "leadingIcon", | ||
"type": "ImageProps", | ||
"description": "Image props for a leading icon to render before the text" | ||
}, | ||
{ | ||
"name": "trailingIcon", | ||
"type": "ImageProps", | ||
"description": "Image props for a trailing icon to render after the text" | ||
}, | ||
{ | ||
"name": "imageSource", | ||
"type": "ImageSourcePropType", | ||
"description": "Will be used for the background when provided" | ||
}, | ||
{"name": "imageStyle", "type": "ImageStyle", "description": "The style for the background image"}, | ||
{"name": "imageProps", "type": "ImageProps", "description": "Other image props that will be passed to the image"} | ||
] | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{ | ||
"name": "Chip", | ||
"category": "basic", | ||
"description": "Chip component", | ||
"extends": ["TouchableOpacity", "View"], | ||
"extendsLink": [ | ||
"https://github.com/wix/react-native-ui-lib/blob/master/src/components/touchableOpacity/index.tsx", | ||
"https://github.com/wix/react-native-ui-lib/blob/master/src/components/view/index.tsx" | ||
], | ||
"example": "https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/ChipScreen.tsx", | ||
"images": ["https://user-images.githubusercontent.com/1780255/119636022-e9743180-be1c-11eb-8f02-22eeab6558cd.png"], | ||
"props": [ | ||
{ | ||
"name": "size", | ||
"type": "number | {width: number, height: number}", | ||
"description": "Chip's size. Number or a width and height object" | ||
}, | ||
{"name": "onPress", "type": "(props: any) => void", "description": "On Chip press callback"}, | ||
{"name": "containerStyle", "type": "ViewStyle", "description": "Component's container style"}, | ||
{"name": "backgroundColor", "type": "string", "description": "Background color"}, | ||
{"name": "borderRadius", "type": "number", "description": "Border radius"}, | ||
{ | ||
"name": "useSizeAsMinimum", | ||
"type": "boolean", | ||
"description": "Uses size as minWidth and minHeight", | ||
"default": "true" | ||
}, | ||
{ | ||
"name": "resetSpacings", | ||
"type": "boolean", | ||
"description": "Disables all internal elements default spacings. Helps reach a custom design" | ||
}, | ||
{"name": "label", "type": "string", "description": "Main Chip text"}, | ||
{"name": "labelStyle", "type": "TextStyle", "description": "Label's style"}, | ||
{"name": "badgeProps", "type": "BadgeProps", "description": "Badge props object"}, | ||
{"name": "useCounter", "type": "boolean", "description": "Display badge as counter (no background)"}, | ||
{"name": "avatarProps", "type": "AvatarProps", "description": "Avatar props object"}, | ||
{"name": "iconProps", "type": "Omit<ImageProps, 'source'>", "description": "Additional icon props"}, | ||
{"name": "iconStyle", "type": "ImageStyle", "description": "Icon style"}, | ||
{"name": "iconSource", "type": "ImageSourcePropType", "description": "Left icon's source"}, | ||
{"name": "rightIconSource", "type": "ImageSourcePropType", "description": "Right icon's source"}, | ||
{"name": "leftElement", "type": "JSX.Element", "description": "Left custom element"}, | ||
{"name": "rightElement", "type": "JSX.Element", "description": "Right custom element"}, | ||
{ | ||
"name": "onDismiss", | ||
"type": "(props: any) => void", | ||
"description": "Adds a dismiss button and serves as its callback" | ||
}, | ||
{"name": "dismissColor", "type": "string", "description": "Dismiss color"}, | ||
{"name": "dismissIcon", "type": "ImageSourcePropType", "description": "Dismiss asset"}, | ||
{"name": "dismissIconStyle", "type": "ImageStyle", "description": "Dismiss style"}, | ||
{"name": "dismissContainerStyle", "type": "ImageStyle", "description": "Dismiss container style"}, | ||
{"name": "testID", "type": "string", "description": "The test id for e2e tests"} | ||
] | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
{ | ||
"name": "ChipsInput", | ||
"category": "form", | ||
"description": "Chips input component", | ||
"extends": ["TextField"], | ||
"extendsLink": ["https://github.com/wix/react-native-ui-lib/blob/master/src/components/textField/index.tsx"], | ||
"modifiers": ["typography"], | ||
"example": "https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/ChipsInputScreen.js", | ||
"images": ["https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/ChipsInput/ChipsInput.gif?raw=true"], | ||
"props": [ | ||
{ | ||
"name": "tags", | ||
"type": "ChipType[]", | ||
"description": "use chips instead. List of tags. can be string boolean or custom object when implementing getLabel", | ||
"deprecated": true | ||
}, | ||
{ | ||
"name": "chips", | ||
"type": "ChipsInputChipProps[]", | ||
"description": "List of tags. can be string boolean or custom object when implementing getLabel" | ||
}, | ||
{"name": "defaultChipProps", "type": "ChipsInputChipProps", "description": "Style your chips"}, | ||
{ | ||
"name": "getLabel", | ||
"type": "(tag: ChipType) => any", | ||
"description": "Callback for extracting the label out of the tag item" | ||
}, | ||
{ | ||
"name": "renderTag", | ||
"type": "(tag: ChipType, index: number, shouldMarkTag: boolean, label: string) => React.ReactElement", | ||
"description": "use chips instead. Callback for custom rendering tag item", | ||
"deprecated": true | ||
}, | ||
{"name": "onChangeTags", "type": "() => void", "description": "Callback for 'onChangeTags' event"}, | ||
{ | ||
"name": "onCreateTag", | ||
"type": "(value: any) => void", | ||
"description": "Use chips instead. callback for creating new tag out of input value (good for composing tag object)", | ||
"deprecated": true | ||
}, | ||
{ | ||
"name": "onTagPress", | ||
"type": "(index: number, toRemove?: number) => void", | ||
"description": "use chips instead. callback for when pressing a tag in the following format (tagIndex, markedTagIndex) => {...}", | ||
"deprecated": true | ||
}, | ||
{ | ||
"name": "validationErrorMessage", | ||
"type": "string", | ||
"description": "Validation message error appears when tag isn't validate" | ||
}, | ||
{"name": "disableTagRemoval", "type": "boolean", "description": "If true, tags *removal* UX won't be available"}, | ||
{ | ||
"name": "disableTagAdding", | ||
"type": "boolean", | ||
"description": "If true, tags *adding* UX (i.e. by 'submitting' the input text) won't be available" | ||
}, | ||
{"name": "tagStyle", "type": "ViewStyle", "description": "Custom styling for the tag item"}, | ||
{"name": "inputStyle", "type": "RNTextInputProps['style']", "description": "Custom styling for the text input"}, | ||
{"name": "hideUnderline", "type": "boolean", "description": "Should hide input underline"}, | ||
{"name": "maxLength", "type": "number", "description": "Maximum numbers of chips"}, | ||
{ | ||
"name": "scrollViewProps", | ||
"type": "ScrollViewProps", | ||
"description": "Chips with 'maxHeigh' is inside a ScrollView" | ||
}, | ||
{"name": "maxHeight", "type": "number", "description": "Chips inside a ScrollView"}, | ||
{ | ||
"name": "leftElement", | ||
"type": "JSX.Element | JSX.Element[]", | ||
"description": "Custom element before the chips, for example 'search' icon, 'To:' label etc'" | ||
}, | ||
{"name": "value", "type": "any", "description": "The input's value"}, | ||
{"name": "selectionColor", "type": "string | number", "description": "The color for the selection state"}, | ||
{"name": "containerStyle", "type": "ViewStyle", "description": "Component's container style"} | ||
] | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"name": "ColorPalette", | ||
"category": "form", | ||
"description": "A component for displaying a color palette", | ||
"note": "This is a screen width component", | ||
"example": "https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/ColorPickerScreen.tsx", | ||
"images": [ | ||
"https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/ColorPalette/ColorPalette.gif?raw=true" | ||
], | ||
"props": [ | ||
{"name": "colors", "type": "string[]", "description": "Array of colors to render in the palette"}, | ||
{"name": "value", "type": "string", "description": "The value of the selected swatch"}, | ||
{ | ||
"name": "usePagination", | ||
"type": "boolean", | ||
"description": "Whether to use pagination when number of colors exceeds the number of rows", | ||
"default": "true" | ||
}, | ||
{ | ||
"name": "loop", | ||
"type": "boolean", | ||
"description": "Whether the colors pagination scrolls in a loop", | ||
"default": "true" | ||
}, | ||
{"name": "numberOfRows", "type": "number", "description": "The number of color rows from 2 to 5", "default": "3"}, | ||
{ | ||
"name": "animatedIndex", | ||
"type": "number", | ||
"description": "The index of the item to animate at first render", | ||
"note": "Default is last" | ||
}, | ||
{ | ||
"name": "onValueChange", | ||
"type": "(value: string, options: object) => void", | ||
"description": "Invoked once when value changes by selecting one of the swatches in the palette" | ||
}, | ||
{"name": "swatchStyle", "type": "ViewStyle", "description": "Style to pass all the ColorSwatches in the palette"}, | ||
{"name": "containerWidth", "type": "number", "description": "The container margins"}, | ||
{"name": "containerStyle", "type": "ViewStyle", "description": "Component's container style"}, | ||
{"name": "style", "type": "ViewStyle", "description": "Component's style"}, | ||
{"name": "testID", "type": "string", "description": "The test id for e2e tests"} | ||
] | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"name": "ColorPicker", | ||
"category": "form", | ||
"description": "A picker component for color selection", | ||
"note": "This is a screen width component", | ||
"example": "https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/ColorPickerScreen.tsx", | ||
"images": [ | ||
"https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/ColorPicker/ColorPicker.gif?raw=true" | ||
], | ||
"props": [ | ||
{ | ||
"name": "colors", | ||
"type": "string[]", | ||
"description": "Array of colors for the picker's color palette (hex values)" | ||
}, | ||
{"name": "value", "type": "string", "description": "The value of the selected swatch"}, | ||
{ | ||
"name": "animatedIndex", | ||
"type": "number", | ||
"description": "The index of the item to animate at first render", | ||
"note": "Default is last" | ||
lidord-wix marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}, | ||
{ | ||
"name": "onValueChange", | ||
"type": "(value: string, options: object) => void", | ||
"description": "Callback for the picker's color palette change" | ||
}, | ||
{ | ||
"name": "accessibilityLabels", | ||
"type": "{\n addButton?: string,\n dismissButton?: string,\n doneButton?: string,\n input?: string}", | ||
"description": "Accessibility labels as an object of strings", | ||
"default": "{\n addButton: 'add custom color using hex code',\n dismissButton: 'dismiss',\n doneButton: 'done',\n input: 'custom hex color code'\n}" | ||
lidord-wix marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}, | ||
{"name": "style", "type": "ViewStyle", "description": "Component's style"}, | ||
{"name": "testID", "type": "string", "description": "The test id for e2e tests"} | ||
] | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.