From 66aedcce2a6663fe31b368377065c1be3a1a8daf Mon Sep 17 00:00:00 2001 From: Rohit Sah Date: Wed, 25 Oct 2023 21:57:06 +0545 Subject: [PATCH] refactor(ui): :recycle: refactored imports and exports & clear git cache --- apps/storefront/next-env.d.ts | 5 -- commitlint.config.js | 2 +- .../ui/src/Input/radio/list/ListRadioBox.tsx | 19 ------- packages/ui/src/index.tsx | 56 ++----------------- .../ui/src/{Input => input}/InputField.tsx | 0 .../src/{Input => input}/QuantitySelect.tsx | 0 .../ui/src/{Input => input}/ToggleButton.tsx | 0 .../{Input => input}/checkbox/Checkbox.tsx | 0 .../{Input => input}/checkbox/CheckboxBox.tsx | 0 packages/ui/src/input/index.tsx | 22 ++++++++ .../radio/large/LargeButtonRadio.tsx | 0 .../radio/large/LargeButtonRadioGroup.tsx | 0 .../{Input => input}/radio/list/ListRadio.tsx | 22 +++++++- packages/ui/src/modal/index.tsx | 5 ++ packages/ui/src/ui/index.tsx | 16 ++++++ packages/ui/tsconfig.json | 2 +- 16 files changed, 69 insertions(+), 80 deletions(-) delete mode 100644 apps/storefront/next-env.d.ts delete mode 100644 packages/ui/src/Input/radio/list/ListRadioBox.tsx rename packages/ui/src/{Input => input}/InputField.tsx (100%) rename packages/ui/src/{Input => input}/QuantitySelect.tsx (100%) rename packages/ui/src/{Input => input}/ToggleButton.tsx (100%) rename packages/ui/src/{Input => input}/checkbox/Checkbox.tsx (100%) rename packages/ui/src/{Input => input}/checkbox/CheckboxBox.tsx (100%) create mode 100644 packages/ui/src/input/index.tsx rename packages/ui/src/{Input => input}/radio/large/LargeButtonRadio.tsx (100%) rename packages/ui/src/{Input => input}/radio/large/LargeButtonRadioGroup.tsx (100%) rename packages/ui/src/{Input => input}/radio/list/ListRadio.tsx (80%) create mode 100644 packages/ui/src/modal/index.tsx create mode 100644 packages/ui/src/ui/index.tsx diff --git a/apps/storefront/next-env.d.ts b/apps/storefront/next-env.d.ts deleted file mode 100644 index 4f11a03..0000000 --- a/apps/storefront/next-env.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -/// -/// - -// NOTE: This file should not be edited -// see https://nextjs.org/docs/basic-features/typescript for more information. diff --git a/commitlint.config.js b/commitlint.config.js index 8db5e7d..1d9ceed 100644 --- a/commitlint.config.js +++ b/commitlint.config.js @@ -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"], }, }; diff --git a/packages/ui/src/Input/radio/list/ListRadioBox.tsx b/packages/ui/src/Input/radio/list/ListRadioBox.tsx deleted file mode 100644 index 296780f..0000000 --- a/packages/ui/src/Input/radio/list/ListRadioBox.tsx +++ /dev/null @@ -1,19 +0,0 @@ -/* eslint-disable import/prefer-default-export */ -import { Box, BoxProps, useColorModeValue } from "@chakra-ui/react"; - -export const ListRadioBox = (props: BoxProps) => ( - -); diff --git a/packages/ui/src/index.tsx b/packages/ui/src/index.tsx index ac27d69..db82e2b 100644 --- a/packages/ui/src/index.tsx +++ b/packages/ui/src/index.tsx @@ -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"; + \ No newline at end of file diff --git a/packages/ui/src/Input/InputField.tsx b/packages/ui/src/input/InputField.tsx similarity index 100% rename from packages/ui/src/Input/InputField.tsx rename to packages/ui/src/input/InputField.tsx diff --git a/packages/ui/src/Input/QuantitySelect.tsx b/packages/ui/src/input/QuantitySelect.tsx similarity index 100% rename from packages/ui/src/Input/QuantitySelect.tsx rename to packages/ui/src/input/QuantitySelect.tsx diff --git a/packages/ui/src/Input/ToggleButton.tsx b/packages/ui/src/input/ToggleButton.tsx similarity index 100% rename from packages/ui/src/Input/ToggleButton.tsx rename to packages/ui/src/input/ToggleButton.tsx diff --git a/packages/ui/src/Input/checkbox/Checkbox.tsx b/packages/ui/src/input/checkbox/Checkbox.tsx similarity index 100% rename from packages/ui/src/Input/checkbox/Checkbox.tsx rename to packages/ui/src/input/checkbox/Checkbox.tsx diff --git a/packages/ui/src/Input/checkbox/CheckboxBox.tsx b/packages/ui/src/input/checkbox/CheckboxBox.tsx similarity index 100% rename from packages/ui/src/Input/checkbox/CheckboxBox.tsx rename to packages/ui/src/input/checkbox/CheckboxBox.tsx diff --git a/packages/ui/src/input/index.tsx b/packages/ui/src/input/index.tsx new file mode 100644 index 0000000..daa8615 --- /dev/null +++ b/packages/ui/src/input/index.tsx @@ -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"; diff --git a/packages/ui/src/Input/radio/large/LargeButtonRadio.tsx b/packages/ui/src/input/radio/large/LargeButtonRadio.tsx similarity index 100% rename from packages/ui/src/Input/radio/large/LargeButtonRadio.tsx rename to packages/ui/src/input/radio/large/LargeButtonRadio.tsx diff --git a/packages/ui/src/Input/radio/large/LargeButtonRadioGroup.tsx b/packages/ui/src/input/radio/large/LargeButtonRadioGroup.tsx similarity index 100% rename from packages/ui/src/Input/radio/large/LargeButtonRadioGroup.tsx rename to packages/ui/src/input/radio/large/LargeButtonRadioGroup.tsx diff --git a/packages/ui/src/Input/radio/list/ListRadio.tsx b/packages/ui/src/input/radio/list/ListRadio.tsx similarity index 80% rename from packages/ui/src/Input/radio/list/ListRadio.tsx rename to packages/ui/src/input/radio/list/ListRadio.tsx index d453b51..cf5b4cc 100644 --- a/packages/ui/src/Input/radio/list/ListRadio.tsx +++ b/packages/ui/src/input/radio/list/ListRadio.tsx @@ -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; @@ -64,3 +65,20 @@ export const ListRadio = (props: ListRadioProps) => { ListRadio.defaultProps = { anotherDescription: null, }; + +export const ListRadioBox = (props: BoxProps) => ( + +); diff --git a/packages/ui/src/modal/index.tsx b/packages/ui/src/modal/index.tsx new file mode 100644 index 0000000..eeb7239 --- /dev/null +++ b/packages/ui/src/modal/index.tsx @@ -0,0 +1,5 @@ +export { ModalButton, type ModalButtonProps } from "./ModalButton"; +export { + ConfirmationModal, + type ConfirmationModalProps, +} from "./ConfirmationModal"; diff --git a/packages/ui/src/ui/index.tsx b/packages/ui/src/ui/index.tsx new file mode 100644 index 0000000..d57f2c5 --- /dev/null +++ b/packages/ui/src/ui/index.tsx @@ -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"; diff --git a/packages/ui/tsconfig.json b/packages/ui/tsconfig.json index e298001..1e8bc54 100644 --- a/packages/ui/tsconfig.json +++ b/packages/ui/tsconfig.json @@ -6,6 +6,6 @@ "@/*": ["./src/*"] } }, - "include": ["**/*.ts", "**/*.tsx", "react-table.d.ts"], + "include": ["**/*.ts", "**/*.tsx"], "exclude": ["node_modules"] }