@mitodl/smoot-design 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +142 -0
- package/.github/workflows/ci.yml +48 -0
- package/.github/workflows/publish-pages.yml +50 -0
- package/.github/workflows/release.yml +34 -0
- package/.github/workflows/validate-pr.yml +49 -0
- package/.pre-commit-config.yaml +90 -0
- package/.prettierignore +1 -0
- package/.prettierrc.json +4 -0
- package/.releaserc.json +40 -0
- package/.secrets.baseline +113 -0
- package/.storybook/main.ts +46 -0
- package/.storybook/manager-head.html +1 -0
- package/.storybook/preview-head.html +5 -0
- package/.storybook/preview.tsx +15 -0
- package/.storybook/public/pexels-photo-1851188.webp +0 -0
- package/.yarn/releases/yarn-4.5.1.cjs +934 -0
- package/.yarnrc.yml +23 -0
- package/LICENSE +28 -0
- package/README.md +13 -0
- package/jest.config.ts +22 -0
- package/package.json +110 -0
- package/src/components/Button/ActionButton.stories.tsx +186 -0
- package/src/components/Button/Button.stories.tsx +275 -0
- package/src/components/Button/Button.test.tsx +56 -0
- package/src/components/Button/Button.tsx +418 -0
- package/src/components/LinkAdapter/LinkAdapter.tsx +38 -0
- package/src/components/ThemeProvider/ThemeProvider.stories.tsx +94 -0
- package/src/components/ThemeProvider/ThemeProvider.tsx +127 -0
- package/src/components/ThemeProvider/Typography.stories.tsx +74 -0
- package/src/components/ThemeProvider/breakpoints.ts +20 -0
- package/src/components/ThemeProvider/buttons.ts +22 -0
- package/src/components/ThemeProvider/chips.tsx +167 -0
- package/src/components/ThemeProvider/colors.ts +33 -0
- package/src/components/ThemeProvider/typography.ts +174 -0
- package/src/index.ts +24 -0
- package/src/jest-setup.ts +0 -0
- package/src/story-utils/index.ts +28 -0
- package/src/types/theme.d.ts +106 -0
- package/src/types/typography.d.ts +54 -0
- package/tsconfig.json +26 -0
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import type { Theme as MuiTheme } from "@mui/material/styles"
|
|
2
|
+
import "@emotion/react"
|
|
3
|
+
import "@emotion/styled"
|
|
4
|
+
import "./typography"
|
|
5
|
+
|
|
6
|
+
export interface ColorGroup {
|
|
7
|
+
main: string
|
|
8
|
+
highlight: string
|
|
9
|
+
contrastText: string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface CustomTheme {
|
|
13
|
+
transitionDuration: string
|
|
14
|
+
shadow: string
|
|
15
|
+
colors: {
|
|
16
|
+
mitRed: string
|
|
17
|
+
silverGray: string
|
|
18
|
+
brightRed: string
|
|
19
|
+
black: string
|
|
20
|
+
white: string
|
|
21
|
+
darkGray2: string
|
|
22
|
+
darkGray1: string
|
|
23
|
+
silverGrayDark: string
|
|
24
|
+
silverGrayLight: string
|
|
25
|
+
lightGray2: string
|
|
26
|
+
lightGray1: string
|
|
27
|
+
navGray: string
|
|
28
|
+
darkPink: string
|
|
29
|
+
pink: string
|
|
30
|
+
lightPink: string
|
|
31
|
+
darkPurple: string
|
|
32
|
+
purple: string
|
|
33
|
+
lightPurple: string
|
|
34
|
+
darkBlue: string
|
|
35
|
+
blue: string
|
|
36
|
+
lightBlue: string
|
|
37
|
+
darkGreen: string
|
|
38
|
+
green: string
|
|
39
|
+
lightGreen: string
|
|
40
|
+
darkRed: string
|
|
41
|
+
red: string
|
|
42
|
+
lightRed: string
|
|
43
|
+
orange: string
|
|
44
|
+
yellow: string
|
|
45
|
+
}
|
|
46
|
+
dimensions: {
|
|
47
|
+
headerHeight: string
|
|
48
|
+
headerHeightSm: string
|
|
49
|
+
}
|
|
50
|
+
LinkAdapter?: React.ElementType
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* https://mui.com/material-ui/customization/theming/#typescript */
|
|
54
|
+
declare module "@mui/material/styles" {
|
|
55
|
+
interface Theme {
|
|
56
|
+
custom: CustomTheme
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
interface ThemeOptions {
|
|
60
|
+
custom: CustomTheme
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
interface PaletteColor {
|
|
64
|
+
active?: string
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
interface SimplePaletteColorOptions {
|
|
68
|
+
active?: string
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
declare module "@mui/material/Button" {
|
|
73
|
+
interface ButtonPropsSizeOverrides {
|
|
74
|
+
medium: false
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
declare module "@mui/material/InputBase" {
|
|
79
|
+
interface InputBasePropsSizeOverrides {
|
|
80
|
+
hero: true
|
|
81
|
+
large: true
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
declare module "@mui/material/Chip" {
|
|
86
|
+
interface ChipPropsSizeOverrides {
|
|
87
|
+
large: true
|
|
88
|
+
medium: true
|
|
89
|
+
small: false
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
interface ChipPropsVariantOverrides {
|
|
93
|
+
filled: true
|
|
94
|
+
outlined: true
|
|
95
|
+
outlinedWhite: true
|
|
96
|
+
dark: true
|
|
97
|
+
darker: true
|
|
98
|
+
gray: true
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
declare module "@emotion/react" {
|
|
103
|
+
export interface Theme extends MuiTheme {
|
|
104
|
+
custom: CustomTheme
|
|
105
|
+
}
|
|
106
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import "@mui/material/styles"
|
|
2
|
+
|
|
3
|
+
declare module "@mui/material/styles" {
|
|
4
|
+
interface TypographyVariants {
|
|
5
|
+
h1: React.CSSProperties
|
|
6
|
+
h2: React.CSSProperties
|
|
7
|
+
h3: React.CSSProperties
|
|
8
|
+
h4: React.CSSProperties
|
|
9
|
+
h5: React.CSSProperties
|
|
10
|
+
body1: React.CSSProperties
|
|
11
|
+
body2: React.CSSProperties
|
|
12
|
+
body3: React.CSSProperties
|
|
13
|
+
body4: React.CSSProperties
|
|
14
|
+
subtitle1: React.CSSProperties
|
|
15
|
+
subtitle2: React.CSSProperties
|
|
16
|
+
subtitle3: React.CSSProperties
|
|
17
|
+
subtitle4: React.CSSProperties
|
|
18
|
+
buttonLarge: React.CSSProperties
|
|
19
|
+
button: React.CSSProperties
|
|
20
|
+
buttonSmall: React.CSSProperties
|
|
21
|
+
}
|
|
22
|
+
interface TypographyVariantsOptions {
|
|
23
|
+
h1: React.CSSProperties
|
|
24
|
+
h2: React.CSSProperties
|
|
25
|
+
h3: React.CSSProperties
|
|
26
|
+
h4: React.CSSProperties
|
|
27
|
+
h5: React.CSSProperties
|
|
28
|
+
body1: React.CSSProperties
|
|
29
|
+
body2: React.CSSProperties
|
|
30
|
+
body3: React.CSSProperties
|
|
31
|
+
body4: React.CSSProperties
|
|
32
|
+
subtitle1: React.CSSProperties
|
|
33
|
+
subtitle2: React.CSSProperties
|
|
34
|
+
subtitle3: React.CSSProperties
|
|
35
|
+
subtitle4: React.CSSProperties
|
|
36
|
+
buttonLarge: React.CSSProperties
|
|
37
|
+
button: React.CSSProperties
|
|
38
|
+
buttonSmall: React.CSSProperties
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
declare module "@mui/material/Typography" {
|
|
43
|
+
interface TypographyPropsVariantOverrides {
|
|
44
|
+
body1: true
|
|
45
|
+
body2: true
|
|
46
|
+
body3: true
|
|
47
|
+
body4: true
|
|
48
|
+
subtitle1: true
|
|
49
|
+
subtitle2: true
|
|
50
|
+
subtitle3: true
|
|
51
|
+
subtitle4: true
|
|
52
|
+
button: true
|
|
53
|
+
}
|
|
54
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"incremental": true,
|
|
4
|
+
"composite": true,
|
|
5
|
+
"target": "es6",
|
|
6
|
+
"module": "ESNext",
|
|
7
|
+
"moduleResolution": "node",
|
|
8
|
+
"lib": ["es2020", "dom"],
|
|
9
|
+
"jsx": "react",
|
|
10
|
+
"strict": true,
|
|
11
|
+
"declaration": true,
|
|
12
|
+
"noImplicitReturns": true,
|
|
13
|
+
"noFallthroughCasesInSwitch": true,
|
|
14
|
+
"skipLibCheck": true,
|
|
15
|
+
"forceConsistentCasingInFileNames": true,
|
|
16
|
+
"resolveJsonModule": true,
|
|
17
|
+
"preserveWatchOutput": true,
|
|
18
|
+
"types": ["node", "jest", "@testing-library/jest-dom", "jest-extended"],
|
|
19
|
+
"outDir": "./dist/esm",
|
|
20
|
+
"rootDir": "./src",
|
|
21
|
+
"paths": {
|
|
22
|
+
"@/*": ["./src/*"]
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"include": ["./src/**/*.ts", "./src/**/*.tsx"]
|
|
26
|
+
}
|