Skip to content

Commit 485d73a

Browse files
committed
feat: update skeleton variants
1 parent 7ed4f5b commit 485d73a

File tree

16 files changed

+140
-92
lines changed

16 files changed

+140
-92
lines changed

docs/components/example/index.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,8 @@
181181
"segmented-control-preview": "import { SegmentedControl, Segment } from \"seed-design/ui/segmented-control\";\n\nexport default function SegmentedControlPreview() {\n return (\n <SegmentedControl defaultValue=\"Hot\">\n <Segment value=\"Hot\">Hot</Segment>\n <Segment value=\"New\">New</Segment>\n </SegmentedControl>\n );\n}",
182182
"select-box-check-preview": "import { SelectBoxCheck, SelectBoxCheckGroup } from \"seed-design/ui/select-box\";\n\nexport default function SelectBoxCheckPreview() {\n return (\n <SelectBoxCheckGroup>\n <SelectBoxCheck label=\"Culpa\" defaultChecked />\n <SelectBoxCheck\n label=\"Voluptate\"\n description=\"Elit cupidatat dolore fugiat enim veniam culpa.\"\n />\n <SelectBoxCheck label=\"Eiusmod\" />\n </SelectBoxCheckGroup>\n );\n}",
183183
"select-box-radio-preview": "import { SelectBoxRadioGroup, SelectBoxRadio } from \"seed-design/ui/select-box\";\n\nexport default function SelectBoxRadioPreview() {\n return (\n <SelectBoxRadioGroup defaultValue=\"apple\" aria-label=\"과일\">\n <SelectBoxRadio value=\"apple\" label=\"Culpa\" />\n <SelectBoxRadio\n value=\"voluptate\"\n label=\"Voluptate\"\n description=\"Elit cupidatat dolore fugiat enim veniam culpa.\"\n />\n <SelectBoxRadio value=\"eiusmod\" label=\"Eiusmod\" />\n </SelectBoxRadioGroup>\n );\n}",
184-
"skeleton-circular": "import { Skeleton } from \"seed-design/ui/skeleton\";\n\nexport default function SkeletonCircle() {\n return <Skeleton shape=\"circular\" width=\"s12\" height=\"s12\" />;\n}",
185-
"skeleton-preview": "import { Flex } from \"seed-design/ui/layout\";\nimport { Skeleton } from \"seed-design/ui/skeleton\";\n\nexport default function SkeletonPreview() {\n return (\n <Flex gap=\"s4\" alignItems=\"center\">\n <Skeleton shape=\"circular\" width=\"s12\" height=\"s12\" />\n <Flex flexDirection=\"column\" gap=\"s2\">\n <Skeleton shape=\"rounded\" height=\"s4\" width=\"250px\" />\n <Skeleton shape=\"rounded\" height=\"s4\" width=\"250px\" />\n </Flex>\n </Flex>\n );\n}",
186-
"skeleton-rectangular": "import { Skeleton } from \"seed-design/ui/skeleton\";\n\nexport default function SkeletonRectangular() {\n return <Skeleton shape=\"rectangular\" width=\"s12\" height=\"s12\" />;\n}",
187-
"skeleton-rounded": "import { Skeleton } from \"seed-design/ui/skeleton\";\n\nexport default function SkeletonRounded() {\n return <Skeleton shape=\"rounded\" width=\"s12\" height=\"s12\" />;\n}",
184+
"skeleton-preview": "import { Flex } from \"seed-design/ui/layout\";\nimport { Skeleton } from \"seed-design/ui/skeleton\";\n\nexport default function SkeletonPreview() {\n return (\n <Flex gap=\"s4\" alignItems=\"center\">\n <Skeleton radius=\"full\" width=\"s12\" height=\"s12\" />\n <Flex flexDirection=\"column\" gap=\"s2\">\n <Skeleton radius=\"8\" height=\"s4\" width=\"250px\" />\n <Skeleton radius=\"8\" height=\"s4\" width=\"250px\" />\n </Flex>\n </Flex>\n );\n}",
185+
"skeleton-radius": "import { Skeleton } from \"seed-design/ui/skeleton\";\nimport { Flex } from \"seed-design/ui/layout\";\n\nexport default function SkeletonRadius() {\n return (\n <Flex gap=\"s4\" alignItems=\"center\">\n <Skeleton radius=\"0\" width=\"s12\" height=\"s12\" />\n <Skeleton radius=\"8\" width=\"s12\" height=\"s12\" />\n <Skeleton radius=\"16\" width=\"s12\" height=\"s12\" />\n <Skeleton radius=\"full\" width=\"s12\" height=\"s12\" />\n </Flex>\n );\n}",
188186
"switch-disabled": "import { Switch } from \"seed-design/ui/switch\";\n\nexport default function SwitchDisabled() {\n return (\n <div style={{ display: \"flex\", flexDirection: \"column\", gap: 10 }}>\n <Switch disabled />\n <Switch checked disabled />\n </div>\n );\n}",
189187
"switch-medium": "import { useState } from \"react\";\nimport { Switch } from \"seed-design/ui/switch\";\n\nexport default function SwitchMedium() {\n const [isChecked, setIsChecked] = useState(false);\n\n return <Switch size=\"medium\" checked={isChecked} onCheckedChange={setIsChecked} />;\n}",
190188
"switch-preview": "import { useState } from \"react\";\nimport { Switch } from \"seed-design/ui/switch\";\n\nexport default function SwitchPreview() {\n const [isChecked, setIsChecked] = useState(false);\n\n return <Switch checked={isChecked} onCheckedChange={setIsChecked} />;\n}",

