@ceed/cds 1.29.0 → 1.30.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/dist/Overview.md +5 -5
- package/dist/components/Calendar/utils/index.d.ts +1 -0
- package/dist/components/DatePicker/DatePicker.d.ts +4 -0
- package/dist/components/DateRangePicker/DateRangePicker.d.ts +4 -0
- package/dist/components/MonthRangePicker/MonthRangePicker.d.ts +8 -0
- package/dist/components/data-display/Avatar.md +110 -69
- package/dist/components/data-display/Badge.md +91 -39
- package/dist/components/data-display/Chip.md +49 -20
- package/dist/components/data-display/DataTable.md +93 -0
- package/dist/components/data-display/InfoSign.md +12 -0
- package/dist/components/data-display/Table.md +72 -55
- package/dist/components/data-display/Tooltip.md +40 -40
- package/dist/components/data-display/Typography.md +53 -70
- package/dist/components/feedback/Alert.md +88 -72
- package/dist/components/feedback/CircularProgress.md +17 -0
- package/dist/components/feedback/Skeleton.md +17 -0
- package/dist/components/inputs/Button.md +94 -68
- package/dist/components/inputs/ButtonGroup.md +17 -0
- package/dist/components/inputs/Calendar.md +118 -457
- package/dist/components/inputs/Checkbox.md +185 -430
- package/dist/components/inputs/CurrencyInput.md +22 -0
- package/dist/components/inputs/DatePicker.md +59 -5
- package/dist/components/inputs/DateRangePicker.md +46 -5
- package/dist/components/inputs/FilterableCheckboxGroup.md +20 -3
- package/dist/components/inputs/FormControl.md +32 -2
- package/dist/components/inputs/IconButton.md +18 -0
- package/dist/components/inputs/Input.md +198 -136
- package/dist/components/inputs/MonthPicker.md +59 -5
- package/dist/components/inputs/MonthRangePicker.md +44 -5
- package/dist/components/inputs/PercentageInput.md +25 -0
- package/dist/components/inputs/RadioButton.md +23 -0
- package/dist/components/inputs/RadioList.md +20 -1
- package/dist/components/inputs/RadioTileGroup.md +37 -3
- package/dist/components/inputs/Select.md +56 -0
- package/dist/components/inputs/Slider.md +23 -0
- package/dist/components/inputs/Switch.md +20 -0
- package/dist/components/inputs/Textarea.md +32 -8
- package/dist/components/inputs/Uploader/Uploader.md +21 -0
- package/dist/components/layout/Box.md +52 -41
- package/dist/components/layout/Grid.md +87 -81
- package/dist/components/layout/Stack.md +88 -68
- package/dist/components/navigation/Breadcrumbs.md +57 -46
- package/dist/components/navigation/Drawer.md +17 -0
- package/dist/components/navigation/Dropdown.md +13 -0
- package/dist/components/navigation/IconMenuButton.md +17 -0
- package/dist/components/navigation/InsetDrawer.md +130 -292
- package/dist/components/navigation/Link.md +78 -0
- package/dist/components/navigation/Menu.md +17 -0
- package/dist/components/navigation/MenuButton.md +18 -0
- package/dist/components/navigation/Pagination.md +13 -0
- package/dist/components/navigation/Stepper.md +15 -0
- package/dist/components/navigation/Tabs.md +27 -0
- package/dist/components/surfaces/Accordions.md +804 -49
- package/dist/components/surfaces/Card.md +173 -97
- package/dist/components/surfaces/Divider.md +246 -82
- package/dist/components/surfaces/Sheet.md +15 -0
- package/dist/index.browser.js +4 -4
- package/dist/index.browser.js.map +3 -3
- package/dist/index.cjs +99 -39
- package/dist/index.js +99 -39
- package/framer/index.js +1 -1
- package/package.json +1 -1
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Introduction
|
|
4
4
|
|
|
5
|
-
Card is a
|
|
6
|
-
|
|
7
|
-
The Card component is composed of several sub-components -- `CardContent`, `CardActions`, `CardCover`, and `CardOverflow` -- that work together to create rich, flexible layouts. It supports multiple variants, colors, and sizes for full visual customization.
|
|
5
|
+
The Card component is a UI element that groups related content and actions within a single container. It helps users scan and understand information more easily by structuring and visually grouping it. It is commonly used for news feeds, product lists, user profiles, dashboard widgets, and more.
|
|
8
6
|
|
|
9
7
|
```tsx
|
|
10
8
|
<Card {...args} sx={{
|
|
@@ -26,26 +24,25 @@ The Card component is composed of several sub-components -- `CardContent`, `Card
|
|
|
26
24
|
## Usage
|
|
27
25
|
|
|
28
26
|
```tsx
|
|
29
|
-
import { Card, CardContent, CardActions,
|
|
27
|
+
import { Card, CardContent, CardActions, CardCover, CardOverflow } from '@ceed/cds';
|
|
30
28
|
|
|
31
29
|
function MyComponent() {
|
|
32
30
|
return (
|
|
33
31
|
<Card sx={{ maxWidth: 320 }}>
|
|
34
32
|
<CardContent>
|
|
35
|
-
<Typography level="title-lg"
|
|
36
|
-
<Typography level="body-md"
|
|
33
|
+
<Typography level="title-lg">카드 제목</Typography>
|
|
34
|
+
<Typography level="body-md">카드의 내용이 들어갑니다.</Typography>
|
|
37
35
|
</CardContent>
|
|
38
|
-
<CardActions>
|
|
39
|
-
<Button size="sm">Action</Button>
|
|
40
|
-
</CardActions>
|
|
41
36
|
</Card>
|
|
42
37
|
);
|
|
43
38
|
}
|
|
44
39
|
```
|
|
45
40
|
|
|
46
|
-
##
|
|
41
|
+
## Examples
|
|
42
|
+
|
|
43
|
+
### Basic Usage
|
|
47
44
|
|
|
48
|
-
The
|
|
45
|
+
The most basic way to use a card.
|
|
49
46
|
|
|
50
47
|
```tsx
|
|
51
48
|
<div style={{
|
|
@@ -66,9 +63,9 @@ The simplest form of a Card with a title and description inside CardContent.
|
|
|
66
63
|
</div>
|
|
67
64
|
```
|
|
68
65
|
|
|
69
|
-
|
|
66
|
+
### Variants
|
|
70
67
|
|
|
71
|
-
|
|
68
|
+
Provides various style variants.
|
|
72
69
|
|
|
73
70
|
```tsx
|
|
74
71
|
<div style={{
|
|
@@ -114,9 +111,9 @@ Four style variants -- `solid`, `soft`, `outlined`, and `plain` -- allow you to
|
|
|
114
111
|
</div>
|
|
115
112
|
```
|
|
116
113
|
|
|
117
|
-
|
|
114
|
+
### Colors
|
|
118
115
|
|
|
119
|
-
|
|
116
|
+
You can apply various colors.
|
|
120
117
|
|
|
121
118
|
```tsx
|
|
122
119
|
<div style={{
|
|
@@ -171,9 +168,9 @@ Apply semantic colors to convey meaning: `primary`, `neutral`, `danger`, `succes
|
|
|
171
168
|
</div>
|
|
172
169
|
```
|
|
173
170
|
|
|
174
|
-
|
|
171
|
+
### Sizes
|
|
175
172
|
|
|
176
|
-
|
|
173
|
+
You can adjust the size.
|
|
177
174
|
|
|
178
175
|
```tsx
|
|
179
176
|
<div style={{
|
|
@@ -211,9 +208,9 @@ Three sizes are available: `sm`, `md`, and `lg`. The size affects internal paddi
|
|
|
211
208
|
</div>
|
|
212
209
|
```
|
|
213
210
|
|
|
214
|
-
|
|
211
|
+
### With Cover
|
|
215
212
|
|
|
216
|
-
|
|
213
|
+
A card that uses the `CardCover` component to display an image as the background.
|
|
217
214
|
|
|
218
215
|
```tsx
|
|
219
216
|
<div style={{
|
|
@@ -257,9 +254,9 @@ Use `CardCover` to place a full-bleed background image behind the card content,
|
|
|
257
254
|
</div>
|
|
258
255
|
```
|
|
259
256
|
|
|
260
|
-
|
|
257
|
+
### With Actions
|
|
261
258
|
|
|
262
|
-
|
|
259
|
+
You can place action buttons at the bottom.
|
|
263
260
|
|
|
264
261
|
```tsx
|
|
265
262
|
<div style={{
|
|
@@ -308,9 +305,9 @@ Use `CardCover` to place a full-bleed background image behind the card content,
|
|
|
308
305
|
</div>
|
|
309
306
|
```
|
|
310
307
|
|
|
311
|
-
|
|
308
|
+
### With Overflow
|
|
312
309
|
|
|
313
|
-
`CardOverflow`
|
|
310
|
+
Use `CardOverflow` to display content that extends beyond the card's padded boundary.
|
|
314
311
|
|
|
315
312
|
```tsx
|
|
316
313
|
<div style={{
|
|
@@ -445,9 +442,9 @@ Use `CardCover` to place a full-bleed background image behind the card content,
|
|
|
445
442
|
</div>
|
|
446
443
|
```
|
|
447
444
|
|
|
448
|
-
|
|
445
|
+
### Interactive Cards
|
|
449
446
|
|
|
450
|
-
|
|
447
|
+
Interactive cards with click behavior and hover effects.
|
|
451
448
|
|
|
452
449
|
```tsx
|
|
453
450
|
<div style={{
|
|
@@ -485,9 +482,9 @@ Add hover effects and click handlers to create cards that respond to user intera
|
|
|
485
482
|
</div>
|
|
486
483
|
```
|
|
487
484
|
|
|
488
|
-
|
|
485
|
+
### Media Cards
|
|
489
486
|
|
|
490
|
-
|
|
487
|
+
Media cards used with images.
|
|
491
488
|
|
|
492
489
|
```tsx
|
|
493
490
|
<div style={{
|
|
@@ -562,9 +559,9 @@ Combine `CardOverflow` with `AspectRatio` to create product or media cards with
|
|
|
562
559
|
</div>
|
|
563
560
|
```
|
|
564
561
|
|
|
565
|
-
|
|
562
|
+
### Complex Layout
|
|
566
563
|
|
|
567
|
-
|
|
564
|
+
A social-media-style card with a complex layout.
|
|
568
565
|
|
|
569
566
|
```tsx
|
|
570
567
|
<div style={{
|
|
@@ -632,95 +629,174 @@ Compose multiple sub-components together to build rich, social-media-style card
|
|
|
632
629
|
</div>
|
|
633
630
|
```
|
|
634
631
|
|
|
635
|
-
##
|
|
632
|
+
## Card Components
|
|
633
|
+
|
|
634
|
+
Card is composed of several subcomponents:
|
|
635
|
+
|
|
636
|
+
### Card
|
|
636
637
|
|
|
637
|
-
|
|
638
|
+
The main card container.
|
|
638
639
|
|
|
639
640
|
```tsx
|
|
640
|
-
|
|
641
|
+
<Card variant="outlined" color="neutral" size="md">
|
|
642
|
+
{/* card content */}
|
|
643
|
+
</Card>
|
|
644
|
+
```
|
|
641
645
|
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
<Typography level="title-lg">{name}</Typography>
|
|
652
|
-
<Typography level="body-md">{description}</Typography>
|
|
653
|
-
<Typography level="title-lg" color="primary">
|
|
654
|
-
{price}
|
|
655
|
-
</Typography>
|
|
656
|
-
</CardContent>
|
|
657
|
-
<CardActions>
|
|
658
|
-
<Button variant="solid" fullWidth>
|
|
659
|
-
Add to Cart
|
|
660
|
-
</Button>
|
|
661
|
-
</CardActions>
|
|
662
|
-
</Card>
|
|
663
|
-
);
|
|
664
|
-
}
|
|
646
|
+
### CardContent
|
|
647
|
+
|
|
648
|
+
The area that contains the card's primary content.
|
|
649
|
+
|
|
650
|
+
```tsx
|
|
651
|
+
<CardContent>
|
|
652
|
+
<Typography level="title-lg">제목</Typography>
|
|
653
|
+
<Typography level="body-md">내용</Typography>
|
|
654
|
+
</CardContent>
|
|
665
655
|
```
|
|
666
656
|
|
|
667
|
-
###
|
|
657
|
+
### CardCover
|
|
658
|
+
|
|
659
|
+
Displays background media or an image that covers the entire card.
|
|
668
660
|
|
|
669
661
|
```tsx
|
|
670
|
-
|
|
662
|
+
<CardCover>
|
|
663
|
+
<img src="image.jpg" alt="Cover" />
|
|
664
|
+
</CardCover>
|
|
665
|
+
```
|
|
671
666
|
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
<Button size="sm" variant="soft">Follow</Button>
|
|
682
|
-
<Button size="sm" variant="solid">Message</Button>
|
|
683
|
-
</CardActions>
|
|
684
|
-
</Card>
|
|
685
|
-
);
|
|
686
|
-
}
|
|
667
|
+
### CardActions
|
|
668
|
+
|
|
669
|
+
The area used to place action buttons.
|
|
670
|
+
|
|
671
|
+
```tsx
|
|
672
|
+
<CardActions>
|
|
673
|
+
<Button>확인</Button>
|
|
674
|
+
<Button>취소</Button>
|
|
675
|
+
</CardActions>
|
|
687
676
|
```
|
|
688
677
|
|
|
689
|
-
###
|
|
678
|
+
### CardOverflow
|
|
679
|
+
|
|
680
|
+
An area that ignores the card's padding and uses the full width.
|
|
690
681
|
|
|
691
682
|
```tsx
|
|
692
|
-
|
|
683
|
+
<CardOverflow>
|
|
684
|
+
<AspectRatio ratio="3/4">
|
|
685
|
+
<img src="full-width-image.jpg" alt="Full width" />
|
|
686
|
+
</AspectRatio>
|
|
687
|
+
</CardOverflow>
|
|
688
|
+
```
|
|
693
689
|
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
690
|
+
## Common Use Cases
|
|
691
|
+
|
|
692
|
+
### Product Cards
|
|
693
|
+
|
|
694
|
+
```tsx
|
|
695
|
+
<Card sx={{ maxWidth: 320 }}>
|
|
696
|
+
<CardOverflow>
|
|
697
|
+
<AspectRatio ratio="1">
|
|
698
|
+
<img src="product.jpg" alt="Product" />
|
|
699
|
+
</AspectRatio>
|
|
700
|
+
</CardOverflow>
|
|
701
|
+
<CardContent>
|
|
702
|
+
<Typography level="title-lg">제품명</Typography>
|
|
703
|
+
<Typography level="body-md">제품 설명</Typography>
|
|
704
|
+
<Typography level="title-lg" color="primary">
|
|
705
|
+
₩199,000
|
|
706
|
+
</Typography>
|
|
707
|
+
</CardContent>
|
|
708
|
+
<CardActions>
|
|
709
|
+
<Button variant="solid" fullWidth>
|
|
710
|
+
구매하기
|
|
711
|
+
</Button>
|
|
712
|
+
</CardActions>
|
|
713
|
+
</Card>
|
|
714
|
+
```
|
|
715
|
+
|
|
716
|
+
### User Profile Cards
|
|
717
|
+
|
|
718
|
+
```tsx
|
|
719
|
+
<Card sx={{ maxWidth: 320 }}>
|
|
720
|
+
<CardContent sx={{ alignItems: 'center', textAlign: 'center' }}>
|
|
721
|
+
<Avatar size="lg" src="profile.jpg" />
|
|
722
|
+
<Typography level="title-lg">사용자 이름</Typography>
|
|
723
|
+
<Typography level="body-sm">직책</Typography>
|
|
724
|
+
</CardContent>
|
|
725
|
+
<CardActions>
|
|
726
|
+
<Button size="sm" variant="soft">
|
|
727
|
+
팔로우
|
|
728
|
+
</Button>
|
|
729
|
+
<Button size="sm" variant="solid">
|
|
730
|
+
메시지
|
|
731
|
+
</Button>
|
|
732
|
+
</CardActions>
|
|
733
|
+
</Card>
|
|
734
|
+
```
|
|
735
|
+
|
|
736
|
+
### News Cards
|
|
737
|
+
|
|
738
|
+
```tsx
|
|
739
|
+
<Card sx={{ maxWidth: 400 }}>
|
|
740
|
+
<CardOverflow>
|
|
741
|
+
<AspectRatio ratio="3/2">
|
|
742
|
+
<img src="news.jpg" alt="News" />
|
|
743
|
+
</AspectRatio>
|
|
744
|
+
</CardOverflow>
|
|
745
|
+
<CardContent>
|
|
746
|
+
<Typography level="body-xs" color="neutral">
|
|
747
|
+
뉴스 · 2시간 전
|
|
748
|
+
</Typography>
|
|
749
|
+
<Typography level="title-md">뉴스 제목</Typography>
|
|
750
|
+
<Typography level="body-sm">뉴스 요약...</Typography>
|
|
751
|
+
</CardContent>
|
|
752
|
+
</Card>
|
|
753
|
+
```
|
|
754
|
+
|
|
755
|
+
### Dashboard Widget Cards
|
|
756
|
+
|
|
757
|
+
```tsx
|
|
758
|
+
<Card variant="soft" color="primary">
|
|
759
|
+
<CardContent>
|
|
760
|
+
<Typography level="body-sm">총 사용자</Typography>
|
|
761
|
+
<Typography level="h2">1,234</Typography>
|
|
762
|
+
<Typography level="body-xs">+12% from last month</Typography>
|
|
763
|
+
</CardContent>
|
|
764
|
+
</Card>
|
|
705
765
|
```
|
|
706
766
|
|
|
767
|
+
## Props and Customization
|
|
768
|
+
|
|
769
|
+
### Key Props
|
|
770
|
+
|
|
771
|
+
| Prop | Type | Default | Description |
|
|
772
|
+
| ---------------- | -------------------------------------------------------------- | ------------ | -------------------------------------------------------- |
|
|
773
|
+
| `children` | `ReactNode` | - | Card content (CardContent, CardCover, CardActions, etc.) |
|
|
774
|
+
| `variant` | `'solid' \| 'soft' \| 'outlined' \| 'plain'` | `'outlined'` | Visual style |
|
|
775
|
+
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Card size (affects padding) |
|
|
776
|
+
| `color` | `'primary' \| 'neutral' \| 'danger' \| 'success' \| 'warning'` | `'neutral'` | Color scheme |
|
|
777
|
+
| `orientation` | `'horizontal' \| 'vertical'` | `'vertical'` | Card layout direction |
|
|
778
|
+
| `invertedColors` | `boolean` | `false` | Invert child component colors |
|
|
779
|
+
| `sx` | `SxProps` | - | Custom styles |
|
|
780
|
+
|
|
781
|
+
> **Note**: Card also accepts all Joy UI Card props and Framer Motion props.
|
|
782
|
+
|
|
707
783
|
## Best Practices
|
|
708
784
|
|
|
709
|
-
|
|
785
|
+
1. **Use an appropriate size**: Set a size that fits the card content. If it is too large or too small, readability suffers.
|
|
786
|
+
|
|
787
|
+
2. **Keep styles consistent**: Cards used in the same context should share consistent `variant`, `color`, and `size` values.
|
|
710
788
|
|
|
711
|
-
|
|
789
|
+
3. **Create clear hierarchy**: Use Typography levels to build a visual hierarchy based on the importance of the information.
|
|
712
790
|
|
|
713
|
-
|
|
714
|
-
- ✔ `alt="Red running shoes, side view"`
|
|
715
|
-
- ✘ `alt="image"` or missing alt
|
|
791
|
+
4. **Use proper spacing**: When listing multiple cards, keep enough space between them so each one is clearly distinguishable.
|
|
716
792
|
|
|
717
|
-
|
|
793
|
+
5. **Consider accessibility**:
|
|
794
|
+
- Support keyboard navigation when cards are clickable
|
|
795
|
+
- Provide appropriate `alt` text for images
|
|
796
|
+
- Do not rely on color alone to communicate information
|
|
718
797
|
|
|
719
|
-
|
|
798
|
+
6. **Use responsive design**: Use `maxWidth` or responsive props so cards work well across different screen sizes.
|
|
720
799
|
|
|
721
|
-
|
|
800
|
+
7. **Handle loading states**: Use Skeleton components to represent loading states while data is being fetched.
|
|
722
801
|
|
|
723
|
-
|
|
724
|
-
- Provide meaningful `alt` text for all images. Decorative images should use `alt=""` to be skipped by screen readers.
|
|
725
|
-
- Use proper heading levels inside cards (`level="title-lg"`, `level="title-md"`) to maintain the document's heading hierarchy.
|
|
726
|
-
- Ensure sufficient color contrast between card backgrounds and text, especially when using `variant="solid"` with colored themes.
|
|
802
|
+
8. **Limit action buttons**: Include only primary actions directly related to the card in `CardActions`. Too many buttons can create confusion.
|