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

Includes Styles Codemod scripts #180

Draft
wants to merge 24 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
3e22fc9
feat: Includes Styles Codemod scripts
Raalzz Apr 24, 2023
f768405
fix: script changes
Raalzz Apr 24, 2023
98702d6
fix: script changes
Raalzz Apr 24, 2023
0131ae1
refactor: refcator
Raalzz Apr 26, 2023
51a5f68
refactor: scripts changes
Raalzz May 10, 2023
6c58c0d
refactor: scripts changes
Raalzz May 10, 2023
b0f2e4c
refactor: scripts changes
Raalzz May 10, 2023
b4a4dd0
refactor: package.json changes
Raalzz Oct 13, 2023
5171f68
Merge branch 'main' of github.com:antstackio/hover-design into codemo…
Raalzz Oct 13, 2023
42b09d3
runs script
saurabhsutar192 Oct 13, 2023
5434c20
Merge branch 'codemod-styles' of github.com:antstackio/hover-design i…
Raalzz Oct 13, 2023
4eeda31
refactor: import statement fix
Raalzz Oct 13, 2023
c690f1b
refactor: file name convension changes
Raalzz Oct 13, 2023
ea6d48b
refactor: script run
Raalzz Oct 13, 2023
b9fdadb
refactor: chnages in import statement
Raalzz Oct 13, 2023
949afb4
refactor: import statement fix
Raalzz Oct 13, 2023
b485f85
refactor: import statement changes
Raalzz Oct 13, 2023
ce51d27
refactor: removes all css imports from react lib
Raalzz Oct 13, 2023
d10c22f
refactor: fixes global style imports
Raalzz Oct 13, 2023
6c880f1
fix: fixes all types issue in /core
Raalzz Oct 17, 2023
479aa41
refactor: fixes tokens and input component
Raalzz Oct 18, 2023
6a25728
refactor: fixed tokens and input component
Raalzz Oct 18, 2023
5020bd1
refactor: fixes type issue
Raalzz Oct 18, 2023
39c42f6
refactor: fixes node types version
Raalzz Oct 18, 2023
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
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"devDependencies": {
"@docusaurus/module-type-aliases": "2.0.1",
"@tsconfig/docusaurus": "^1.0.5",
"@types/node": "^17.0.21",
"@types/node": "^20.8.6",
"@types/react": "^18.0.6",
"typescript": "^4.6.4"
},
Expand Down
10 changes: 7 additions & 3 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,21 @@
"vanilla-extract",
"hover"
],
"scripts": {},
"scripts": {
"tsc": "tsc",
"lint": "eslint 'src/**/*.ts?(x)' --fix"
},
"dependencies": {
"@vanilla-extract/css": "^1.6.8",
"@vanilla-extract/css-utils": "^0.1.2",
"@vanilla-extract/dynamic": "^2.0.2",
"@vanilla-extract/recipes": "^0.2.3",
"@vanilla-extract/sprinkles": "^1.3.3"
"@vanilla-extract/sprinkles": "^1.3.3",
"polished": "^4.1.3"
},
"devDependencies": {
"@hover-design/eslint-config": "*",
"@types/node": "^17.0.21",
"@types/node": "^20.8.6",
"typescript": "^4.3.2"
},
"peerDependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createTheme, style } from "@vanilla-extract/css";
import { IAccordionTheme } from "./accordion.types";
import { IAccordionTheme } from "./accordion.styles.types";
import { recipe } from "@vanilla-extract/recipes";

export const [accordionThemeClass, accordionThemeVars]: IAccordionTheme =
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export type IAccordionTheme = [
string,
{ accordionTransition: string; accordionTransform: string }
];
3 changes: 3 additions & 0 deletions packages/core/src/components/Accordion/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export * from "./accordion.styles.css";
export * from "./accordion.global.styles.css";
export * from "./accordion.styles.types";
1 change: 1 addition & 0 deletions packages/core/src/components/Alert/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './alert.styles.css';
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { style, createTheme } from "@vanilla-extract/css";
import { IAvatarGroupTheme, IAvatarTheme } from "./avatar.types";
import { IAvatarGroupTheme, IAvatarTheme } from "./avatar.styles.types";

export const avatarGaps: Record<
IAvatarGroupTheme[1]["avatarStyleGap"],
Expand Down
20 changes: 20 additions & 0 deletions packages/core/src/components/Avatar/avatar.styles.types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
export type IAvatarSizes = "xs" | "sm" | "md" | "lg" | "xl";

export type IAvatarShapes = "xs" | "sm" | "md" | "lg" | "xl";

export type IAvatarGaps = "xs" | "sm" | "md" | "lg" | "xl";

export type IAvatarTheme = [
string,
{
avatarStyleColor: string;
avatarStyleTextColor: string;
avatarStyleBorderRadius: IAvatarShapes | string;
avatarStyleSize: IAvatarSizes | string;
}
];

