|
2 | 2 | "name": "FloatingButton",
|
3 | 3 | "category": "overlays",
|
4 | 4 | "description": "Hovering button with gradient background",
|
5 |
| - "modifiers": ["margin", "background", "color"], |
| 5 | + "modifiers": [ |
| 6 | + "margin", |
| 7 | + "background", |
| 8 | + "color" |
| 9 | + ], |
6 | 10 | "example": "https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/FloatingButtonScreen.tsx",
|
7 | 11 | "images": [
|
8 | 12 | "https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/FloatingButton/FloatingButton.gif?raw=true"
|
9 | 13 | ],
|
10 | 14 | "props": [
|
11 |
| - {"name": "visible", "type": "boolean", "description": "Whether the component is visible"}, |
12 |
| - {"name": "button", "type": "ButtonProps", "description": "Props for the Button component"}, |
13 |
| - {"name": "secondaryButton", "type": "ButtonProps", "description": "Props for the secondary Button component"}, |
| 15 | + { |
| 16 | + "name": "visible", |
| 17 | + "type": "boolean", |
| 18 | + "description": "Whether the component is visible" |
| 19 | + }, |
| 20 | + { |
| 21 | + "name": "button", |
| 22 | + "type": "ButtonProps", |
| 23 | + "description": "Props for the Button component" |
| 24 | + }, |
| 25 | + { |
| 26 | + "name": "secondaryButton", |
| 27 | + "type": "ButtonProps", |
| 28 | + "description": "Props for the secondary Button component" |
| 29 | + }, |
14 | 30 | {
|
15 | 31 | "name": "bottomMargin",
|
16 | 32 | "type": "number",
|
17 | 33 | "description": "The bottom margin of the button, or secondary button if passed"
|
18 | 34 | },
|
19 |
| - {"name": "fullWidth", "type": "boolean", "description": "Whether the buttons get the container's full with", "note": "Relevant to vertical layout only"}, |
20 |
| - {"name": "buttonLayout", "type": "FloatingButtonLayouts", "description": "Button layout direction: vertical or horizontal"}, |
21 |
| - {"name": "duration", "type": "number", "description": "The duration of the button's animations (show/hide)"}, |
22 |
| - {"name": "withoutAnimation", "type": "boolean", "description": "Whether to show/hide the button without animation"}, |
23 |
| - {"name": "hideBackgroundOverlay", "type": "boolean", "description": "Whether to show background overlay"}, |
| 35 | + { |
| 36 | + "name": "fullWidth", |
| 37 | + "type": "boolean", |
| 38 | + "description": "Whether the buttons get the container's full with", |
| 39 | + "note": "Relevant to vertical layout only" |
| 40 | + }, |
| 41 | + { |
| 42 | + "name": "buttonLayout", |
| 43 | + "type": "FloatingButtonLayouts", |
| 44 | + "description": "Button layout direction: vertical or horizontal" |
| 45 | + }, |
| 46 | + { |
| 47 | + "name": "duration", |
| 48 | + "type": "number", |
| 49 | + "description": "The duration of the button's animations (show/hide)" |
| 50 | + }, |
| 51 | + { |
| 52 | + "name": "withoutAnimation", |
| 53 | + "type": "boolean", |
| 54 | + "description": "Whether to show/hide the button without animation" |
| 55 | + }, |
| 56 | + { |
| 57 | + "name": "hideBackgroundOverlay", |
| 58 | + "type": "boolean", |
| 59 | + "description": "Whether to show background overlay" |
| 60 | + }, |
24 | 61 | {
|
25 | 62 | "name": "testID",
|
26 | 63 | "type": "string",
|
|
30 | 67 | ],
|
31 | 68 | "snippet": [
|
32 | 69 | "<FloatingButton visible={isVisible$1} button={{label: 'Approve', onPress: () => console.log('approved')}}$2}/>"
|
33 |
| - ] |
| 70 | + ], |
| 71 | + "docs": { |
| 72 | + "hero": { |
| 73 | + "title": "FloatingButton", |
| 74 | + "description": "Description" |
| 75 | + }, |
| 76 | + "tabs": [ |
| 77 | + { |
| 78 | + "title": "Overview", |
| 79 | + "sections": [ |
| 80 | + { |
| 81 | + "type": "section", |
| 82 | + "title": "Usage Examples", |
| 83 | + "description": "The floating button can appear when the screen opens or after the user interacts with the screen or specific elements on it.", |
| 84 | + "content": [ |
| 85 | + { |
| 86 | + "value": "https://embed.figma.com/design/xFjvYNkGTmYTGYMLrmz9Ir/Docs-Assets?node-id=607-43542&embed-host=share" |
| 87 | + } |
| 88 | + ] |
| 89 | + }, |
| 90 | + { |
| 91 | + "type": "table", |
| 92 | + "columns": [ |
| 93 | + "Property", |
| 94 | + "Default", |
| 95 | + "markdown:`fullWidth`" |
| 96 | + ], |
| 97 | + "items": [ |
| 98 | + { |
| 99 | + "title": "Main button", |
| 100 | + "content": [ |
| 101 | + { |
| 102 | + "background": "#E8ECF0" |
| 103 | + }, |
| 104 | + { |
| 105 | + "background": "#E8ECF0" |
| 106 | + } |
| 107 | + ] |
| 108 | + }, |
| 109 | + { |
| 110 | + "title": "Main+secondary button", |
| 111 | + "content": [ |
| 112 | + { |
| 113 | + "background": "#E8ECF0" |
| 114 | + }, |
| 115 | + { |
| 116 | + "background": "#E8ECF0" |
| 117 | + } |
| 118 | + ] |
| 119 | + } |
| 120 | + ], |
| 121 | + "title": "Button Options", |
| 122 | + "description": "markdown:
The FloatingButton component can include up to two buttons: a main button and a secondary button. The main button can be set to full width using the `fullWidth` prop." |
| 123 | + }, |
| 124 | + { |
| 125 | + "type": "table", |
| 126 | + "columns": [ |
| 127 | + "Layout", |
| 128 | + "Component" |
| 129 | + ], |
| 130 | + "items": [ |
| 131 | + { |
| 132 | + "title": "Horizontal", |
| 133 | + "content": [ |
| 134 | + { |
| 135 | + "background": "#E8ECF0" |
| 136 | + } |
| 137 | + ] |
| 138 | + }, |
| 139 | + { |
| 140 | + "title": "Vertical", |
| 141 | + "content": [ |
| 142 | + { |
| 143 | + "background": "#E8ECF0" |
| 144 | + } |
| 145 | + ] |
| 146 | + } |
| 147 | + ], |
| 148 | + "title": "Layout", |
| 149 | + "description": "markdown:
When the `secondaryButton` prop is used, the layout can be configured as either vertical or horizontal. In the vertical layout, the secondary button is styled as a link button, and the main button can span the full width of the container by applying the `fullWidth` prop." |
| 150 | + } |
| 151 | + ] |
| 152 | + } |
| 153 | + ] |
| 154 | + } |
34 | 155 | }
|
0 commit comments