@delightui/components 0.1.104 → 0.1.106
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/README.md +104 -1
- package/dist/cjs/components/molecules/Modal/DemoModal.d.ts +8 -0
- package/dist/cjs/components/molecules/Modal/ModalContext/ModalContext.d.ts +41 -0
- package/dist/cjs/components/molecules/Modal/ModalContext/ModalContext.types.d.ts +87 -0
- package/dist/cjs/components/molecules/Modal/ModalContext/index.d.ts +3 -0
- package/dist/cjs/components/molecules/Modal/ModalContext/useModal.d.ts +34 -0
- package/dist/cjs/components/molecules/Modal/index.d.ts +2 -0
- package/dist/cjs/components/molecules/Popover/Popover.presenter.d.ts +26 -0
- package/dist/cjs/components/molecules/Select/Option/Option.types.d.ts +6 -0
- package/dist/cjs/components/molecules/Select/Select.Context.d.ts +1 -1
- package/dist/cjs/components/molecules/Select/Select.d.ts +5 -5
- package/dist/cjs/components/molecules/Select/Select.presenter.d.ts +1 -0
- package/dist/cjs/components/molecules/Select/Select.types.d.ts +5 -0
- package/dist/cjs/components/molecules/Select/index.d.ts +2 -9
- package/dist/cjs/components/molecules/index.d.ts +2 -0
- package/dist/cjs/components/utils/accessibilityUtils.d.ts +41 -0
- package/dist/cjs/components/utils/index.d.ts +2 -0
- package/dist/cjs/library.css +13 -0
- package/dist/cjs/library.js +2 -2
- package/dist/cjs/library.js.map +1 -1
- package/dist/esm/components/molecules/Modal/DemoModal.d.ts +8 -0
- package/dist/esm/components/molecules/Modal/ModalContext/ModalContext.d.ts +41 -0
- package/dist/esm/components/molecules/Modal/ModalContext/ModalContext.types.d.ts +87 -0
- package/dist/esm/components/molecules/Modal/ModalContext/index.d.ts +3 -0
- package/dist/esm/components/molecules/Modal/ModalContext/useModal.d.ts +34 -0
- package/dist/esm/components/molecules/Modal/index.d.ts +2 -0
- package/dist/esm/components/molecules/Popover/Popover.presenter.d.ts +26 -0
- package/dist/esm/components/molecules/Select/Option/Option.types.d.ts +6 -0
- package/dist/esm/components/molecules/Select/Select.Context.d.ts +1 -1
- package/dist/esm/components/molecules/Select/Select.d.ts +5 -5
- package/dist/esm/components/molecules/Select/Select.presenter.d.ts +1 -0
- package/dist/esm/components/molecules/Select/Select.types.d.ts +5 -0
- package/dist/esm/components/molecules/Select/index.d.ts +2 -9
- package/dist/esm/components/molecules/index.d.ts +2 -0
- package/dist/esm/components/utils/accessibilityUtils.d.ts +41 -0
- package/dist/esm/components/utils/index.d.ts +2 -0
- package/dist/esm/library.css +13 -0
- package/dist/esm/library.js +3 -3
- package/dist/esm/library.js.map +1 -1
- package/dist/index.d.ts +156 -12
- package/docs/README.md +264 -0
- package/docs/components/atoms/ActionImage.md +119 -0
- package/docs/components/atoms/Button.md +197 -0
- package/docs/components/atoms/Checkbox.md +299 -0
- package/docs/components/atoms/CheckboxItem.md +314 -0
- package/docs/components/atoms/Chip.md +380 -0
- package/docs/components/atoms/CustomToggle.md +270 -0
- package/docs/components/atoms/Icon.md +365 -0
- package/docs/components/atoms/IconButton.md +407 -0
- package/docs/components/atoms/Image.md +448 -0
- package/docs/components/atoms/Input.md +430 -0
- package/docs/components/atoms/ListItem.md +502 -0
- package/docs/components/atoms/Password.md +472 -0
- package/docs/components/atoms/RadioButton.md +614 -0
- package/docs/components/atoms/RadioButtonItem.md +588 -0
- package/docs/components/atoms/ResponsiveComponent.md +612 -0
- package/docs/components/atoms/SelectListItem.md +609 -0
- package/docs/components/atoms/Slider.md +605 -0
- package/docs/components/atoms/Spinner.md +605 -0
- package/docs/components/atoms/Text.md +463 -0
- package/docs/components/atoms/TextArea.md +670 -0
- package/docs/components/atoms/ToastNotification.md +668 -0
- package/docs/components/atoms/Toggle.md +737 -0
- package/docs/components/atoms/ToggleButton.md +751 -0
- package/docs/components/atoms/Tooltip.md +391 -0
- package/docs/components/molecules/Accordion.md +440 -0
- package/docs/components/molecules/AccordionGroup.md +547 -0
- package/docs/components/molecules/ActionCard.md +546 -0
- package/docs/components/molecules/Breadcrumb.md +403 -0
- package/docs/components/molecules/Breadcrumbs.md +485 -0
- package/docs/components/molecules/ButtonGroup.md +383 -0
- package/docs/components/molecules/Card.md +298 -0
- package/docs/components/molecules/ChipInput.md +646 -0
- package/docs/components/molecules/ContextMenu.md +768 -0
- package/docs/components/molecules/CustomTimeSelector.md +116 -0
- package/docs/components/molecules/DatePicker.md +516 -0
- package/docs/components/molecules/DateTimeSelector.md +166 -0
- package/docs/components/molecules/FormField.md +312 -0
- package/docs/components/molecules/Grid.md +577 -0
- package/docs/components/molecules/GridItem.md +834 -0
- package/docs/components/molecules/GridList.md +244 -0
- package/docs/components/molecules/List.md +485 -0
- package/docs/components/molecules/Modal.md +470 -0
- package/docs/components/molecules/ModalFooter.md +702 -0
- package/docs/components/molecules/ModalHeader.md +756 -0
- package/docs/components/molecules/ModalProvider.md +205 -0
- package/docs/components/molecules/Nav.md +530 -0
- package/docs/components/molecules/NavItem.md +572 -0
- package/docs/components/molecules/NavLink.md +499 -0
- package/docs/components/molecules/Option.md +521 -0
- package/docs/components/molecules/Pagination.md +592 -0
- package/docs/components/molecules/PaginationNumberField.md +722 -0
- package/docs/components/molecules/Popover.md +516 -0
- package/docs/components/molecules/ProgressBar.md +624 -0
- package/docs/components/molecules/RadioGroup.md +831 -0
- package/docs/components/molecules/RepeaterList.md +185 -0
- package/docs/components/molecules/Select.md +402 -0
- package/docs/components/molecules/SortableTrigger.md +82 -0
- package/docs/components/molecules/useModal.md +379 -0
- package/docs/components/organisms/Dropzone.md +346 -0
- package/docs/components/organisms/DropzoneClear.md +135 -0
- package/docs/components/organisms/DropzoneContent.md +216 -0
- package/docs/components/organisms/DropzoneFilename.md +191 -0
- package/docs/components/organisms/DropzoneSupportedFormats.md +184 -0
- package/docs/components/organisms/DropzoneTrigger.md +209 -0
- package/docs/components/organisms/Form.md +533 -0
- package/docs/components/organisms/SlideOutPanel.md +662 -0
- package/docs/components/organisms/TabContent.md +902 -0
- package/docs/components/organisms/TabItem.md +1091 -0
- package/docs/components/organisms/Table.md +611 -0
- package/docs/components/organisms/TableBody.md +679 -0
- package/docs/components/organisms/TableCell.md +482 -0
- package/docs/components/organisms/TableHeader.md +513 -0
- package/docs/components/organisms/TableHeaderCell.md +661 -0
- package/docs/components/organisms/TableRow.md +715 -0
- package/docs/components/organisms/Tabs.md +1330 -0
- package/docs/components/utils/ConditionalView.md +568 -0
- package/docs/components/utils/RenderStateView.md +726 -0
- package/docs/components/utils/WrapTextNodes.md +614 -0
- package/package.json +3 -2
|
@@ -0,0 +1,577 @@
|
|
|
1
|
+
# Grid
|
|
2
|
+
|
|
3
|
+
## Description
|
|
4
|
+
|
|
5
|
+
A flexible CSS Grid layout component that provides a structured way to arrange child elements in rows and columns. Offers responsive grid layouts with configurable column and row counts, supporting modern CSS Grid features for complex layouts and spacing control.
|
|
6
|
+
|
|
7
|
+
## Aliases
|
|
8
|
+
|
|
9
|
+
- Grid
|
|
10
|
+
- GridLayout
|
|
11
|
+
- CSSGrid
|
|
12
|
+
- GridContainer
|
|
13
|
+
- LayoutGrid
|
|
14
|
+
|
|
15
|
+
## Props Breakdown
|
|
16
|
+
|
|
17
|
+
**Extends:** HTMLAttributes<HTMLDivElement> (inherits all div element properties)
|
|
18
|
+
|
|
19
|
+
| Prop | Type | Default | Required | Description |
|
|
20
|
+
|------|------|---------|----------|-------------|
|
|
21
|
+
| `columns` | `number` | - | No | Number of columns in the grid |
|
|
22
|
+
| `rows` | `number` | - | No | Number of rows in the grid |
|
|
23
|
+
| `children` | `ReactNode` | - | Yes | Grid items to be arranged |
|
|
24
|
+
| `className` | `string` | - | No | Additional CSS class names |
|
|
25
|
+
| `style` | `CSSProperties` | - | No | Inline styles for the grid container |
|
|
26
|
+
|
|
27
|
+
## Examples
|
|
28
|
+
|
|
29
|
+
### Basic Grid Layout
|
|
30
|
+
```tsx
|
|
31
|
+
import { Grid, GridItem, Card, Text } from '@delightui/components';
|
|
32
|
+
|
|
33
|
+
function BasicGridExample() {
|
|
34
|
+
return (
|
|
35
|
+
<Grid columns={3} className="basic-grid">
|
|
36
|
+
<GridItem>
|
|
37
|
+
<Card>
|
|
38
|
+
<Text type="Heading6">Item 1</Text>
|
|
39
|
+
<Text>First grid item</Text>
|
|
40
|
+
</Card>
|
|
41
|
+
</GridItem>
|
|
42
|
+
|
|
43
|
+
<GridItem>
|
|
44
|
+
<Card>
|
|
45
|
+
<Text type="Heading6">Item 2</Text>
|
|
46
|
+
<Text>Second grid item</Text>
|
|
47
|
+
</Card>
|
|
48
|
+
</GridItem>
|
|
49
|
+
|
|
50
|
+
<GridItem>
|
|
51
|
+
<Card>
|
|
52
|
+
<Text type="Heading6">Item 3</Text>
|
|
53
|
+
<Text>Third grid item</Text>
|
|
54
|
+
</Card>
|
|
55
|
+
</GridItem>
|
|
56
|
+
|
|
57
|
+
<GridItem>
|
|
58
|
+
<Card>
|
|
59
|
+
<Text type="Heading6">Item 4</Text>
|
|
60
|
+
<Text>Fourth grid item</Text>
|
|
61
|
+
</Card>
|
|
62
|
+
</GridItem>
|
|
63
|
+
</Grid>
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Photo Gallery Grid
|
|
69
|
+
```tsx
|
|
70
|
+
function PhotoGalleryExample() {
|
|
71
|
+
const photos = [
|
|
72
|
+
{ id: 1, src: '/photo1.jpg', title: 'Sunset Beach' },
|
|
73
|
+
{ id: 2, src: '/photo2.jpg', title: 'Mountain View' },
|
|
74
|
+
{ id: 3, src: '/photo3.jpg', title: 'City Lights' },
|
|
75
|
+
{ id: 4, src: '/photo4.jpg', title: 'Forest Path' },
|
|
76
|
+
{ id: 5, src: '/photo5.jpg', title: 'Ocean Waves' },
|
|
77
|
+
{ id: 6, src: '/photo6.jpg', title: 'Desert Dunes' }
|
|
78
|
+
];
|
|
79
|
+
|
|
80
|
+
return (
|
|
81
|
+
<div className="photo-gallery">
|
|
82
|
+
<Text type="Heading4">Photo Gallery</Text>
|
|
83
|
+
|
|
84
|
+
<Grid columns={3} className="gallery-grid">
|
|
85
|
+
{photos.map(photo => (
|
|
86
|
+
<GridItem key={photo.id}>
|
|
87
|
+
<Card className="photo-card">
|
|
88
|
+
<Image
|
|
89
|
+
src={photo.src}
|
|
90
|
+
alt={photo.title}
|
|
91
|
+
fit="Cover"
|
|
92
|
+
className="gallery-image"
|
|
93
|
+
/>
|
|
94
|
+
<div className="photo-info">
|
|
95
|
+
<Text type="BodySmall">{photo.title}</Text>
|
|
96
|
+
</div>
|
|
97
|
+
</Card>
|
|
98
|
+
</GridItem>
|
|
99
|
+
))}
|
|
100
|
+
</Grid>
|
|
101
|
+
</div>
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Dashboard Layout
|
|
107
|
+
```tsx
|
|
108
|
+
function DashboardExample() {
|
|
109
|
+
return (
|
|
110
|
+
<div className="dashboard">
|
|
111
|
+
<Text type="Heading3">Analytics Dashboard</Text>
|
|
112
|
+
|
|
113
|
+
<Grid columns={4} rows={3} className="dashboard-grid">
|
|
114
|
+
<GridItem columnSpan={2}>
|
|
115
|
+
<Card className="chart-card">
|
|
116
|
+
<Text type="Heading5">Revenue Chart</Text>
|
|
117
|
+
<div className="chart-placeholder">
|
|
118
|
+
<Text type="BodyLarge">📊 Chart goes here</Text>
|
|
119
|
+
</div>
|
|
120
|
+
</Card>
|
|
121
|
+
</GridItem>
|
|
122
|
+
|
|
123
|
+
<GridItem>
|
|
124
|
+
<Card className="metric-card">
|
|
125
|
+
<Text type="Heading6">Total Users</Text>
|
|
126
|
+
<Text type="Heading3">1,234</Text>
|
|
127
|
+
<Text type="BodySmall" className="metric-change positive">
|
|
128
|
+
+12% from last month
|
|
129
|
+
</Text>
|
|
130
|
+
</Card>
|
|
131
|
+
</GridItem>
|
|
132
|
+
|
|
133
|
+
<GridItem>
|
|
134
|
+
<Card className="metric-card">
|
|
135
|
+
<Text type="Heading6">Revenue</Text>
|
|
136
|
+
<Text type="Heading3">$45,678</Text>
|
|
137
|
+
<Text type="BodySmall" className="metric-change positive">
|
|
138
|
+
+8% from last month
|
|
139
|
+
</Text>
|
|
140
|
+
</Card>
|
|
141
|
+
</GridItem>
|
|
142
|
+
|
|
143
|
+
<GridItem columnSpan={2} rowSpan={2}>
|
|
144
|
+
<Card className="activity-card">
|
|
145
|
+
<Text type="Heading5">Recent Activity</Text>
|
|
146
|
+
<List>
|
|
147
|
+
<ListItem>User John Doe logged in</ListItem>
|
|
148
|
+
<ListItem>New order #1234 received</ListItem>
|
|
149
|
+
<ListItem>Payment processed successfully</ListItem>
|
|
150
|
+
<ListItem>User Jane Smith updated profile</ListItem>
|
|
151
|
+
</List>
|
|
152
|
+
</Card>
|
|
153
|
+
</GridItem>
|
|
154
|
+
|
|
155
|
+
<GridItem>
|
|
156
|
+
<Card className="metric-card">
|
|
157
|
+
<Text type="Heading6">Orders</Text>
|
|
158
|
+
<Text type="Heading3">89</Text>
|
|
159
|
+
<Text type="BodySmall" className="metric-change negative">
|
|
160
|
+
-3% from last month
|
|
161
|
+
</Text>
|
|
162
|
+
</Card>
|
|
163
|
+
</GridItem>
|
|
164
|
+
|
|
165
|
+
<GridItem>
|
|
166
|
+
<Card className="metric-card">
|
|
167
|
+
<Text type="Heading6">Conversion</Text>
|
|
168
|
+
<Text type="Heading3">3.4%</Text>
|
|
169
|
+
<Text type="BodySmall" className="metric-change positive">
|
|
170
|
+
+0.8% from last month
|
|
171
|
+
</Text>
|
|
172
|
+
</Card>
|
|
173
|
+
</GridItem>
|
|
174
|
+
</Grid>
|
|
175
|
+
</div>
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### Product Catalog Grid
|
|
181
|
+
```tsx
|
|
182
|
+
function ProductCatalogExample() {
|
|
183
|
+
const products = [
|
|
184
|
+
{ id: 1, name: 'Wireless Headphones', price: '$99.99', image: '/headphones.jpg', rating: 4.5 },
|
|
185
|
+
{ id: 2, name: 'Smart Watch', price: '$299.99', image: '/watch.jpg', rating: 4.8 },
|
|
186
|
+
{ id: 3, name: 'Laptop Stand', price: '$49.99', image: '/stand.jpg', rating: 4.2 },
|
|
187
|
+
{ id: 4, name: 'USB-C Hub', price: '$79.99', image: '/hub.jpg', rating: 4.6 },
|
|
188
|
+
{ id: 5, name: 'Wireless Mouse', price: '$39.99', image: '/mouse.jpg', rating: 4.3 },
|
|
189
|
+
{ id: 6, name: 'Keyboard', price: '$129.99', image: '/keyboard.jpg', rating: 4.7 }
|
|
190
|
+
];
|
|
191
|
+
|
|
192
|
+
return (
|
|
193
|
+
<div className="product-catalog">
|
|
194
|
+
<div className="catalog-header">
|
|
195
|
+
<Text type="Heading3">Featured Products</Text>
|
|
196
|
+
<Button type="Outlined">View All</Button>
|
|
197
|
+
</div>
|
|
198
|
+
|
|
199
|
+
<Grid columns={3} className="products-grid">
|
|
200
|
+
{products.map(product => (
|
|
201
|
+
<GridItem key={product.id}>
|
|
202
|
+
<Card className="product-card">
|
|
203
|
+
<Image
|
|
204
|
+
src={product.image}
|
|
205
|
+
alt={product.name}
|
|
206
|
+
className="product-image"
|
|
207
|
+
fit="Cover"
|
|
208
|
+
/>
|
|
209
|
+
|
|
210
|
+
<div className="product-info">
|
|
211
|
+
<Text type="Heading6">{product.name}</Text>
|
|
212
|
+
|
|
213
|
+
<div className="product-rating">
|
|
214
|
+
{[...Array(5)].map((_, i) => (
|
|
215
|
+
<Icon
|
|
216
|
+
key={i}
|
|
217
|
+
icon={i < Math.floor(product.rating) ? 'StarFilled' : 'Star'}
|
|
218
|
+
className="star-icon"
|
|
219
|
+
/>
|
|
220
|
+
))}
|
|
221
|
+
<Text type="BodySmall">({product.rating})</Text>
|
|
222
|
+
</div>
|
|
223
|
+
|
|
224
|
+
<div className="product-footer">
|
|
225
|
+
<Text type="Heading5" className="product-price">
|
|
226
|
+
{product.price}
|
|
227
|
+
</Text>
|
|
228
|
+
<Button size="Small">Add to Cart</Button>
|
|
229
|
+
</div>
|
|
230
|
+
</div>
|
|
231
|
+
</Card>
|
|
232
|
+
</GridItem>
|
|
233
|
+
))}
|
|
234
|
+
</Grid>
|
|
235
|
+
</div>
|
|
236
|
+
);
|
|
237
|
+
}
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
### Team Members Grid
|
|
241
|
+
```tsx
|
|
242
|
+
function TeamMembersExample() {
|
|
243
|
+
const teamMembers = [
|
|
244
|
+
{ id: 1, name: 'Sarah Johnson', role: 'Product Manager', avatar: '/sarah.jpg', email: 'sarah@company.com' },
|
|
245
|
+
{ id: 2, name: 'Mike Chen', role: 'Lead Developer', avatar: '/mike.jpg', email: 'mike@company.com' },
|
|
246
|
+
{ id: 3, name: 'Emily Davis', role: 'UX Designer', avatar: '/emily.jpg', email: 'emily@company.com' },
|
|
247
|
+
{ id: 4, name: 'Alex Rodriguez', role: 'Backend Engineer', avatar: '/alex.jpg', email: 'alex@company.com' },
|
|
248
|
+
{ id: 5, name: 'Jessica Wong', role: 'Frontend Engineer', avatar: '/jessica.jpg', email: 'jessica@company.com' },
|
|
249
|
+
{ id: 6, name: 'David Kim', role: 'DevOps Engineer', avatar: '/david.jpg', email: 'david@company.com' }
|
|
250
|
+
];
|
|
251
|
+
|
|
252
|
+
return (
|
|
253
|
+
<div className="team-section">
|
|
254
|
+
<Text type="Heading3">Meet Our Team</Text>
|
|
255
|
+
<Text>Get to know the talented individuals behind our success</Text>
|
|
256
|
+
|
|
257
|
+
<Grid columns={3} className="team-grid">
|
|
258
|
+
{teamMembers.map(member => (
|
|
259
|
+
<GridItem key={member.id}>
|
|
260
|
+
<Card className="team-member-card">
|
|
261
|
+
<div className="member-avatar">
|
|
262
|
+
<Image
|
|
263
|
+
src={member.avatar}
|
|
264
|
+
alt={member.name}
|
|
265
|
+
className="avatar-image"
|
|
266
|
+
fit="Cover"
|
|
267
|
+
/>
|
|
268
|
+
</div>
|
|
269
|
+
|
|
270
|
+
<div className="member-info">
|
|
271
|
+
<Text type="Heading6">{member.name}</Text>
|
|
272
|
+
<Text type="BodySmall" className="member-role">
|
|
273
|
+
{member.role}
|
|
274
|
+
</Text>
|
|
275
|
+
<Text type="BodySmall" className="member-email">
|
|
276
|
+
{member.email}
|
|
277
|
+
</Text>
|
|
278
|
+
</div>
|
|
279
|
+
|
|
280
|
+
<div className="member-actions">
|
|
281
|
+
<IconButton size="Small" aria-label="Send email">
|
|
282
|
+
<Icon icon="Email" />
|
|
283
|
+
</IconButton>
|
|
284
|
+
<IconButton size="Small" aria-label="View profile">
|
|
285
|
+
<Icon icon="Person" />
|
|
286
|
+
</IconButton>
|
|
287
|
+
</div>
|
|
288
|
+
</Card>
|
|
289
|
+
</GridItem>
|
|
290
|
+
))}
|
|
291
|
+
</Grid>
|
|
292
|
+
</div>
|
|
293
|
+
);
|
|
294
|
+
}
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
### Blog Posts Grid
|
|
298
|
+
```tsx
|
|
299
|
+
function BlogPostsExample() {
|
|
300
|
+
const blogPosts = [
|
|
301
|
+
{
|
|
302
|
+
id: 1,
|
|
303
|
+
title: 'Getting Started with React Hooks',
|
|
304
|
+
excerpt: 'Learn the fundamentals of React Hooks and how they can simplify your components.',
|
|
305
|
+
author: 'John Doe',
|
|
306
|
+
date: '2024-02-10',
|
|
307
|
+
image: '/blog1.jpg',
|
|
308
|
+
category: 'React'
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
id: 2,
|
|
312
|
+
title: 'CSS Grid vs Flexbox: When to Use Which',
|
|
313
|
+
excerpt: 'A comprehensive guide to choosing between CSS Grid and Flexbox for your layouts.',
|
|
314
|
+
author: 'Jane Smith',
|
|
315
|
+
date: '2024-02-08',
|
|
316
|
+
image: '/blog2.jpg',
|
|
317
|
+
category: 'CSS'
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
id: 3,
|
|
321
|
+
title: 'Building Accessible Web Applications',
|
|
322
|
+
excerpt: 'Best practices for creating web applications that work for everyone.',
|
|
323
|
+
author: 'Mike Johnson',
|
|
324
|
+
date: '2024-02-05',
|
|
325
|
+
image: '/blog3.jpg',
|
|
326
|
+
category: 'Accessibility'
|
|
327
|
+
}
|
|
328
|
+
];
|
|
329
|
+
|
|
330
|
+
return (
|
|
331
|
+
<div className="blog-section">
|
|
332
|
+
<div className="blog-header">
|
|
333
|
+
<Text type="Heading3">Latest Blog Posts</Text>
|
|
334
|
+
<Button type="Outlined">View All Posts</Button>
|
|
335
|
+
</div>
|
|
336
|
+
|
|
337
|
+
<Grid columns={2} className="blog-grid">
|
|
338
|
+
{blogPosts.map((post, index) => (
|
|
339
|
+
<GridItem key={post.id} columnSpan={index === 0 ? 2 : 1}>
|
|
340
|
+
<Card className={`blog-post-card ${index === 0 ? 'featured' : ''}`}>
|
|
341
|
+
<Image
|
|
342
|
+
src={post.image}
|
|
343
|
+
alt={post.title}
|
|
344
|
+
className="post-image"
|
|
345
|
+
fit="Cover"
|
|
346
|
+
/>
|
|
347
|
+
|
|
348
|
+
<div className="post-content">
|
|
349
|
+
<Chip size="Small" className="category-chip">
|
|
350
|
+
{post.category}
|
|
351
|
+
</Chip>
|
|
352
|
+
|
|
353
|
+
<Text type={index === 0 ? 'Heading4' : 'Heading6'}>
|
|
354
|
+
{post.title}
|
|
355
|
+
</Text>
|
|
356
|
+
|
|
357
|
+
<Text type="Body" className="post-excerpt">
|
|
358
|
+
{post.excerpt}
|
|
359
|
+
</Text>
|
|
360
|
+
|
|
361
|
+
<div className="post-meta">
|
|
362
|
+
<Text type="BodySmall">By {post.author}</Text>
|
|
363
|
+
<Text type="BodySmall">{post.date}</Text>
|
|
364
|
+
</div>
|
|
365
|
+
|
|
366
|
+
<Button type="Text" className="read-more">
|
|
367
|
+
Read More →
|
|
368
|
+
</Button>
|
|
369
|
+
</div>
|
|
370
|
+
</Card>
|
|
371
|
+
</GridItem>
|
|
372
|
+
))}
|
|
373
|
+
</Grid>
|
|
374
|
+
</div>
|
|
375
|
+
);
|
|
376
|
+
}
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
### Settings Panel Grid
|
|
380
|
+
```tsx
|
|
381
|
+
function SettingsPanelExample() {
|
|
382
|
+
const settingsSections = [
|
|
383
|
+
{
|
|
384
|
+
id: 'profile',
|
|
385
|
+
title: 'Profile Settings',
|
|
386
|
+
icon: 'Person',
|
|
387
|
+
description: 'Update your personal information and preferences'
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
id: 'security',
|
|
391
|
+
title: 'Security & Privacy',
|
|
392
|
+
icon: 'Security',
|
|
393
|
+
description: 'Manage your password and privacy settings'
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
id: 'notifications',
|
|
397
|
+
title: 'Notifications',
|
|
398
|
+
icon: 'Notifications',
|
|
399
|
+
description: 'Control how and when you receive notifications'
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
id: 'billing',
|
|
403
|
+
title: 'Billing & Plans',
|
|
404
|
+
icon: 'CreditCard',
|
|
405
|
+
description: 'View your subscription and billing information'
|
|
406
|
+
},
|
|
407
|
+
{
|
|
408
|
+
id: 'integrations',
|
|
409
|
+
title: 'Integrations',
|
|
410
|
+
icon: 'Apps',
|
|
411
|
+
description: 'Connect with third-party services and applications'
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
id: 'support',
|
|
415
|
+
title: 'Help & Support',
|
|
416
|
+
icon: 'Help',
|
|
417
|
+
description: 'Get help and contact our support team'
|
|
418
|
+
}
|
|
419
|
+
];
|
|
420
|
+
|
|
421
|
+
return (
|
|
422
|
+
<div className="settings-panel">
|
|
423
|
+
<Text type="Heading3">Settings</Text>
|
|
424
|
+
<Text>Manage your account settings and preferences</Text>
|
|
425
|
+
|
|
426
|
+
<Grid columns={2} className="settings-grid">
|
|
427
|
+
{settingsSections.map(section => (
|
|
428
|
+
<GridItem key={section.id}>
|
|
429
|
+
<Card className="settings-card" clickable>
|
|
430
|
+
<div className="settings-icon">
|
|
431
|
+
<Icon icon={section.icon} size="Large" />
|
|
432
|
+
</div>
|
|
433
|
+
|
|
434
|
+
<div className="settings-content">
|
|
435
|
+
<Text type="Heading6">{section.title}</Text>
|
|
436
|
+
<Text type="BodySmall" className="settings-description">
|
|
437
|
+
{section.description}
|
|
438
|
+
</Text>
|
|
439
|
+
</div>
|
|
440
|
+
|
|
441
|
+
<div className="settings-arrow">
|
|
442
|
+
<Icon icon="ChevronRight" />
|
|
443
|
+
</div>
|
|
444
|
+
</Card>
|
|
445
|
+
</GridItem>
|
|
446
|
+
))}
|
|
447
|
+
</Grid>
|
|
448
|
+
</div>
|
|
449
|
+
);
|
|
450
|
+
}
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
### Responsive Grid Layout
|
|
454
|
+
```tsx
|
|
455
|
+
function ResponsiveGridExample() {
|
|
456
|
+
const [viewMode, setViewMode] = useState('grid');
|
|
457
|
+
|
|
458
|
+
const items = Array.from({ length: 12 }, (_, i) => ({
|
|
459
|
+
id: i + 1,
|
|
460
|
+
title: `Item ${i + 1}`,
|
|
461
|
+
description: `Description for item ${i + 1}`
|
|
462
|
+
}));
|
|
463
|
+
|
|
464
|
+
const getGridColumns = () => {
|
|
465
|
+
switch (viewMode) {
|
|
466
|
+
case 'single':
|
|
467
|
+
return 1;
|
|
468
|
+
case 'double':
|
|
469
|
+
return 2;
|
|
470
|
+
case 'triple':
|
|
471
|
+
return 3;
|
|
472
|
+
case 'quad':
|
|
473
|
+
return 4;
|
|
474
|
+
default:
|
|
475
|
+
return 3;
|
|
476
|
+
}
|
|
477
|
+
};
|
|
478
|
+
|
|
479
|
+
return (
|
|
480
|
+
<div className="responsive-grid-demo">
|
|
481
|
+
<div className="grid-controls">
|
|
482
|
+
<Text type="Heading4">Responsive Grid Demo</Text>
|
|
483
|
+
|
|
484
|
+
<ButtonGroup>
|
|
485
|
+
<Button
|
|
486
|
+
type={viewMode === 'single' ? 'Primary' : 'Outlined'}
|
|
487
|
+
onClick={() => setViewMode('single')}
|
|
488
|
+
>
|
|
489
|
+
1 Column
|
|
490
|
+
</Button>
|
|
491
|
+
<Button
|
|
492
|
+
type={viewMode === 'double' ? 'Primary' : 'Outlined'}
|
|
493
|
+
onClick={() => setViewMode('double')}
|
|
494
|
+
>
|
|
495
|
+
2 Columns
|
|
496
|
+
</Button>
|
|
497
|
+
<Button
|
|
498
|
+
type={viewMode === 'triple' ? 'Primary' : 'Outlined'}
|
|
499
|
+
onClick={() => setViewMode('triple')}
|
|
500
|
+
>
|
|
501
|
+
3 Columns
|
|
502
|
+
</Button>
|
|
503
|
+
<Button
|
|
504
|
+
type={viewMode === 'quad' ? 'Primary' : 'Outlined'}
|
|
505
|
+
onClick={() => setViewMode('quad')}
|
|
506
|
+
>
|
|
507
|
+
4 Columns
|
|
508
|
+
</Button>
|
|
509
|
+
</ButtonGroup>
|
|
510
|
+
</div>
|
|
511
|
+
|
|
512
|
+
<Grid columns={getGridColumns()} className="responsive-grid">
|
|
513
|
+
{items.map(item => (
|
|
514
|
+
<GridItem key={item.id}>
|
|
515
|
+
<Card className="responsive-item">
|
|
516
|
+
<Text type="Heading6">{item.title}</Text>
|
|
517
|
+
<Text type="Body">{item.description}</Text>
|
|
518
|
+
<Button size="Small" type="Outlined">
|
|
519
|
+
View Details
|
|
520
|
+
</Button>
|
|
521
|
+
</Card>
|
|
522
|
+
</GridItem>
|
|
523
|
+
))}
|
|
524
|
+
</Grid>
|
|
525
|
+
</div>
|
|
526
|
+
);
|
|
527
|
+
}
|
|
528
|
+
```
|
|
529
|
+
|
|
530
|
+
### Statistics Grid
|
|
531
|
+
```tsx
|
|
532
|
+
function StatisticsGridExample() {
|
|
533
|
+
const stats = [
|
|
534
|
+
{ label: 'Total Users', value: '10,234', change: '+12%', trend: 'up' },
|
|
535
|
+
{ label: 'Revenue', value: '$45,678', change: '+8%', trend: 'up' },
|
|
536
|
+
{ label: 'Orders', value: '1,456', change: '-3%', trend: 'down' },
|
|
537
|
+
{ label: 'Conversion Rate', value: '3.2%', change: '+0.5%', trend: 'up' },
|
|
538
|
+
{ label: 'Avg. Order Value', value: '$31.40', change: '+15%', trend: 'up' },
|
|
539
|
+
{ label: 'Customer Retention', value: '87%', change: '+2%', trend: 'up' }
|
|
540
|
+
];
|
|
541
|
+
|
|
542
|
+
return (
|
|
543
|
+
<div className="statistics-dashboard">
|
|
544
|
+
<Text type="Heading3">Performance Statistics</Text>
|
|
545
|
+
|
|
546
|
+
<Grid columns={3} className="stats-grid">
|
|
547
|
+
{stats.map((stat, index) => (
|
|
548
|
+
<GridItem key={index}>
|
|
549
|
+
<Card className="stat-card">
|
|
550
|
+
<div className="stat-header">
|
|
551
|
+
<Text type="BodySmall" className="stat-label">
|
|
552
|
+
{stat.label}
|
|
553
|
+
</Text>
|
|
554
|
+
<Icon
|
|
555
|
+
icon={stat.trend === 'up' ? 'TrendingUp' : 'TrendingDown'}
|
|
556
|
+
className={`trend-icon ${stat.trend}`}
|
|
557
|
+
/>
|
|
558
|
+
</div>
|
|
559
|
+
|
|
560
|
+
<Text type="Heading3" className="stat-value">
|
|
561
|
+
{stat.value}
|
|
562
|
+
</Text>
|
|
563
|
+
|
|
564
|
+
<Text
|
|
565
|
+
type="BodySmall"
|
|
566
|
+
className={`stat-change ${stat.trend === 'up' ? 'positive' : 'negative'}`}
|
|
567
|
+
>
|
|
568
|
+
{stat.change} from last month
|
|
569
|
+
</Text>
|
|
570
|
+
</Card>
|
|
571
|
+
</GridItem>
|
|
572
|
+
))}
|
|
573
|
+
</Grid>
|
|
574
|
+
</div>
|
|
575
|
+
);
|
|
576
|
+
}
|
|
577
|
+
```
|