export type IAvatarGroupTheme = [
string,
{ avatarStyleGap: IAvatarGaps | string }
];
3 changes: 3 additions & 0 deletions packages/core/src/components/Avatar/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export * from "./avatar.styles.css";
export * from "./avatar.global.styles.css";
export * from "./avatar.styles.types";
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { recipe } from "@vanilla-extract/recipes";
import { style, createTheme } from "@vanilla-extract/css";
import { IBadgeTheme } from "./badge.types";
import { IBadgeTheme } from "./badge.styles.types";

export const [badgeThemeClass, badgeThemeVars]: IBadgeTheme = createTheme({
badgeStyleColor: "none",
Expand Down
4 changes: 4 additions & 0 deletions packages/core/src/components/Badge/badge.styles.types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export type IBadgeTheme = [
string,
{ badgeStyleColor: string; badgeStyleTextColor: string }
];
2 changes: 2 additions & 0 deletions packages/core/src/components/Badge/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from "./badge.styles.css";
export * from "./badge.styles.types";
2 changes: 2 additions & 0 deletions packages/core/src/components/Banner/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './banner.styles.css';
export * from './banner.global.styles.css';
1 change: 1 addition & 0 deletions packages/core/src/components/Breadcrumb/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './breadcrumb.styles.css';
1 change: 1 addition & 0 deletions packages/core/src/components/Button/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './button.styles.css';
1 change: 1 addition & 0 deletions packages/core/src/components/Card/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './card.styles.css';
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createTheme, style } from "@vanilla-extract/css";
import { TCheckboxGroupTheme, TCheckboxTheme } from "./checkbox.types";
import { TCheckboxGroupTheme, TCheckboxTheme } from "./checkbox.styles.types";

export const checkboxGroupChildClass = style({});

Expand Down
36 changes: 36 additions & 0 deletions packages/core/src/components/Checkbox/checkbox.styles.types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
export type TCheckboxSizes = "xs" | "sm" | "md" | "lg" | "xl";

export type TCheckboxBorderRadius = "xs" | "sm" | "md" | "lg" | "xl";

export type TCheckboxSpacing = "xs" | "sm" | "md" | "lg" | "xl";

export type TCheckboxTheme = [
string,
{
disabledStyles: {
borderColor: string;
backgroundColor: string;
};
baseStyles: {
borderColor: string;
backgroundColor: string;
};
selectedStyles: {
color: string;
borderColor: string;
backgroundColor: string;
};
indeterminateStyles: {
color: string;
borderColor: string;
backgroundColor: string;
};
checkboxStyleSize: TCheckboxSizes | string;
checkboxStyleBorderRadius: TCheckboxBorderRadius | string;
}
];

export type TCheckboxGroupTheme = [
string,
{ checkboxGroupStyleSpacing: TCheckboxSpacing | string }
];
3 changes: 3 additions & 0 deletions packages/core/src/components/Checkbox/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export * from "./checkbox.styles.css";
export * from "./checkbox.global.styles.css";
export * from "./checkbox.styles.types";
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createTheme, style } from "@vanilla-extract/css";
import { IDialogTheme } from "./dialog.types";
import { TDialogTheme } from "./dialog.styles.types";

