Skip to content

Commit 3796eda

Browse files
committed
refactor(66): namespace import로 변경
1 parent db55ec1 commit 3796eda

File tree

6 files changed

+28
-36
lines changed

6 files changed

+28
-36
lines changed

src/components/ui/Bleed/Bleed.css.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export const bleedInlineEndVar = createVar();
55
export const bleedBlockStartVar = createVar();
66
export const bleedBlockEndVar = createVar();
77

8-
export const bleedStyles = style({
8+
export const container = style({
99
marginInlineStart: `calc(${bleedInlineStartVar} * -1)`,
1010
marginInlineEnd: `calc(${bleedInlineEndVar} * -1)`,
1111
marginBlockStart: `calc(${bleedBlockStartVar} * -1)`,

src/components/ui/Bleed/Bleed.tsx

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,7 @@ import { type ElementType } from "react";
44
import { coerceCssRemValue } from "@/lib/utils/coerceCssRemValue";
55
import { type PolymorphicComponentPropsWithRef } from "@/types/polymorphic.types";
66

7-
import {
8-
bleedBlockEndVar,
9-
bleedBlockStartVar,
10-
bleedInlineEndVar,
11-
bleedInlineStartVar,
12-
bleedStyles,
13-
} from "./Bleed.css";
7+
import * as styles from "./Bleed.css";
148

159
export type BleedProps<T extends ElementType> =
1610
PolymorphicComponentPropsWithRef<
@@ -43,27 +37,31 @@ export const Bleed = <T extends ElementType = "div">({
4337
...styleFromProps,
4438
...assignInlineVars({
4539
...(inline && {
46-
[bleedInlineStartVar]: coerceCssRemValue(inline),
47-
[bleedInlineEndVar]: coerceCssRemValue(inline),
40+
[styles.bleedInlineStartVar]: coerceCssRemValue(inline),
41+
[styles.bleedInlineEndVar]: coerceCssRemValue(inline),
4842
}),
4943
...(block && {
50-
[bleedBlockStartVar]: coerceCssRemValue(block),
51-
[bleedBlockEndVar]: coerceCssRemValue(block),
44+
[styles.bleedBlockStartVar]: coerceCssRemValue(block),
45+
[styles.bleedBlockEndVar]: coerceCssRemValue(block),
5246
}),
5347
...(inlineStart && {
54-
[bleedInlineStartVar]: coerceCssRemValue(inlineStart),
48+
[styles.bleedInlineStartVar]: coerceCssRemValue(inlineStart),
49+
}),
50+
...(inlineEnd && {
51+
[styles.bleedInlineEndVar]: coerceCssRemValue(inlineEnd),
5552
}),
56-
...(inlineEnd && { [bleedInlineEndVar]: coerceCssRemValue(inlineEnd) }),
5753
...(blockStart && {
58-
[bleedBlockStartVar]: coerceCssRemValue(blockStart),
54+
[styles.bleedBlockStartVar]: coerceCssRemValue(blockStart),
55+
}),
56+
...(blockEnd && {
57+
[styles.bleedBlockEndVar]: coerceCssRemValue(blockEnd),
5958
}),
60-
...(blockEnd && { [bleedBlockEndVar]: coerceCssRemValue(blockEnd) }),
6159
}),
6260
};
6361

6462
return (
6563
<Component
66-
className={`${bleedStyles} ${className ?? ""}`.trim()}
64+
className={`${styles.container} ${className ?? ""}`.trim()}
6765
style={style}
6866
{...props}
6967
/>

src/components/ui/Stack/Stack.css.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { recipe, type RecipeVariants } from "@vanilla-extract/recipes";
33

44
export const stackGapVar = createVar();
55

6-
export const stackStyles = recipe({
6+
export const container = recipe({
77
base: {
88
display: "flex",
99
gap: stackGapVar,
@@ -62,4 +62,4 @@ export const stackStyles = recipe({
6262
},
6363
});
6464

65-
export type StackVariants = RecipeVariants<typeof stackStyles>;
65+
export type StackVariants = RecipeVariants<typeof container>;

src/components/ui/Stack/Stack.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ import { type ElementType } from "react";
44
import { coerceCssRemValue } from "@/lib/utils/coerceCssRemValue";
55
import { type PolymorphicComponentPropsWithRef } from "@/types/polymorphic.types";
66

7-
import { stackGapVar, stackStyles, type StackVariants } from "./Stack.css";
7+
import * as styles from "./Stack.css";
88

99
export type StackProps<T extends ElementType> =
1010
PolymorphicComponentPropsWithRef<
1111
T,
12-
StackVariants & {
12+
styles.StackVariants & {
1313
gap?: number | string;
1414
}
1515
>;
@@ -42,14 +42,14 @@ export const Stack = <T extends ElementType = "div">({
4242
const style = {
4343
...styleFromProps,
4444
...assignInlineVars({
45-
[stackGapVar]: gap ? coerceCssRemValue(gap) : undefined,
45+
[styles.stackGapVar]: gap ? coerceCssRemValue(gap) : undefined,
4646
}),
4747
};
4848

4949
return (
5050
<Component
5151
ref={ref}
52-
className={`${stackStyles({
52+
className={`${styles.container({
5353
direction,
5454
justify,
5555
align,

src/components/ui/Text/Text.css.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export const lineHeightVar = createVar();
55
export const letterSpacingVar = createVar();
66
export const colorVar = createVar();
77

8-
export const textStyles = style({
8+
export const container = style({
99
color: colorVar,
1010
fontSize: fontSizeVar,
1111
lineHeight: lineHeightVar,

src/components/ui/Text/Text.tsx

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,7 @@ import { type ElementType } from "react";
44
import { colors, semantic, typography } from "@/styles";
55
import { type PolymorphicComponentPropsWithRef } from "@/types/polymorphic.types";
66

7-
import {
8-
colorVar,
9-
fontSizeVar,
10-
letterSpacingVar,
11-
lineHeightVar,
12-
textStyles,
13-
} from "./Text.css";
7+
import * as styles from "./Text.css";
148

159
type DotNestedKeys<T> = (
1610
T extends object
@@ -93,16 +87,16 @@ export const Text = <T extends ElementType = "p">({
9387
const style = {
9488
...styleFromProps,
9589
...assignInlineVars({
96-
[fontSizeVar]: typography[typo]?.fontSize,
97-
[lineHeightVar]: typography[typo]?.lineHeight,
98-
[letterSpacingVar]: typography[typo]?.letterSpacing,
99-
[colorVar]: color ? resolveColor(color) : undefined,
90+
[styles.fontSizeVar]: typography[typo]?.fontSize,
91+
[styles.lineHeightVar]: typography[typo]?.lineHeight,
92+
[styles.letterSpacingVar]: typography[typo]?.letterSpacing,
93+
[styles.colorVar]: color ? resolveColor(color) : undefined,
10094
}),
10195
};
10296

10397
return (
10498
<Component
105-
className={`${textStyles} ${className ?? ""}`.trim()}
99+
className={`${styles.container} ${className ?? ""}`.trim()}
106100
style={style}
107101
ref={ref}
108102
{...rest}

0 commit comments

Comments
 (0)