docs/components/example/skeleton-circular.tsx

Lines changed: 0 additions & 5 deletions
This file was deleted.

docs/components/example/skeleton-preview.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import { Skeleton } from "seed-design/ui/skeleton";
44
export default function SkeletonPreview() {
55
return (
66
<Flex gap="s4" alignItems="center">
7-
<Skeleton shape="circular" width="s12" height="s12" />
7+
<Skeleton radius="full" width="s12" height="s12" />
88
<Flex flexDirection="column" gap="s2">
9-
<Skeleton shape="rounded" height="s4" width="250px" />
10-
<Skeleton shape="rounded" height="s4" width="250px" />
9+
<Skeleton radius="8" height="s4" width="250px" />
10+
<Skeleton radius="8" height="s4" width="250px" />
1111
</Flex>
1212
</Flex>
1313
);
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { Skeleton } from "seed-design/ui/skeleton";
2+
import { Flex } from "seed-design/ui/layout";
3+
4+
export default function SkeletonRadius() {
5+
return (
6+
<Flex gap="s4" alignItems="center">
7+
<Skeleton radius="0" width="s12" height="s12" />
8+
<Skeleton radius="8" width="s12" height="s12" />
9+
<Skeleton radius="16" width="s12" height="s12" />
10+
<Skeleton radius="full" width="s12" height="s12" />
11+
</Flex>
12+
);
13+
}

docs/components/example/skeleton-rectangular.tsx

Lines changed: 0 additions & 5 deletions
This file was deleted.

docs/components/example/skeleton-rounded.tsx

Lines changed: 0 additions & 5 deletions
This file was deleted.

docs/content/docs/react/components/skeleton.mdx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,6 @@ title: Skeleton
1414

1515
## 예제
1616

17-
### Rounded
17+
### Radius
1818

19-
<ComponentExample name="skeleton-rounded" />
20-
21-
### Rectangular
22-
23-
<ComponentExample name="skeleton-rectangular" />
24-
25-
### Circular
26-
27-
<ComponentExample name="skeleton-circular" />
19+
<ComponentExample name="skeleton-radius" />

docs/public/rootage/components/skeleton.json

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,31 @@
1717
}
1818
}
1919
},
20-
"shape=rounded": {
20+
"radius=0": {
2121
"enabled": {
2222
"root": {
23-
"cornerRadius": "$radius.s1"
23+
"cornerRadius": "0px"
2424
}
2525
}
2626
},
27-
"shape=circular": {
27+
"radius=8": {
2828
"enabled": {
2929
"root": {
30-
"cornerRadius": "$radius.full"
30+
"cornerRadius": "8px"
3131
}
3232
}
3333
},
34-
"shape=rectangular": {
34+
"radius=16": {
3535
"enabled": {
3636
"root": {
37-
"cornerRadius": 0
37+
"cornerRadius": "16px"
38+
}
39+
}
40+
},
41+
"radius=full": {
42+
"enabled": {
43+
"root": {
44+
"cornerRadius": "$radius.full"
3845
}
3946
}
4047
}

docs/public/rootage/parsed.json

Lines changed: 41 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19799,7 +19799,7 @@
1979919799
},
1980019800
{
1980119801
"key": {
19802-
"shape": "rounded"
19802+
"radius": "0"
1980319803
},
1980419804
"state": [
1980519805
{
@@ -19813,11 +19813,9 @@
1981319813
{
1981419814
"key": "cornerRadius",
1981519815
"value": {
19816-
"type": "token",
19817-
"group": [
19818-
"radius"
19819-
],
19820-
"key": "s1"
19816+
"type": "dimension",
19817+
"value": 0,
19818+
"unit": "px"
1982119819
}
1982219820
}
1982319821
]
@@ -19828,7 +19826,7 @@
1982819826
},
1982919827
{
1983019828
"key": {
19831-
"shape": "circular"
19829+
"radius": "8"
1983219830
},
1983319831
"state": [
1983419832
{
@@ -19842,11 +19840,9 @@
1984219840
{
1984319841
"key": "cornerRadius",
1984419842
"value": {
19845-
"type": "token",
19846-
"group": [
19847-
"radius"
19848-
],
19849-
"key": "full"
19843+
"type": "dimension",
19844+
"value": 8,
19845+
"unit": "px"
1985019846
}
1985119847
}
1985219848
]
@@ -19857,7 +19853,7 @@
1985719853
},
1985819854
{
1985919855
"key": {
19860-
"shape": "rectangular"
19856+
"radius": "16"
1986119857
},
1986219858
"state": [
1986319859
{
@@ -19871,8 +19867,38 @@
1987119867
{
1987219868
"key": "cornerRadius",
1987319869
"value": {
19874-
"type": "number",
19875-
"value": 0
19870+
"type": "dimension",
19871+
"value": 16,
19872+
"unit": "px"
19873+
}
19874+
}
19875+
]
19876+
}
19877+
]
19878+
}
19879+
]
19880+
},
19881+
{
19882+
"key": {
19883+
"radius": "full"
19884+
},
19885+
"state": [
19886+
{
19887+
"key": [
19888+
"enabled"
19889+
],
19890+
"slot": [
19891+
{
19892+
"key": "root",
19893+
"property": [
19894+
{
19895+
"key": "cornerRadius",
19896+
"value": {
19897+
"type": "token",
19898+
"group": [
19899+
"radius"
19900+
],
19901+
"key": "full"
1987619902
}
1987719903
}
1987819904
]

packages/qvism-preset/src/skeleton.ts

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,25 @@ const skeleton = defineRecipe({
2929
},
3030
},
3131
variants: {
32-
shape: {
33-
rounded: {
32+
radius: {
33+
0: {
3434
root: {
35-
borderRadius: vars.shapeRounded.enabled.root.cornerRadius,
35+
borderRadius: vars.radius0.enabled.root.cornerRadius,
3636
},
3737
},
38-
circular: {
38+
8: {
3939
root: {
40-
borderRadius: vars.shapeCircular.enabled.root.cornerRadius,
40+
borderRadius: vars.radius8.enabled.root.cornerRadius,
4141
},
4242
},
43-
rectangular: {
43+
16: {
4444
root: {
45-
borderRadius: vars.shapeRectangular.enabled.root.cornerRadius,
45+
borderRadius: vars.radius16.enabled.root.cornerRadius,
46+
},
47+
},
48+
full: {
49+
root: {
50+
borderRadius: vars.radiusFull.enabled.root.cornerRadius,
4651
},
4752
},
4853
},
@@ -58,7 +63,7 @@ const skeleton = defineRecipe({
5863
},
5964
},
6065
defaultVariants: {
61-
shape: "rounded",
66+
radius: 8,
6267
},
6368
});
6469

0 commit comments

Comments
 (0)