export const [dialogThemeClass, dialogThemeVars]: IDialogTheme = createTheme({
export const [dialogThemeClass, dialogThemeVars]: TDialogTheme = createTheme({
backgroundColor: "unset",
borderRadius: "4px",
boxShadow: "0 0 10px rgba(0, 0, 0, 0.5)",
Expand Down
18 changes: 18 additions & 0 deletions packages/core/src/components/Dialog/dialog.styles.types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
export type TDialogTheme = [
string,
{
backgroundColor: string;
borderRadius: string;
boxShadow: string;
position: string;
transform: string;
top: string;
bottom: string;
left: string;
right: string;
padding: string;
zIndex: string;
height: string;
width: string;
}
];
2 changes: 2 additions & 0 deletions packages/core/src/components/Dialog/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from "./dialog.styles.css";
export * from "./dialog.styles.types";
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { createTheme, style } from "@vanilla-extract/css";
import { recipe } from "@vanilla-extract/recipes";
import { DividerTheme } from "./divider.types";
import { TDividerTheme } from "./divider.styles.types";
import { calc } from "@vanilla-extract/css-utils";

export const [dividerThemeClass, dividerThemeVar]: DividerTheme = createTheme({
export const [dividerThemeClass, dividerThemeVar]: TDividerTheme = createTheme({
dividerColor: "#000",
labelColor: "#000",
labelBackground: "#fff",
Expand Down
11 changes: 11 additions & 0 deletions packages/core/src/components/Divider/divider.styles.types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export type TDividerTheme = [
string,
{
dividerColor: string;
labelColor: string;
labelBackground: string;
dividerSize: string;
dividerStyleMinHeight: string;
dividerStyleMinWidth: string;
}
];
2 changes: 2 additions & 0 deletions packages/core/src/components/Divider/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from "./divider.styles.css";
export * from "./divider.styles.types";
2 changes: 2 additions & 0 deletions packages/core/src/components/Input/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from "./input.styles.css";
export * from "./input.styles.types";
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createTheme, style } from "@vanilla-extract/css";

import { lightColors } from "../../styles/tokens";
import { IInputTheme } from "./input.types";
import { IInputTheme } from "./input.styles.types";

export const inputWrapperClass = style({
position: "relative",
Expand Down
12 changes: 12 additions & 0 deletions packages/core/src/components/Input/input.styles.types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export type IInputTheme = [
string,
{
borderColor: string;
padding: {
top: string;
right: string;
bottom: string;
left: string;
};
}
];
1 change: 1 addition & 0 deletions packages/core/src/components/Label/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './label.styles.css';
2 changes: 2 additions & 0 deletions packages/core/src/components/List/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from "./list.styles.css";
export * from "./list.styles.types";
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createTheme } from "@vanilla-extract/css";
import { recipe } from "@vanilla-extract/recipes";
import { IListTheme } from "./list.types";
export const [listThemeClass, listThemeVars]: IListTheme = createTheme({
import { TListTheme } from "./list.styles.types";
export const [listThemeClass, listThemeVars]: TListTheme = createTheme({
listStyles: {
listStyleType: "none"
}
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/components/List/list.styles.types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export type TListTheme = [string, { listStyles: { listStyleType: string } }];
1 change: 1 addition & 0 deletions packages/core/src/components/Loader/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./spinner.styles.css";
2 changes: 2 additions & 0 deletions packages/core/src/components/Modal/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from "./modal.styles.css";
export * from "./modal.styles.types";
Original file line number Diff line number Diff line change
@@ -1,8 +1,26 @@
import { createTheme, style } from "@vanilla-extract/css";
import { sizes } from "./modal.constants";
import { IModalTheme } from "./modal.types";
import { TModalTheme } from "./modal.styles.types";

export const [modalThemeClass, modalThemeVars]: IModalTheme = createTheme({
export const ModalSizes = {
sm: {
width: "320px"
},
md: {
width: "440px"
},
lg: {
width: "550px"
},
xl: {
width: "720px"
},
full: {
height: "100%",
width: "100%"
}
};

export const [modalThemeClass, modalThemeVars]: TModalTheme = createTheme({
base: {
backgroundColor: "#fff",
borderRadius: "4px",
Expand All @@ -15,7 +33,7 @@ export const [modalThemeClass, modalThemeVars]: IModalTheme = createTheme({
right: "unset",
padding: "12px",
zIndex: "10",
width: sizes.md.width,
width: ModalSizes.md.width,
height: "auto"
},
overlay: {
Expand Down
31 changes: 31 additions & 0 deletions packages/core/src/components/Modal/modal.styles.types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
export type TModalTheme = [
string,
{
base: {
backgroundColor: string;
borderRadius: string;
boxShadow: string;
position: string;
transform: string;
top: string;
bottom: string;
left: string;
right: string;
padding: string;
zIndex: string;
width: string;
height: string;
};
overlay: {
backgroundColor: string;
zIndex: string;
position: string;
top: string;
left: string;
right: string;
bottom: string;
opacity: string;
filter: string;
};
}
];
2 changes: 2 additions & 0 deletions packages/core/src/components/NativeSelect/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from "./nativeSelect.styles.css";
export * from "./nativeSelect.styles.types";
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createTheme, style } from "@vanilla-extract/css";
import { recipe } from "@vanilla-extract/recipes";
import { NativeSelectThemeType } from "./nativeSelect.types";
import { NativeSelectThemeType } from "./nativeSelect.styles.types";

export const [nativeSelectThemeClass, nativeSelectVars]: NativeSelectThemeType =
createTheme({
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export type NativeSelectThemeType = [
string,
{
height: string;
width: string;
borderRadius: string;
}
];
1 change: 1 addition & 0 deletions packages/core/src/components/Popover/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './popover.styles.css';
1 change: 1 addition & 0 deletions packages/core/src/components/Portal/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './portal.styles.css';
2 changes: 2 additions & 0 deletions packages/core/src/components/Progress/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from "./progress.styles.css";
export * from "./progress.styles.types";
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createTheme, style } from "@vanilla-extract/css";
import { IProgressTheme } from "./progress.types";
import { TProgressTheme } from "./progress.styles.types";

export const progressRadiusMap: Record<IProgressTheme[1]["radius"], string> = {
export const progressRadiusMap: Record<TProgressTheme[1]["radius"], string> = {
xs: "1px",
sm: "2px",
md: "4px",
Expand All @@ -10,7 +10,7 @@ export const progressRadiusMap: Record<IProgressTheme[1]["radius"], string> = {
};

export const progressSizes: Record<
IProgressTheme[1]["progressStyleSize"],
TProgressTheme[1]["progressStyleSize"],
string
> = {
xs: "3px",
Expand All @@ -20,7 +20,7 @@ export const progressSizes: Record<
xl: "16px"
};

export const [progressThemeClass, progressThemeVars]: IProgressTheme =
export const [progressThemeClass, progressThemeVars]: TProgressTheme =
createTheme({
radius: progressRadiusMap.md,
progressStyleSize: progressSizes.md,
Expand Down
Loading
Loading