Skip to content

Commit

Permalink
refactor(ui): ♻️ refactored imports and exports & clear git cache
Browse files Browse the repository at this point in the history
  • Loading branch information
sahrohit committed Oct 25, 2023
1 parent 2af783f commit 66aedcc
Show file tree
Hide file tree
Showing 16 changed files with 69 additions and 80 deletions.
5 changes: 0 additions & 5 deletions apps/storefront/next-env.d.ts

This file was deleted.

2 changes: 1 addition & 1 deletion commitlint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const CommitLintConfiguration = {
"test",
],
],
"scope-enum": [2, "always", ["root", "admin", "api", "web", "storefront"]],
"scope-enum": [2, "always", ["root", "admin", "api", "web", "storefront", "generated-graphql", "ui"]],
"scope-case": [2, "always", "kebab-case"],
},
};
Expand Down
19 changes: 0 additions & 19 deletions packages/ui/src/Input/radio/list/ListRadioBox.tsx

This file was deleted.

56 changes: 4 additions & 52 deletions packages/ui/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,57 +1,9 @@
export * from "./hooks";
export * from "./step";
export * from "./timeline";
export * from "./input";
export * from "./modal";
export * from "./ui";

export * from "./utils/helpers";

// input folder
export { InputField, type InputFieldProps } from "./input/InputField";
export {
ButtonCheckbox,
type ButtonCheckboxProps,
} from "./input/checkbox/Checkbox";
export {
LargeButtonRadio,
type LargeButtonRadioProps,
} from "./input/radio/large/LargeButtonRadio";
export {
LargeButtonRadioGroup,
type LargeButtonRadioGroupProps,
} from "./input/radio/large/LargeButtonRadioGroup";
export { ListRadio, type ListRadioProps } from "./input/radio/list/ListRadio";
export { ListRadioBox } from "./input/radio/list/ListRadioBox";
export {
ToggleButton,
type ToggleButtonProps,
ToggleButtonGroup,
type ToggleButtonGroupProps,
} from "./input/ToggleButton";
export {
QuantitySelect,
type QuantitySelectProps,
} from "./input/QuantitySelect";

// modal folder
export { ModalButton, type ModalButtonProps } from "./modal/ModalButton";
export {
ConfirmationModal,
type ConfirmationModalProps,
} from "./modal/ConfirmationModal";

// ui folder
export { DividerWithText } from "./ui/DividerWithText";
export {
UnderlineLink,
type UnderlineLinkProps,
UnderlineButton,
type UnderlineButtonProps,
} from "./ui/UnderlineLink";
export { Result, type ResultProps } from "./ui/Result";
export { HeadingGroup, type HeadingGroupProps } from "./ui/HeadingGroup";
export {
formatPrice,
Price,
type PriceProps,
PriceTag,
type PriceTagProps,
} from "./ui/PriceTag";

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 22 additions & 0 deletions packages/ui/src/input/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
export { InputField, type InputFieldProps } from "./InputField";
export { ButtonCheckbox, type ButtonCheckboxProps } from "./checkbox/Checkbox";
export {
LargeButtonRadio,
type LargeButtonRadioProps,
} from "./radio/large/LargeButtonRadio";
export {
LargeButtonRadioGroup,
type LargeButtonRadioGroupProps,
} from "./radio/large/LargeButtonRadioGroup";
export {
ListRadio,
type ListRadioProps,
ListRadioBox,
} from "./radio/list/ListRadio";
export {
ToggleButton,
type ToggleButtonProps,
ToggleButtonGroup,
type ToggleButtonGroupProps,
} from "./ToggleButton";
export { QuantitySelect, type QuantitySelectProps } from "./QuantitySelect";
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ import {
Text,
useColorModeValue as mode,
useId,
UseRadioProps,
type UseRadioProps,
useRadio,
type BoxProps,
useColorModeValue,
} from "@chakra-ui/react";
import * as React from "react";
import { MdCheckBox, MdCheckBoxOutlineBlank } from "react-icons/md";
import { ListRadioBox } from "./ListRadioBox";

export interface ListRadioProps extends UseRadioProps {
icon: React.ReactElement;
Expand Down Expand Up @@ -64,3 +65,20 @@ export const ListRadio = (props: ListRadioProps) => {
ListRadio.defaultProps = {
anotherDescription: null,
};

export const ListRadioBox = (props: BoxProps) => (
<Box
// borderWidth="2px"
px="4"
py="3"
borderRadius="md"
cursor="pointer"
transition="all 0.2s"
_focus={{ shadow: "outline" }}
_checked={{
bg: useColorModeValue("gray.50", "whiteAlpha.100"),
borderColor: useColorModeValue("primary.500", "primary.300"),
}}
{...props}
/>
);
5 changes: 5 additions & 0 deletions packages/ui/src/modal/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export { ModalButton, type ModalButtonProps } from "./ModalButton";
export {
ConfirmationModal,
type ConfirmationModalProps,
} from "./ConfirmationModal";
16 changes: 16 additions & 0 deletions packages/ui/src/ui/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export { DividerWithText } from "./DividerWithText";
export {
UnderlineLink,
type UnderlineLinkProps,
UnderlineButton,
type UnderlineButtonProps,
} from "./UnderlineLink";
export { Result, type ResultProps } from "./Result";
export { HeadingGroup, type HeadingGroupProps } from "./HeadingGroup";
export {
formatPrice,
Price,
type PriceProps,
PriceTag,
type PriceTagProps,
} from "./PriceTag";
2 changes: 1 addition & 1 deletion packages/ui/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"@/*": ["./src/*"]
}
},
"include": ["**/*.ts", "**/*.tsx", "react-table.d.ts"],
"include": ["**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
}

2 comments on commit 66aedcc

@vercel
Copy link

@vercel vercel bot commented on 66aedcc Oct 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

ecommerce-admin-client – ./apps/admin

ecommerce-admin-client-sahrohit.vercel.app
adminpasal.vercel.app
ecommerce-admin-client-git-main-sahrohit.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 66aedcc Oct 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.