minor fixes
This commit is contained in:
parent
9cd8d50475
commit
0aafce2c5d
14
lib/components/HelloWorld.tsx
Normal file
14
lib/components/HelloWorld.tsx
Normal file
@ -0,0 +1,14 @@
|
||||
import { Typography } from "@mui/material";
|
||||
|
||||
|
||||
interface Props {
|
||||
name?: string;
|
||||
}
|
||||
|
||||
export default function HelloWorld({ name }: Props) {
|
||||
name ??= "world";
|
||||
|
||||
return (
|
||||
<Typography variant="h2">Hello {name}</Typography>
|
||||
);
|
||||
}
|
2
lib/components/index.ts
Normal file
2
lib/components/index.ts
Normal file
@ -0,0 +1,2 @@
|
||||
export * from "./HelloWorld";
|
||||
export * from "./theme";
|
141
lib/components/theme.ts
Normal file
141
lib/components/theme.ts
Normal file
@ -0,0 +1,141 @@
|
||||
import { createTheme } from "@mui/material";
|
||||
|
||||
|
||||
export const penaMuiTheme = createTheme({
|
||||
breakpoints: {
|
||||
values: {
|
||||
xs: 300,
|
||||
sm: 560,
|
||||
md: 900,
|
||||
lg: 1200,
|
||||
xl: 1536,
|
||||
},
|
||||
},
|
||||
palette: {
|
||||
mode: "light",
|
||||
primary: {
|
||||
main: "#000000",
|
||||
},
|
||||
secondary: {
|
||||
main: "#252734"
|
||||
},
|
||||
text: {
|
||||
primary: "#000000",
|
||||
secondary: "#7E2AEA",
|
||||
},
|
||||
background: {
|
||||
default: "#F2F3F7",
|
||||
},
|
||||
lightPurple: {
|
||||
main: "#333647",
|
||||
},
|
||||
darkPurple: {
|
||||
main: "#252734",
|
||||
},
|
||||
brightPurple: {
|
||||
main: "#7E2AEA",
|
||||
},
|
||||
fadePurple: {
|
||||
main: "#C19AF5",
|
||||
},
|
||||
grey1: {
|
||||
main: "#434657",
|
||||
},
|
||||
grey2: {
|
||||
main: "#9A9AAF",
|
||||
},
|
||||
grey3: {
|
||||
main: "#4D4D4D",
|
||||
},
|
||||
orange: {
|
||||
main: "#FB5607",
|
||||
},
|
||||
navbarbg: {
|
||||
main: "#FFFFFF",
|
||||
},
|
||||
},
|
||||
components: {
|
||||
MuiButton: {
|
||||
variants: [
|
||||
{
|
||||
props: { variant: "pena-contained" },
|
||||
style: ({ theme }) => theme.unstable_sx({
|
||||
borderColor: theme.palette.brightPurple.main,
|
||||
backgroundColor: theme.palette.brightPurple.main,
|
||||
width: "180px",
|
||||
paddingTop: "10px",
|
||||
paddingBottom: "10px",
|
||||
borderRadius: "8px",
|
||||
boxShadow: "none",
|
||||
// стили текста кнопки - нужны ли?
|
||||
fontSize: "18px",
|
||||
lineHeight: "24px",
|
||||
fontWeight: 400,
|
||||
textTransform: "none",
|
||||
//
|
||||
})
|
||||
}
|
||||
]
|
||||
},
|
||||
MuiTypography: {
|
||||
defaultProps: {
|
||||
variantMapping: {
|
||||
p1: "p",
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
declare module '@mui/material/Button' {
|
||||
interface ButtonPropsVariantOverrides {
|
||||
"pena-contained": true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
declare module "@mui/material/styles" {
|
||||
interface Palette {
|
||||
lightPurple: Palette["primary"],
|
||||
darkPurple: Palette["primary"],
|
||||
brightPurple: Palette["primary"],
|
||||
fadePurple: Palette["primary"],
|
||||
grey1: Palette["primary"],
|
||||
grey2: Palette["primary"],
|
||||
grey3: Palette["primary"],
|
||||
orange: Palette["primary"],
|
||||
navbarbg: Palette["primary"],
|
||||
}
|
||||
interface PaletteOptions {
|
||||
lightPurple?: PaletteOptions["primary"],
|
||||
darkPurple?: PaletteOptions["primary"],
|
||||
brightPurple?: PaletteOptions["primary"],
|
||||
fadePurple?: PaletteOptions["primary"],
|
||||
grey1?: PaletteOptions["primary"],
|
||||
grey2?: PaletteOptions["primary"],
|
||||
grey3?: PaletteOptions["primary"],
|
||||
orange?: PaletteOptions["primary"],
|
||||
navbarbg?: PaletteOptions["primary"],
|
||||
}
|
||||
interface TypographyVariants {
|
||||
infographic: React.CSSProperties;
|
||||
p1: React.CSSProperties;
|
||||
price: React.CSSProperties;
|
||||
oldPrice: React.CSSProperties;
|
||||
}
|
||||
interface TypographyVariantsOptions {
|
||||
infographic?: React.CSSProperties;
|
||||
p1?: React.CSSProperties;
|
||||
price?: React.CSSProperties;
|
||||
oldPrice?: React.CSSProperties;
|
||||
}
|
||||
}
|
||||
|
||||
declare module "@mui/material/Typography" {
|
||||
interface TypographyPropsVariantOverrides {
|
||||
infographic: true;
|
||||
p1: true;
|
||||
price: true;
|
||||
oldPrice: true;
|
||||
}
|
||||
}
|
11
package.json
11
package.json
@ -1,10 +1,10 @@
|
||||
{
|
||||
"name": "@frontend/kitui",
|
||||
"version": "1.0.21",
|
||||
"version": "1.0.23",
|
||||
"description": "test",
|
||||
"main": "./dist/index.umd.cjs",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
"types": "index.d.ts",
|
||||
"types": "./dist/index.d.ts",
|
||||
"repository": "git@penahub.gitlab.yandexcloud.net:frontend/kitui.git",
|
||||
"author": "skeris <kotilion.95@gmail.com>",
|
||||
"license": "MIT",
|
||||
@ -22,7 +22,8 @@
|
||||
"dev": "vite",
|
||||
"build": "tsc && vite build",
|
||||
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
||||
"preview": "vite preview"
|
||||
"preview": "vite preview",
|
||||
"prepublishOnly": "npm run build"
|
||||
},
|
||||
"publishConfig": {
|
||||
"registry": "https://penahub.gitlab.yandexcloud.net/api/v4/projects/21/packages/npm/"
|
||||
@ -45,7 +46,6 @@
|
||||
"eslint-plugin-react-hooks": "^4.6.0",
|
||||
"eslint-plugin-react-refresh": "^0.4.3",
|
||||
"eslint": "^8.45.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"react": "^18.2.0",
|
||||
"typescript": "^5.0.2",
|
||||
"vite-plugin-dts": "^3.5.2",
|
||||
@ -57,7 +57,6 @@
|
||||
"@emotion/styled": "^11.11.0",
|
||||
"@mui/material": "^5.14.4",
|
||||
"axios": "^1.4.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"react": "^18.2.0",
|
||||
"zustand": "^4.3.8"
|
||||
}
|
||||
|
@ -9,16 +9,19 @@ export default defineConfig({
|
||||
build: {
|
||||
lib: {
|
||||
entry: resolve(__dirname, "lib/index.ts"),
|
||||
formats: ["es"]
|
||||
formats: ["es"],
|
||||
fileName: "index"
|
||||
},
|
||||
copyPublicDir: false,
|
||||
rollupOptions: {
|
||||
external: ["axios", "react", "react-dom", "zustand"],
|
||||
// output: {
|
||||
// globals: {
|
||||
// react: "TODO"
|
||||
// },
|
||||
// },
|
||||
external: [
|
||||
"@emotion/react",
|
||||
"@emotion/styled",
|
||||
"@mui/material",
|
||||
"axios",
|
||||
"react",
|
||||
"zustand",
|
||||
],
|
||||
},
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user