-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- rename SegmentedControlSegment to SegmentedControlItem - remove placeholder slot - move indicator definition to root
- Loading branch information
Showing
41 changed files
with
612 additions
and
437 deletions.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
@@ -1,10 +1,10 @@ | ||
import { SegmentedControl, SegmentedControlSegment } from "seed-design/ui/segmented-control"; | ||
import { SegmentedControl, SegmentedControlItem } from "seed-design/ui/segmented-control"; | ||
|
||
export default function SegmentedControlPreview() { | ||
return ( | ||
<SegmentedControl defaultValue="Hot" disabled aria-label="Sort by"> | ||
<SegmentedControlSegment value="Hot">Hot</SegmentedControlSegment> | ||
<SegmentedControlSegment value="New">New</SegmentedControlSegment> | ||
<SegmentedControlItem value="Hot">Hot</SegmentedControlItem> | ||
<SegmentedControlItem value="New">New</SegmentedControlItem> | ||
</SegmentedControl> | ||
); | ||
} |
This file contains 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 |
---|---|---|
@@ -1,10 +1,10 @@ | ||
import { SegmentedControl, SegmentedControlSegment } from "seed-design/ui/segmented-control"; | ||
import { SegmentedControl, SegmentedControlItem } from "seed-design/ui/segmented-control"; | ||
|
||
export default function SegmentedControlFixedWidth() { | ||
return ( | ||
<SegmentedControl defaultValue="new" style={{ width: "600px" }} aria-label="Sort by"> | ||
<SegmentedControlSegment value="new">New</SegmentedControlSegment> | ||
<SegmentedControlSegment value="hot">Hot</SegmentedControlSegment> | ||
<SegmentedControlItem value="new">New</SegmentedControlItem> | ||
<SegmentedControlItem value="hot">Hot</SegmentedControlItem> | ||
</SegmentedControl> | ||
); | ||
} |
8 changes: 4 additions & 4 deletions
8
docs/components/example/segmented-control-long-label-fixed-width.tsx
This file contains 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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import { SegmentedControl, SegmentedControlSegment } from "seed-design/ui/segmented-control"; | ||
import { SegmentedControl, SegmentedControlItem } from "seed-design/ui/segmented-control"; | ||
|
||
export default function SegmentedControlLongLabelFixedWidth() { | ||
return ( | ||
<SegmentedControl defaultValue="price" style={{ width: "600px" }} aria-label="정렬 기준"> | ||
<SegmentedControlSegment value="price">가격 높은 순</SegmentedControlSegment> | ||
<SegmentedControlSegment value="discount">할인율 높은 순</SegmentedControlSegment> | ||
<SegmentedControlSegment value="popularity">인기 많은 순</SegmentedControlSegment> | ||
<SegmentedControlItem value="price">가격 높은 순</SegmentedControlItem> | ||
<SegmentedControlItem value="discount">할인율 높은 순</SegmentedControlItem> | ||
<SegmentedControlItem value="popularity">인기 많은 순</SegmentedControlItem> | ||
</SegmentedControl> | ||
); | ||
} |
This file contains 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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import { SegmentedControl, SegmentedControlSegment } from "seed-design/ui/segmented-control"; | ||
import { SegmentedControl, SegmentedControlItem } from "seed-design/ui/segmented-control"; | ||
|
||
export default function SegmentedControlLongLabel() { | ||
return ( | ||
<SegmentedControl defaultValue="price" aria-label="정렬 기준"> | ||
<SegmentedControlSegment value="price">가격 높은 순</SegmentedControlSegment> | ||
<SegmentedControlSegment value="discount">할인율 높은 순</SegmentedControlSegment> | ||
<SegmentedControlSegment value="popularity">인기 많은 순</SegmentedControlSegment> | ||
<SegmentedControlItem value="price">가격 높은 순</SegmentedControlItem> | ||
<SegmentedControlItem value="discount">할인율 높은 순</SegmentedControlItem> | ||
<SegmentedControlItem value="popularity">인기 많은 순</SegmentedControlItem> | ||
</SegmentedControl> | ||
); | ||
} |
This file contains 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 |
---|---|---|
@@ -1,10 +1,10 @@ | ||
import { SegmentedControl, SegmentedControlSegment } from "seed-design/ui/segmented-control"; | ||
import { SegmentedControl, SegmentedControlItem } from "seed-design/ui/segmented-control"; | ||
|
||
export default function SegmentedControlPreview() { | ||
return ( | ||
<SegmentedControl defaultValue="Hot" aria-label="Sort by"> | ||
<SegmentedControlSegment value="Hot">Hot</SegmentedControlSegment> | ||
<SegmentedControlSegment value="New">New</SegmentedControlSegment> | ||
<SegmentedControlItem value="Hot">Hot</SegmentedControlItem> | ||
<SegmentedControlItem value="New">New</SegmentedControlItem> | ||
</SegmentedControl> | ||
); | ||
} |
This file contains 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 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
107 changes: 107 additions & 0 deletions
107
docs/public/rootage-next/components/segmented-control-item.json
This file contains 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,107 @@ | ||
{ | ||
"kind": "ComponentSpec", | ||
"metadata": { | ||
"id": "segmented-control-item", | ||
"name": "Segmented Control Item" | ||
}, | ||
"data": { | ||
"id": "segmented-control-item", | ||
"name": "Segmented Control Item", | ||
"definitions": [ | ||
{ | ||
"variants": {}, | ||
"definitions": [ | ||
{ | ||
"states": [ | ||
"enabled" | ||
], | ||
"slots": { | ||
"root": { | ||
"height": { | ||
"type": "dimension", | ||
"value": "$dimension.s8" | ||
}, | ||
"cornerRadius": { | ||
"type": "dimension", | ||
"value": "$radius.full" | ||
}, | ||
"paddingX": { | ||
"type": "dimension", | ||
"value": "$dimension.s4" | ||
}, | ||
"minWidth": { | ||
"type": "dimension", | ||
"value": { | ||
"value": 86, | ||
"unit": "px" | ||
} | ||
} | ||
}, | ||
"label": { | ||
"fontSize": { | ||
"type": "dimension", | ||
"value": "$font-size.s5" | ||
}, | ||
"lineHeight": { | ||
"type": "dimension", | ||
"value": "$line-height.s5" | ||
}, | ||
"fontWeight": { | ||
"type": "number", | ||
"value": "$font-weight.medium" | ||
}, | ||
"color": { | ||
"type": "color", | ||
"value": "$color.fg.neutral-muted" | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"states": [ | ||
"pressed" | ||
], | ||
"slots": { | ||
"root": { | ||
"color": { | ||
"type": "color", | ||
"value": "$color.bg.neutral-weak-pressed" | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"states": [ | ||
"selected" | ||
], | ||
"slots": { | ||
"label": { | ||
"fontWeight": { | ||
"type": "number", | ||
"value": "$font-weight.bold" | ||
}, | ||
"color": { | ||
"type": "color", | ||
"value": "$color.fg.neutral" | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"states": [ | ||
"disabled" | ||
], | ||
"slots": { | ||
"label": { | ||
"color": { | ||
"type": "color", | ||
"value": "$color.fg.disabled" | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} |
This file contains 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
41 changes: 41 additions & 0 deletions
41
docs/public/rootage/components/segmented-control-item.json
This file contains 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,41 @@ | ||
{ | ||
"kind": "ComponentSpec", | ||
"metadata": { | ||
"id": "segmented-control-item", | ||
"name": "Segmented Control Item" | ||
}, | ||
"data": { | ||
"base": { | ||
"enabled": { | ||
"root": { | ||
"height": "$dimension.s8", | ||
"cornerRadius": "$radius.full", | ||
"paddingX": "$dimension.s4", | ||
"minWidth": "86px" | ||
}, | ||
"label": { | ||
"fontSize": "$font-size.s5", | ||
"lineHeight": "$line-height.s5", | ||
"fontWeight": "$font-weight.medium", | ||
"color": "$color.fg.neutral-muted" | ||
} | ||
}, | ||
"pressed": { | ||
"root": { | ||
"color": "$color.bg.neutral-weak-pressed" | ||
} | ||
}, | ||
"selected": { | ||
"label": { | ||
"fontWeight": "$font-weight.bold", | ||
"color": "$color.fg.neutral" | ||
} | ||
}, | ||
"disabled": { | ||
"label": { | ||
"color": "$color.fg.disabled" | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains 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
Oops, something went wrong.