Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(ui/react): styles/utilities wrap를 textWrap로 수정, package.json에 utilities.css exports 추가 #240

Merged
merged 4 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { heading } from '@favolink-ui/react/heading.css';
import { heading } from '@favolink-ui/react/utilities.css';
import { vars } from '@favolink-ui/react/vars.css';
import { style } from '@vanilla-extract/css';

Expand Down
3 changes: 1 addition & 2 deletions packages/ui/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
"./reset.css": "./src/styles/reset.css.ts",
"./vars.css": "./src/styles/vars.css.ts",
"./theme.css": "./src/styles/theme.css.ts",
"./body.css": "./src/styles/utilities/body.css.ts",
"./heading.css": "./src/styles/utilities/heading.css.ts"
"./utilities.css": "./src/styles/utilities/index.ts"
},
"scripts": {
"lint": "eslint \"**/*.{js,jsx,cjs,mjs,ts,tsx,cts,mts}\""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import {
color,
heading,
textAlign,
textWrap,
truncate,
wrap,
} from '../../styles/utilities';

export const headingVariants = recipe({
Expand All @@ -15,7 +15,7 @@ export const headingVariants = recipe({
truncate: {
true: [truncate],
},
wrap,
wrap: textWrap,
},

defaultVariants: {
Expand Down
10 changes: 8 additions & 2 deletions packages/ui/react/src/components/typography/text.styles.css.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import { type RecipeVariants, recipe } from '@vanilla-extract/recipes';
import { body, color, textAlign, truncate, wrap } from '../../styles/utilities';
import {
body,
color,
textAlign,
textWrap,
truncate,
} from '../../styles/utilities';

export const textVariants = recipe({
variants: {
Expand All @@ -9,7 +15,7 @@ export const textVariants = recipe({
truncate: {
true: [truncate],
},
wrap,
wrap: textWrap,
},

defaultVariants: {
Expand Down
25 changes: 0 additions & 25 deletions packages/ui/react/src/styles/utilities/body.css.ts

This file was deleted.

43 changes: 0 additions & 43 deletions packages/ui/react/src/styles/utilities/color.css.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/ui/react/src/styles/utilities/enum/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ export * from './letter-spacing.css';
export * from './overflow.css';
export * from './position.css';
export * from './text-align.css';
export * from './text-wrap.css';
export * from './truncate.css';
export * from './wrap.css';
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { styleVariants } from '@vanilla-extract/css';

export const wrap = styleVariants({
export const textWrap = styleVariants({
wrap: { whiteSpace: 'normal' },
nowrap: { whiteSpace: 'nowrap' },
});
4 changes: 2 additions & 2 deletions packages/ui/react/src/styles/utilities/enum/truncate.css.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { style } from '@vanilla-extract/css';
import { wrap } from './wrap.css';
import { textWrap } from './text-wrap.css';

export const truncate = style([
wrap.nowrap,
textWrap.nowrap,
{
overflow: 'hidden',
textOverflow: 'ellipsis',
Expand Down
31 changes: 0 additions & 31 deletions packages/ui/react/src/styles/utilities/heading.css.ts

This file was deleted.

This file was deleted.

13 changes: 0 additions & 13 deletions packages/ui/react/src/styles/utilities/text-align.css.ts

This file was deleted.

10 changes: 0 additions & 10 deletions packages/ui/react/src/styles/utilities/truncate.css.ts

This file was deleted.

10 changes: 0 additions & 10 deletions packages/ui/react/src/styles/utilities/wrap.css.ts

This file was deleted.

Loading