File size: 6,119 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
import { Card, CardHeader, CardBody, Flex, FlexItem } from '@wordpress/components';
import { ReactNode } from 'react';
import AnglePickerControlExample from './angle-picker-control';
import AnimateExample from './animate';
import BaseControlExample from './base-control';
import ButtonExample from './button';
import ButtonGroupExample from './button-group';
import CardExample from './card';
import CheckboxControlExample from './checkbox-control';
import ClipboardButtonExample from './clipboard-button';
import ColorPaletteExample from './color-palette';
import CustomSelectControlExample from './custom-select-control';
import DateTimePickerExample from './date-time-picker';
import DisabledExample from './disabled';
import DraggableExample from './draggable';
import DropdownMenuExample from './dropdown-menu';
import ExternalLinkExample from './external-link';
import FocalPointPickerExample from './focal-point-picker';
import FontSizePickerExample from './font-size-picker';
import FormFileUploadExample from './form-file-upload';
import FormToggleExample from './form-toggle';
import FormTokenFieldExample from './form-token-field';
import GuideExample from './guide';
import PanelExample from './panel';
import PlaceholderExample from './placeholder';
import QueryControlsExample from './query-controls';
import RadioControlExample from './radio-control';
import ResizableBoxExample from './resizable-box';
import SlotFillExample from './slot-fill';
import SnackbarExample from './snackbar';
import SpinnerExample from './spinner';
import TabPanelExample from './tab-panel';
import TextControlExample from './text-control';
import TextareaControlExample from './textarea-control';
import TipExample from './tip';
import ToggleControlExample from './toggle-control';
import ToolbarExample from './toolbar';
import TooltipExample from './tooltip';
import TreeSelectExample from './tree-select';
import VisuallyHiddenExample from './visually-hidden';

import './style.scss';

const ExampleComponent = ( { name, children }: { name: string; children: ReactNode } ) => (
	<FlexItem>
		<Card isElevated style={ { margin: '1rem 0' } }>
			<CardHeader>
				<strong>{ name }</strong>
			</CardHeader>
			<CardBody>{ children }</CardBody>
		</Card>
	</FlexItem>
);

const WordPressComponentsGallery = () => (
	<>
		<h1 className="wordpress-components-gallery__heading">
			The kitchen sink of WordPress components from the <code>@wordpress/components</code> package.
		</h1>
		<Flex justify="flex-start" gap={ 4 } style={ { flexWrap: 'wrap' } }>
			<ExampleComponent name="Angle Picker Control">
				<AnglePickerControlExample />
			</ExampleComponent>

			<ExampleComponent name="Animate">
				<AnimateExample />
			</ExampleComponent>

			<ExampleComponent name="Base Control">
				<BaseControlExample />
			</ExampleComponent>

			<ExampleComponent name="Button">
				<ButtonExample />
			</ExampleComponent>

			<ExampleComponent name="Button Group">
				<ButtonGroupExample />
			</ExampleComponent>

			<ExampleComponent name="Card">
				<CardExample />
			</ExampleComponent>

			<ExampleComponent name="Checkbox Control">
				<CheckboxControlExample />
			</ExampleComponent>

			<ExampleComponent name="Clipboard Button">
				<ClipboardButtonExample />
			</ExampleComponent>

			<ExampleComponent name="Color Palette">
				<ColorPaletteExample />
			</ExampleComponent>

			<ExampleComponent name="Custom Select Control">
				<CustomSelectControlExample />
			</ExampleComponent>

			<ExampleComponent name="Date Time Picker">
				<DateTimePickerExample />
			</ExampleComponent>

			<ExampleComponent name="Disabled">
				<DisabledExample />
			</ExampleComponent>

			<ExampleComponent name="Draggable">
				<DraggableExample />
			</ExampleComponent>

			<ExampleComponent name="Dropdown Menu">
				<DropdownMenuExample />
			</ExampleComponent>

			<ExampleComponent name="External Link">
				<ExternalLinkExample />
			</ExampleComponent>

			<ExampleComponent name="Focal Point Picker">
				<FocalPointPickerExample />
			</ExampleComponent>

			<ExampleComponent name="Font Size Picker">
				<FontSizePickerExample />
			</ExampleComponent>

			<ExampleComponent name="Form File Upload">
				<FormFileUploadExample />
			</ExampleComponent>

			<ExampleComponent name="Form Toggle">
				<FormToggleExample />
			</ExampleComponent>

			<ExampleComponent name="Form Token Field">
				<FormTokenFieldExample />
			</ExampleComponent>

			<ExampleComponent name="Guide">
				<GuideExample />
			</ExampleComponent>

			<ExampleComponent name="Panel">
				<PanelExample />
			</ExampleComponent>

			<ExampleComponent name="Placeholder">
				<PlaceholderExample />
			</ExampleComponent>

			<ExampleComponent name="Query Controls">
				<QueryControlsExample />
			</ExampleComponent>

			<ExampleComponent name="Radio Control">
				<RadioControlExample />
			</ExampleComponent>

			<ExampleComponent name="Resizable Box">
				<ResizableBoxExample />
			</ExampleComponent>

			<ExampleComponent name="Slot-Fill">
				<SlotFillExample />
			</ExampleComponent>

			<ExampleComponent name="Snackbar">
				<SnackbarExample />
			</ExampleComponent>

			<ExampleComponent name="Spinner">
				<SpinnerExample />
			</ExampleComponent>

			<ExampleComponent name="Tab Panel">
				<TabPanelExample />
			</ExampleComponent>

			<ExampleComponent name="Text Control">
				<TextControlExample />
			</ExampleComponent>

			<ExampleComponent name="Textarea Control">
				<TextareaControlExample />
			</ExampleComponent>

			<ExampleComponent name="Tip">
				<TipExample />
			</ExampleComponent>

			<ExampleComponent name="Toggle Control">
				<ToggleControlExample />
			</ExampleComponent>

			<ExampleComponent name="Toolbar">
				<ToolbarExample />
			</ExampleComponent>

			<ExampleComponent name="Tooltip">
				<TooltipExample />
			</ExampleComponent>

			<ExampleComponent name="Tree Select">
				<TreeSelectExample />
			</ExampleComponent>

			<ExampleComponent name="Visually Hidden">
				<VisuallyHiddenExample />
			</ExampleComponent>
		</Flex>
	</>
);

export default WordPressComponentsGallery;