@mitodl/smoot-design 0.0.0-preview215f7ae3fa
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/LICENSE +28 -0
- package/README.md +27 -0
- package/dist/bundles/aiChat.es.js +24812 -0
- package/dist/bundles/aiChat.umd.js +161 -0
- package/dist/cjs/ai.d.ts +2 -0
- package/dist/cjs/ai.js +5 -0
- package/dist/cjs/bundles/aiChat.d.ts +6 -0
- package/dist/cjs/bundles/aiChat.js +13 -0
- package/dist/cjs/components/AiChat/AiChat.d.ts +5 -0
- package/dist/cjs/components/AiChat/AiChat.js +150 -0
- package/dist/cjs/components/AiChat/AiChat.stories.d.ts +11 -0
- package/dist/cjs/components/AiChat/AiChat.stories.js +76 -0
- package/dist/cjs/components/AiChat/AiChat.test.d.ts +1 -0
- package/dist/cjs/components/AiChat/AiChat.test.js +130 -0
- package/dist/cjs/components/AiChat/story-utils.d.ts +3 -0
- package/dist/cjs/components/AiChat/story-utils.js +100 -0
- package/dist/cjs/components/AiChat/types.d.ts +45 -0
- package/dist/cjs/components/AiChat/types.js +3 -0
- package/dist/cjs/components/AiChat/utils.d.ts +9 -0
- package/dist/cjs/components/AiChat/utils.js +31 -0
- package/dist/cjs/components/Button/ActionButton.d.ts +30 -0
- package/dist/cjs/components/Button/ActionButton.js +73 -0
- package/dist/cjs/components/Button/ActionButton.stories.d.ts +15 -0
- package/dist/cjs/components/Button/ActionButton.stories.js +116 -0
- package/dist/cjs/components/Button/Button.d.ts +56 -0
- package/dist/cjs/components/Button/Button.js +273 -0
- package/dist/cjs/components/Button/Button.stories.d.ts +17 -0
- package/dist/cjs/components/Button/Button.stories.js +138 -0
- package/dist/cjs/components/Button/Button.test.d.ts +1 -0
- package/dist/cjs/components/Button/Button.test.js +46 -0
- package/dist/cjs/components/Input/Input.d.ts +115 -0
- package/dist/cjs/components/Input/Input.js +219 -0
- package/dist/cjs/components/Input/Input.stories.d.ts +19 -0
- package/dist/cjs/components/Input/Input.stories.js +134 -0
- package/dist/cjs/components/Input/Input.test.d.ts +1 -0
- package/dist/cjs/components/Input/Input.test.js +32 -0
- package/dist/cjs/components/LinkAdapter/LinkAdapter.d.ts +23 -0
- package/dist/cjs/components/LinkAdapter/LinkAdapter.js +34 -0
- package/dist/cjs/components/ScrollSnap/ScrollSnap.d.ts +19 -0
- package/dist/cjs/components/ScrollSnap/ScrollSnap.js +59 -0
- package/dist/cjs/components/ScrollSnap/ScrollSnap.stories.d.ts +6 -0
- package/dist/cjs/components/ScrollSnap/ScrollSnap.stories.js +43 -0
- package/dist/cjs/components/SrAnnouncer/SrAnnouncer.d.ts +25 -0
- package/dist/cjs/components/SrAnnouncer/SrAnnouncer.js +43 -0
- package/dist/cjs/components/SrAnnouncer/SrAnnouncer.stories.d.ts +6 -0
- package/dist/cjs/components/SrAnnouncer/SrAnnouncer.stories.js +44 -0
- package/dist/cjs/components/SrAnnouncer/SrAnnouncer.test.d.ts +1 -0
- package/dist/cjs/components/SrAnnouncer/SrAnnouncer.test.js +62 -0
- package/dist/cjs/components/TextField/TextField.d.ts +29 -0
- package/dist/cjs/components/TextField/TextField.js +33 -0
- package/dist/cjs/components/TextField/TextField.stories.d.ts +10 -0
- package/dist/cjs/components/TextField/TextField.stories.js +135 -0
- package/dist/cjs/components/TextField/TextField.test.d.ts +1 -0
- package/dist/cjs/components/TextField/TextField.test.js +77 -0
- package/dist/cjs/components/ThemeProvider/ThemeProvider.d.ts +23 -0
- package/dist/cjs/components/ThemeProvider/ThemeProvider.js +90 -0
- package/dist/cjs/components/ThemeProvider/ThemeProvider.stories.d.ts +58 -0
- package/dist/cjs/components/ThemeProvider/ThemeProvider.stories.js +97 -0
- package/dist/cjs/components/ThemeProvider/Typography.stories.d.ts +39 -0
- package/dist/cjs/components/ThemeProvider/Typography.stories.js +65 -0
- package/dist/cjs/components/ThemeProvider/breakpoints.d.ts +4 -0
- package/dist/cjs/components/ThemeProvider/breakpoints.js +20 -0
- package/dist/cjs/components/ThemeProvider/buttons.d.ts +7 -0
- package/dist/cjs/components/ThemeProvider/buttons.js +20 -0
- package/dist/cjs/components/ThemeProvider/chips.d.ts +3 -0
- package/dist/cjs/components/ThemeProvider/chips.js +154 -0
- package/dist/cjs/components/ThemeProvider/colors.d.ts +32 -0
- package/dist/cjs/components/ThemeProvider/colors.js +35 -0
- package/dist/cjs/components/ThemeProvider/typography.d.ts +18 -0
- package/dist/cjs/components/ThemeProvider/typography.js +174 -0
- package/dist/cjs/components/VisuallyHidden/VisuallyHidden.d.ts +24 -0
- package/dist/cjs/components/VisuallyHidden/VisuallyHidden.js +33 -0
- package/dist/cjs/components/VisuallyHidden/VisuallyHidden.stories.d.ts +6 -0
- package/dist/cjs/components/VisuallyHidden/VisuallyHidden.stories.js +13 -0
- package/dist/cjs/components/internal/FormHelpers/FormHelpers.d.ts +39 -0
- package/dist/cjs/components/internal/FormHelpers/FormHelpers.js +78 -0
- package/dist/cjs/components/internal/FormHelpers/FormHelpers.test.d.ts +1 -0
- package/dist/cjs/components/internal/FormHelpers/FormHelpers.test.js +93 -0
- package/dist/cjs/index.d.ts +16 -0
- package/dist/cjs/index.js +28 -0
- package/dist/cjs/jest-setup.d.ts +1 -0
- package/dist/cjs/jest-setup.js +18 -0
- package/dist/cjs/jsdom-extended.d.ts +6 -0
- package/dist/cjs/jsdom-extended.js +14 -0
- package/dist/cjs/story-utils/index.d.ts +6 -0
- package/dist/cjs/story-utils/index.js +17 -0
- package/dist/cjs/utils/composeRefs.d.ts +7 -0
- package/dist/cjs/utils/composeRefs.js +20 -0
- package/dist/cjs/utils/composeRefs.test.d.ts +1 -0
- package/dist/cjs/utils/composeRefs.test.js +19 -0
- package/dist/cjs/utils/useDevCheckStable.d.ts +8 -0
- package/dist/cjs/utils/useDevCheckStable.js +29 -0
- package/dist/cjs/utils/useInterval.d.ts +7 -0
- package/dist/cjs/utils/useInterval.js +25 -0
- package/dist/esm/ai.d.ts +2 -0
- package/dist/esm/ai.js +1 -0
- package/dist/esm/bundles/aiChat.d.ts +6 -0
- package/dist/esm/bundles/aiChat.js +10 -0
- package/dist/esm/components/AiChat/AiChat.d.ts +5 -0
- package/dist/esm/components/AiChat/AiChat.js +147 -0
- package/dist/esm/components/AiChat/AiChat.stories.d.ts +11 -0
- package/dist/esm/components/AiChat/AiChat.stories.js +73 -0
- package/dist/esm/components/AiChat/AiChat.test.d.ts +1 -0
- package/dist/esm/components/AiChat/AiChat.test.js +128 -0
- package/dist/esm/components/AiChat/story-utils.d.ts +3 -0
- package/dist/esm/components/AiChat/story-utils.js +96 -0
- package/dist/esm/components/AiChat/types.d.ts +45 -0
- package/dist/esm/components/AiChat/types.js +2 -0
- package/dist/esm/components/AiChat/utils.d.ts +9 -0
- package/dist/esm/components/AiChat/utils.js +28 -0
- package/dist/esm/components/Button/ActionButton.d.ts +30 -0
- package/dist/esm/components/Button/ActionButton.js +68 -0
- package/dist/esm/components/Button/ActionButton.stories.d.ts +15 -0
- package/dist/esm/components/Button/ActionButton.stories.js +113 -0
- package/dist/esm/components/Button/Button.d.ts +56 -0
- package/dist/esm/components/Button/Button.js +265 -0
- package/dist/esm/components/Button/Button.stories.d.ts +17 -0
- package/dist/esm/components/Button/Button.stories.js +135 -0
- package/dist/esm/components/Button/Button.test.d.ts +1 -0
- package/dist/esm/components/Button/Button.test.js +44 -0
- package/dist/esm/components/Input/Input.d.ts +115 -0
- package/dist/esm/components/Input/Input.js +214 -0
- package/dist/esm/components/Input/Input.stories.d.ts +19 -0
- package/dist/esm/components/Input/Input.stories.js +131 -0
- package/dist/esm/components/Input/Input.test.d.ts +1 -0
- package/dist/esm/components/Input/Input.test.js +30 -0
- package/dist/esm/components/LinkAdapter/LinkAdapter.d.ts +23 -0
- package/dist/esm/components/LinkAdapter/LinkAdapter.js +31 -0
- package/dist/esm/components/ScrollSnap/ScrollSnap.d.ts +19 -0
- package/dist/esm/components/ScrollSnap/ScrollSnap.js +56 -0
- package/dist/esm/components/ScrollSnap/ScrollSnap.stories.d.ts +6 -0
- package/dist/esm/components/ScrollSnap/ScrollSnap.stories.js +40 -0
- package/dist/esm/components/SrAnnouncer/SrAnnouncer.d.ts +25 -0
- package/dist/esm/components/SrAnnouncer/SrAnnouncer.js +40 -0
- package/dist/esm/components/SrAnnouncer/SrAnnouncer.stories.d.ts +6 -0
- package/dist/esm/components/SrAnnouncer/SrAnnouncer.stories.js +41 -0
- package/dist/esm/components/SrAnnouncer/SrAnnouncer.test.d.ts +1 -0
- package/dist/esm/components/SrAnnouncer/SrAnnouncer.test.js +60 -0
- package/dist/esm/components/TextField/TextField.d.ts +29 -0
- package/dist/esm/components/TextField/TextField.js +30 -0
- package/dist/esm/components/TextField/TextField.stories.d.ts +10 -0
- package/dist/esm/components/TextField/TextField.stories.js +132 -0
- package/dist/esm/components/TextField/TextField.test.d.ts +1 -0
- package/dist/esm/components/TextField/TextField.test.js +75 -0
- package/dist/esm/components/ThemeProvider/ThemeProvider.d.ts +23 -0
- package/dist/esm/components/ThemeProvider/ThemeProvider.js +86 -0
- package/dist/esm/components/ThemeProvider/ThemeProvider.stories.d.ts +58 -0
- package/dist/esm/components/ThemeProvider/ThemeProvider.stories.js +94 -0
- package/dist/esm/components/ThemeProvider/Typography.stories.d.ts +39 -0
- package/dist/esm/components/ThemeProvider/Typography.stories.js +62 -0
- package/dist/esm/components/ThemeProvider/breakpoints.d.ts +4 -0
- package/dist/esm/components/ThemeProvider/breakpoints.js +16 -0
- package/dist/esm/components/ThemeProvider/buttons.d.ts +7 -0
- package/dist/esm/components/ThemeProvider/buttons.js +17 -0
- package/dist/esm/components/ThemeProvider/chips.d.ts +3 -0
- package/dist/esm/components/ThemeProvider/chips.js +151 -0
- package/dist/esm/components/ThemeProvider/colors.d.ts +32 -0
- package/dist/esm/components/ThemeProvider/colors.js +32 -0
- package/dist/esm/components/ThemeProvider/typography.d.ts +18 -0
- package/dist/esm/components/ThemeProvider/typography.js +168 -0
- package/dist/esm/components/VisuallyHidden/VisuallyHidden.d.ts +24 -0
- package/dist/esm/components/VisuallyHidden/VisuallyHidden.js +30 -0
- package/dist/esm/components/VisuallyHidden/VisuallyHidden.stories.d.ts +6 -0
- package/dist/esm/components/VisuallyHidden/VisuallyHidden.stories.js +10 -0
- package/dist/esm/components/internal/FormHelpers/FormHelpers.d.ts +39 -0
- package/dist/esm/components/internal/FormHelpers/FormHelpers.js +73 -0
- package/dist/esm/components/internal/FormHelpers/FormHelpers.test.d.ts +1 -0
- package/dist/esm/components/internal/FormHelpers/FormHelpers.test.js +91 -0
- package/dist/esm/index.d.ts +16 -0
- package/dist/esm/index.js +11 -0
- package/dist/esm/jest-setup.d.ts +1 -0
- package/dist/esm/jest-setup.js +16 -0
- package/dist/esm/jsdom-extended.d.ts +6 -0
- package/dist/esm/jsdom-extended.js +12 -0
- package/dist/esm/story-utils/index.d.ts +6 -0
- package/dist/esm/story-utils/index.js +13 -0
- package/dist/esm/utils/composeRefs.d.ts +7 -0
- package/dist/esm/utils/composeRefs.js +17 -0
- package/dist/esm/utils/composeRefs.test.d.ts +1 -0
- package/dist/esm/utils/composeRefs.test.js +17 -0
- package/dist/esm/utils/useDevCheckStable.d.ts +8 -0
- package/dist/esm/utils/useDevCheckStable.js +26 -0
- package/dist/esm/utils/useInterval.d.ts +7 -0
- package/dist/esm/utils/useInterval.js +22 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/type-augmentation/TypescriptDocs.mdx +17 -0
- package/dist/type-augmentation/index.d.ts +2 -0
- package/dist/type-augmentation/theme.d.ts +103 -0
- package/dist/type-augmentation/typography.d.ts +54 -0
- package/package.json +141 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const React = require("react");
|
|
13
|
+
const react_1 = require("@testing-library/react");
|
|
14
|
+
const user_event_1 = require("@testing-library/user-event");
|
|
15
|
+
const TextField_1 = require("./TextField");
|
|
16
|
+
const ThemeProvider_1 = require("../ThemeProvider/ThemeProvider");
|
|
17
|
+
const en_1 = require("@faker-js/faker/locale/en");
|
|
18
|
+
describe("TextField", () => {
|
|
19
|
+
const setup = (props) => {
|
|
20
|
+
const defaults = {
|
|
21
|
+
name: "test-name",
|
|
22
|
+
value: "test-value",
|
|
23
|
+
label: "test-label",
|
|
24
|
+
};
|
|
25
|
+
const { rerender: _rerender } = (0, react_1.render)(React.createElement(TextField_1.TextField, Object.assign({}, defaults, props)), {
|
|
26
|
+
wrapper: ThemeProvider_1.ThemeProvider,
|
|
27
|
+
});
|
|
28
|
+
const rerender = (newProps) => {
|
|
29
|
+
_rerender(React.createElement(TextField_1.TextField, Object.assign({}, defaults, newProps)));
|
|
30
|
+
};
|
|
31
|
+
return { rerender };
|
|
32
|
+
};
|
|
33
|
+
it("Has a label", () => {
|
|
34
|
+
const label = en_1.faker.lorem.words();
|
|
35
|
+
setup({ label });
|
|
36
|
+
const input = react_1.screen.getByRole("textbox", { name: label });
|
|
37
|
+
expect(input).toBeInstanceOf(HTMLInputElement);
|
|
38
|
+
});
|
|
39
|
+
it("Marks the input as required if required", () => {
|
|
40
|
+
const label = en_1.faker.lorem.words();
|
|
41
|
+
setup({ label, required: true });
|
|
42
|
+
const input = react_1.screen.getByRole("textbox", { name: label });
|
|
43
|
+
expect(input).toBeRequired();
|
|
44
|
+
});
|
|
45
|
+
it("Emits the correct value on change", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
46
|
+
const name = en_1.faker.lorem.word();
|
|
47
|
+
const value = en_1.faker.lorem.words();
|
|
48
|
+
const onChange = jest.fn();
|
|
49
|
+
setup({ name, onChange, value });
|
|
50
|
+
const input = react_1.screen.getByRole("textbox");
|
|
51
|
+
yield user_event_1.default.type(input, "x");
|
|
52
|
+
expect(onChange).toHaveBeenCalledTimes(1);
|
|
53
|
+
expect(onChange).toHaveBeenCalledWith(expect.objectContaining({
|
|
54
|
+
target: expect.objectContaining({ name }),
|
|
55
|
+
}));
|
|
56
|
+
}));
|
|
57
|
+
it("Forwards inputProps and InputProps", () => {
|
|
58
|
+
/**
|
|
59
|
+
* NOTE: This behavior is important for integrating easily with MUI's
|
|
60
|
+
* Autocomplete component
|
|
61
|
+
*/
|
|
62
|
+
const inputRef = jest.fn();
|
|
63
|
+
const InputRef = jest.fn();
|
|
64
|
+
setup({
|
|
65
|
+
inputProps: {
|
|
66
|
+
ref: inputRef,
|
|
67
|
+
},
|
|
68
|
+
InputProps: {
|
|
69
|
+
ref: InputRef,
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
expect(inputRef).toHaveBeenCalledTimes(1);
|
|
73
|
+
expect(inputRef).toHaveBeenCalledWith(expect.any(HTMLInputElement));
|
|
74
|
+
expect(InputRef).toHaveBeenCalledTimes(1);
|
|
75
|
+
expect(InputRef).toHaveBeenCalledWith(expect.any(HTMLDivElement));
|
|
76
|
+
});
|
|
77
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { ThemeOptions, Theme } from "@mui/material/styles";
|
|
3
|
+
/**
|
|
4
|
+
* Create a customized Smoot Design theme for use with `ThemeProvider`.
|
|
5
|
+
*
|
|
6
|
+
* See [ThemeProvider Docs](https://mitodl.github.io/smoot-design/?path=/docs/smoot-design-themeprovider--docs#further-customized-theme-with-createtheme)
|
|
7
|
+
* for more.
|
|
8
|
+
*/
|
|
9
|
+
declare const createTheme: (options?: {
|
|
10
|
+
custom: Partial<ThemeOptions["custom"]>;
|
|
11
|
+
}) => Theme;
|
|
12
|
+
type ThemeProviderProps = {
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
theme?: Theme;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @param param0
|
|
19
|
+
* @returns
|
|
20
|
+
*/
|
|
21
|
+
declare const ThemeProvider: React.FC<ThemeProviderProps>;
|
|
22
|
+
export { ThemeProvider, createTheme };
|
|
23
|
+
export type { ThemeProviderProps, Theme };
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createTheme = exports.ThemeProvider = void 0;
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const styles_1 = require("@mui/material/styles");
|
|
6
|
+
const typography = require("./typography");
|
|
7
|
+
const buttons = require("./buttons");
|
|
8
|
+
const chips = require("./chips");
|
|
9
|
+
const colors_1 = require("./colors");
|
|
10
|
+
const custom = {
|
|
11
|
+
colors: colors_1.colors,
|
|
12
|
+
dimensions: {
|
|
13
|
+
headerHeight: "72px",
|
|
14
|
+
headerHeightSm: "60px",
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
const BREAKPOINTS = {
|
|
18
|
+
values: {
|
|
19
|
+
xs: 0,
|
|
20
|
+
sm: 600,
|
|
21
|
+
md: 900,
|
|
22
|
+
lg: 1272 + 48,
|
|
23
|
+
xl: 1536,
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
const defaultThemeOptions = {
|
|
27
|
+
custom: custom,
|
|
28
|
+
palette: {
|
|
29
|
+
primary: {
|
|
30
|
+
main: colors_1.colors.mitRed,
|
|
31
|
+
light: colors_1.colors.lightRed,
|
|
32
|
+
active: colors_1.colors.red,
|
|
33
|
+
contrastText: colors_1.colors.white,
|
|
34
|
+
},
|
|
35
|
+
secondary: {
|
|
36
|
+
light: colors_1.colors.darkGray2,
|
|
37
|
+
active: colors_1.colors.silverGrayDark,
|
|
38
|
+
main: colors_1.colors.black,
|
|
39
|
+
contrastText: colors_1.colors.white,
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
shape: {
|
|
43
|
+
borderRadius: 8,
|
|
44
|
+
},
|
|
45
|
+
spacing: 8,
|
|
46
|
+
typography: typography.globalSettings,
|
|
47
|
+
breakpoints: BREAKPOINTS,
|
|
48
|
+
components: {
|
|
49
|
+
MuiButtonBase: buttons.buttonBaseComponent,
|
|
50
|
+
MuiTypography: typography.component,
|
|
51
|
+
MuiTabPanel: {
|
|
52
|
+
styleOverrides: {
|
|
53
|
+
root: {
|
|
54
|
+
padding: "0px",
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
MuiMenu: {
|
|
59
|
+
styleOverrides: { paper: { borderRadius: "4px" } },
|
|
60
|
+
},
|
|
61
|
+
MuiAutocomplete: {
|
|
62
|
+
styleOverrides: {
|
|
63
|
+
paper: { borderRadius: "4px" },
|
|
64
|
+
// Mui puts paddingRight: 2px, marginRight: -2px on the popupIndicator,
|
|
65
|
+
// which causes the browser to show a horizontal scrollbar on overflow
|
|
66
|
+
// containers when a scrollbar isn't really necessary.
|
|
67
|
+
popupIndicator: { paddingRight: 0, marginRight: 0 },
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
MuiChip: chips.chipComponent,
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Create a customized Smoot Design theme for use with `ThemeProvider`.
|
|
75
|
+
*
|
|
76
|
+
* See [ThemeProvider Docs](https://mitodl.github.io/smoot-design/?path=/docs/smoot-design-themeprovider--docs#further-customized-theme-with-createtheme)
|
|
77
|
+
* for more.
|
|
78
|
+
*/
|
|
79
|
+
const createTheme = (options) => (0, styles_1.createTheme)(Object.assign(Object.assign({}, defaultThemeOptions), { custom: Object.assign(Object.assign({}, defaultThemeOptions.custom), options === null || options === void 0 ? void 0 : options.custom) }));
|
|
80
|
+
exports.createTheme = createTheme;
|
|
81
|
+
const defaultTheme = createTheme();
|
|
82
|
+
/**
|
|
83
|
+
*
|
|
84
|
+
* @param param0
|
|
85
|
+
* @returns
|
|
86
|
+
*/
|
|
87
|
+
const ThemeProvider = ({ children, theme = defaultTheme, }) => {
|
|
88
|
+
return React.createElement(styles_1.ThemeProvider, { theme: theme }, children);
|
|
89
|
+
};
|
|
90
|
+
exports.ThemeProvider = ThemeProvider;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { ThemeProvider } from "./ThemeProvider";
|
|
3
|
+
declare const meta: Meta<typeof ThemeProvider>;
|
|
4
|
+
type Story = StoryObj<typeof ThemeProvider>;
|
|
5
|
+
/**
|
|
6
|
+
* `ThemeProvider` must wrap all components from `smoot`-design, and allows
|
|
7
|
+
* styling any component via [`styled`](https://emotion.sh/docs/styled).
|
|
8
|
+
*
|
|
9
|
+
* In general, most useful theme properties are exposed on `theme.custom`. (Root
|
|
10
|
+
* `theme` properties are used internally by MUI.) See typescript definitions
|
|
11
|
+
* for more information about `theme.custom`.
|
|
12
|
+
*
|
|
13
|
+
* ## Further Customized Theme with `createTheme`
|
|
14
|
+
* Consuming applications can customize `smoot-design`'s default theme by creating
|
|
15
|
+
* a theme instance with `createTheme` and passing it to `ThemeProvider`:
|
|
16
|
+
*
|
|
17
|
+
* ```tsx
|
|
18
|
+
* const customTheme = createTheme({...})
|
|
19
|
+
*
|
|
20
|
+
* <ThemeProvider theme={customTheme}>
|
|
21
|
+
* {children}
|
|
22
|
+
* </ThemeProvider>
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
*
|
|
26
|
+
* ### Custom Link Adapter
|
|
27
|
+
* One particularly notable property is `theme.custom.LinkAdapter`. Some `smoot-design`
|
|
28
|
+
* components render links. These links are native anchor tags by default. In
|
|
29
|
+
* order to use these components with custom routing libraries (e.g. `react-router`
|
|
30
|
+
* or `next/link`), you can provide a custom link adapter.
|
|
31
|
+
*
|
|
32
|
+
* Components such as `ButtonLink` will:
|
|
33
|
+
* - use `Component` on `ButtonLink` if specified (`<ButtonLink Component={Link} />`)
|
|
34
|
+
* - else, use `theme.custom.LinkAdapter` if specified,
|
|
35
|
+
* - else, use `a` tag.
|
|
36
|
+
*
|
|
37
|
+
* For example, to use `next/link` as the default link implementation:
|
|
38
|
+
*
|
|
39
|
+
* ```tsx
|
|
40
|
+
* import Link from "next/link"
|
|
41
|
+
* const theme = createTheme({ LinkAdapter: Link })
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* You can use [module augmentation](https://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation)
|
|
45
|
+
* to add the custom props to relevant components. For example, to expose
|
|
46
|
+
* `next/link`'s `scroll` prop on `ButtonLink`:
|
|
47
|
+
*
|
|
48
|
+
* ```ts
|
|
49
|
+
* // Add scroll prop to all components using LinkAdapter
|
|
50
|
+
* declare module "@mitodl/smoot-design" {
|
|
51
|
+
* interface LinkAdapterPropsOverrides {
|
|
52
|
+
* scroll?: boolean
|
|
53
|
+
* }
|
|
54
|
+
* }
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export declare const LinkAdapterOverride: Story;
|
|
58
|
+
export default meta;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LinkAdapterOverride = void 0;
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const ThemeProvider_1 = require("./ThemeProvider");
|
|
6
|
+
const Button_1 = require("../Button/Button");
|
|
7
|
+
const CustomLinkAdapater = React.forwardRef((props, ref) => (
|
|
8
|
+
// eslint-disable-next-line jsx-a11y/anchor-has-content, jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
|
|
9
|
+
React.createElement("a", Object.assign({ ref: ref, onClick: (e) => {
|
|
10
|
+
e.preventDefault();
|
|
11
|
+
alert(`Custom link to: ${e.currentTarget.href}. (Preventing Navigation.)`);
|
|
12
|
+
}, "data-custom": "theme-default" }, props))));
|
|
13
|
+
CustomLinkAdapater.displayName = "CustomLinkAdapter";
|
|
14
|
+
const customTheme = (0, ThemeProvider_1.createTheme)({
|
|
15
|
+
custom: {
|
|
16
|
+
LinkAdapter: CustomLinkAdapater,
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
const meta = {
|
|
20
|
+
title: "smoot-design/ThemeProvider",
|
|
21
|
+
component: ThemeProvider_1.ThemeProvider,
|
|
22
|
+
argTypes: {
|
|
23
|
+
theme: {
|
|
24
|
+
options: ["Default", "Custom Link Adapter"],
|
|
25
|
+
mapping: {
|
|
26
|
+
Default: undefined,
|
|
27
|
+
"Custom Link Adapter": customTheme,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
children: {
|
|
31
|
+
table: { disable: true },
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
id: "smoot-design/ThemeProvider",
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* `ThemeProvider` must wrap all components from `smoot`-design, and allows
|
|
38
|
+
* styling any component via [`styled`](https://emotion.sh/docs/styled).
|
|
39
|
+
*
|
|
40
|
+
* In general, most useful theme properties are exposed on `theme.custom`. (Root
|
|
41
|
+
* `theme` properties are used internally by MUI.) See typescript definitions
|
|
42
|
+
* for more information about `theme.custom`.
|
|
43
|
+
*
|
|
44
|
+
* ## Further Customized Theme with `createTheme`
|
|
45
|
+
* Consuming applications can customize `smoot-design`'s default theme by creating
|
|
46
|
+
* a theme instance with `createTheme` and passing it to `ThemeProvider`:
|
|
47
|
+
*
|
|
48
|
+
* ```tsx
|
|
49
|
+
* const customTheme = createTheme({...})
|
|
50
|
+
*
|
|
51
|
+
* <ThemeProvider theme={customTheme}>
|
|
52
|
+
* {children}
|
|
53
|
+
* </ThemeProvider>
|
|
54
|
+
* ```
|
|
55
|
+
*
|
|
56
|
+
*
|
|
57
|
+
* ### Custom Link Adapter
|
|
58
|
+
* One particularly notable property is `theme.custom.LinkAdapter`. Some `smoot-design`
|
|
59
|
+
* components render links. These links are native anchor tags by default. In
|
|
60
|
+
* order to use these components with custom routing libraries (e.g. `react-router`
|
|
61
|
+
* or `next/link`), you can provide a custom link adapter.
|
|
62
|
+
*
|
|
63
|
+
* Components such as `ButtonLink` will:
|
|
64
|
+
* - use `Component` on `ButtonLink` if specified (`<ButtonLink Component={Link} />`)
|
|
65
|
+
* - else, use `theme.custom.LinkAdapter` if specified,
|
|
66
|
+
* - else, use `a` tag.
|
|
67
|
+
*
|
|
68
|
+
* For example, to use `next/link` as the default link implementation:
|
|
69
|
+
*
|
|
70
|
+
* ```tsx
|
|
71
|
+
* import Link from "next/link"
|
|
72
|
+
* const theme = createTheme({ LinkAdapter: Link })
|
|
73
|
+
* ```
|
|
74
|
+
*
|
|
75
|
+
* You can use [module augmentation](https://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation)
|
|
76
|
+
* to add the custom props to relevant components. For example, to expose
|
|
77
|
+
* `next/link`'s `scroll` prop on `ButtonLink`:
|
|
78
|
+
*
|
|
79
|
+
* ```ts
|
|
80
|
+
* // Add scroll prop to all components using LinkAdapter
|
|
81
|
+
* declare module "@mitodl/smoot-design" {
|
|
82
|
+
* interface LinkAdapterPropsOverrides {
|
|
83
|
+
* scroll?: boolean
|
|
84
|
+
* }
|
|
85
|
+
* }
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
exports.LinkAdapterOverride = {
|
|
89
|
+
args: {
|
|
90
|
+
theme: customTheme,
|
|
91
|
+
},
|
|
92
|
+
render: (args) => {
|
|
93
|
+
return (React.createElement(ThemeProvider_1.ThemeProvider, { theme: args.theme },
|
|
94
|
+
React.createElement(Button_1.ButtonLink, { href: "https://mit.edu" }, args.theme ? "Custom theme in use" : "Default theme in use")));
|
|
95
|
+
},
|
|
96
|
+
};
|
|
97
|
+
exports.default = meta;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import Typography from "@mui/material/Typography";
|
|
3
|
+
/**
|
|
4
|
+
* Typography styles can be controlled via the `theme.typography` object when
|
|
5
|
+
* using the `styled` helper or via the `<Tyopgraphy variant="..." />` component.
|
|
6
|
+
*
|
|
7
|
+
* For the `Typography` component, see [MUI's documentation](https://mui.com/material-ui/react-typography/).
|
|
8
|
+
*
|
|
9
|
+
* ```tsx
|
|
10
|
+
* const MyHeading = styled(({ theme }) => ({
|
|
11
|
+
* ...theme.typography.h2,
|
|
12
|
+
* [theme.breakpoints.down("sm")]: {
|
|
13
|
+
* ...theme.typography.h3,
|
|
14
|
+
* },
|
|
15
|
+
* }))
|
|
16
|
+
*
|
|
17
|
+
* // or:
|
|
18
|
+
* <Typography component="h1" typography={
|
|
19
|
+
* {
|
|
20
|
+
* xs: "h3", // above xs
|
|
21
|
+
* sm: "h2" // above sm
|
|
22
|
+
* }
|
|
23
|
+
* }>
|
|
24
|
+
* Hello, world!
|
|
25
|
+
* </Typography>
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
*/
|
|
29
|
+
declare const meta: Meta<typeof Typography>;
|
|
30
|
+
export default meta;
|
|
31
|
+
type Story = StoryObj<typeof Typography>;
|
|
32
|
+
/**
|
|
33
|
+
* Typography variants are shown below.
|
|
34
|
+
*
|
|
35
|
+
* **Note:** The typography variant is not related to the HTML element used. A
|
|
36
|
+
* `variant="h1"` component does not automatically render an `<h1>` element.
|
|
37
|
+
*
|
|
38
|
+
*/
|
|
39
|
+
export declare const Variants: Story;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Variants = void 0;
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const Stack_1 = require("@mui/material/Stack");
|
|
6
|
+
const Typography_1 = require("@mui/material/Typography");
|
|
7
|
+
/**
|
|
8
|
+
* Typography styles can be controlled via the `theme.typography` object when
|
|
9
|
+
* using the `styled` helper or via the `<Tyopgraphy variant="..." />` component.
|
|
10
|
+
*
|
|
11
|
+
* For the `Typography` component, see [MUI's documentation](https://mui.com/material-ui/react-typography/).
|
|
12
|
+
*
|
|
13
|
+
* ```tsx
|
|
14
|
+
* const MyHeading = styled(({ theme }) => ({
|
|
15
|
+
* ...theme.typography.h2,
|
|
16
|
+
* [theme.breakpoints.down("sm")]: {
|
|
17
|
+
* ...theme.typography.h3,
|
|
18
|
+
* },
|
|
19
|
+
* }))
|
|
20
|
+
*
|
|
21
|
+
* // or:
|
|
22
|
+
* <Typography component="h1" typography={
|
|
23
|
+
* {
|
|
24
|
+
* xs: "h3", // above xs
|
|
25
|
+
* sm: "h2" // above sm
|
|
26
|
+
* }
|
|
27
|
+
* }>
|
|
28
|
+
* Hello, world!
|
|
29
|
+
* </Typography>
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
*/
|
|
33
|
+
const meta = {
|
|
34
|
+
title: "smoot-design/Typography",
|
|
35
|
+
component: Typography_1.default,
|
|
36
|
+
};
|
|
37
|
+
exports.default = meta;
|
|
38
|
+
const text = "The quick brown fox jumps over the lazy dog. ".repeat(10);
|
|
39
|
+
const INSTANCES = [
|
|
40
|
+
{ variant: "h1", children: "Heading level 1" },
|
|
41
|
+
{ variant: "h2", children: "Heading level 2" },
|
|
42
|
+
{ variant: "h3", children: "Heading level 3" },
|
|
43
|
+
{ variant: "h4", children: "Heading level 4" },
|
|
44
|
+
{ variant: "h5", children: "Heading level 5" },
|
|
45
|
+
{ variant: "subtitle1", children: "Subtitle level 1" },
|
|
46
|
+
{ variant: "subtitle2", children: "Subtitle level 2" },
|
|
47
|
+
{ variant: "subtitle3", children: "Subtitle level 3" },
|
|
48
|
+
{ variant: "subtitle4", children: "Subtitle level 4" },
|
|
49
|
+
{ variant: "body1", children: `body level 1... ${text}` },
|
|
50
|
+
{ variant: "body2", children: `body level 2... ${text}` },
|
|
51
|
+
{ variant: "body3", children: `body level 3... ${text}` },
|
|
52
|
+
{ variant: "body4", children: `body level 4... ${text}` },
|
|
53
|
+
];
|
|
54
|
+
/**
|
|
55
|
+
* Typography variants are shown below.
|
|
56
|
+
*
|
|
57
|
+
* **Note:** The typography variant is not related to the HTML element used. A
|
|
58
|
+
* `variant="h1"` component does not automatically render an `<h1>` element.
|
|
59
|
+
*
|
|
60
|
+
*/
|
|
61
|
+
exports.Variants = {
|
|
62
|
+
render: () => {
|
|
63
|
+
return (React.createElement(Stack_1.default, { gap: "1rem" }, INSTANCES.map((props) => (React.createElement(Typography_1.default, Object.assign({ key: props.variant }, props))))));
|
|
64
|
+
},
|
|
65
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.breakpoints = exports.BREAKPOINT_VALUES = void 0;
|
|
4
|
+
const styles_1 = require("@mui/material/styles");
|
|
5
|
+
const BREAKPOINT_VALUES = {
|
|
6
|
+
values: {
|
|
7
|
+
xs: 0,
|
|
8
|
+
sm: 600,
|
|
9
|
+
md: 900,
|
|
10
|
+
lg: 1280,
|
|
11
|
+
xl: 1536,
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
exports.BREAKPOINT_VALUES = BREAKPOINT_VALUES;
|
|
15
|
+
const { breakpoints } = (0, styles_1.createTheme)({
|
|
16
|
+
breakpoints: BREAKPOINT_VALUES,
|
|
17
|
+
// @ts-expect-error only using breakpoints
|
|
18
|
+
custom: {},
|
|
19
|
+
});
|
|
20
|
+
exports.breakpoints = breakpoints;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ThemeOptions } from "@mui/material/styles";
|
|
2
|
+
/**
|
|
3
|
+
* We don't use MUI's button directly, but ButtonBase does get used internally
|
|
4
|
+
* by some MUI components, so we override a few styles.
|
|
5
|
+
*/
|
|
6
|
+
declare const buttonBaseComponent: NonNullable<ThemeOptions["components"]>["MuiButtonBase"];
|
|
7
|
+
export { buttonBaseComponent };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buttonBaseComponent = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* We don't use MUI's button directly, but ButtonBase does get used internally
|
|
6
|
+
* by some MUI components, so we override a few styles.
|
|
7
|
+
*/
|
|
8
|
+
const buttonBaseComponent = {
|
|
9
|
+
defaultProps: {
|
|
10
|
+
disableRipple: true,
|
|
11
|
+
},
|
|
12
|
+
styleOverrides: {
|
|
13
|
+
root: {
|
|
14
|
+
":focus-visible": {
|
|
15
|
+
outline: "revert",
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
exports.buttonBaseComponent = buttonBaseComponent;
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.chipComponent = void 0;
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const colors_1 = require("./colors");
|
|
6
|
+
const react_1 = require("@remixicon/react");
|
|
7
|
+
const chipComponent = {
|
|
8
|
+
defaultProps: {
|
|
9
|
+
size: "medium",
|
|
10
|
+
color: "default",
|
|
11
|
+
variant: "outlined",
|
|
12
|
+
deleteIcon: React.createElement(react_1.RiCloseLine, { "aria-hidden": "true" }),
|
|
13
|
+
},
|
|
14
|
+
styleOverrides: {
|
|
15
|
+
root: {
|
|
16
|
+
borderRadius: "100vh",
|
|
17
|
+
borderWidth: "1px",
|
|
18
|
+
},
|
|
19
|
+
deleteIcon: {
|
|
20
|
+
"&:hover": {
|
|
21
|
+
color: "inherit",
|
|
22
|
+
},
|
|
23
|
+
"&.MuiChip-deleteIconLarge": {
|
|
24
|
+
width: "16px",
|
|
25
|
+
height: "16px",
|
|
26
|
+
},
|
|
27
|
+
"&.MuiChip-deleteIconMedium": {
|
|
28
|
+
width: "14px",
|
|
29
|
+
height: "14px",
|
|
30
|
+
},
|
|
31
|
+
margin: "0 -2px 0 8px",
|
|
32
|
+
color: "inherit",
|
|
33
|
+
},
|
|
34
|
+
icon: {
|
|
35
|
+
margin: "0 8px 0 -2px",
|
|
36
|
+
color: "inherit",
|
|
37
|
+
"&.MuiChip-iconLarge": {
|
|
38
|
+
width: "16px",
|
|
39
|
+
height: "16px",
|
|
40
|
+
},
|
|
41
|
+
"&.MuiChip-iconMedium": {
|
|
42
|
+
width: "14px",
|
|
43
|
+
height: "14px",
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
variants: [
|
|
48
|
+
{
|
|
49
|
+
props: { size: "medium" },
|
|
50
|
+
style: ({ theme }) => (Object.assign(Object.assign({}, theme.typography.body3), { boxSizing: "border-box", height: "24px", paddingRight: "12px", paddingLeft: "12px", ".MuiChip-label": {
|
|
51
|
+
paddingLeft: "0px",
|
|
52
|
+
paddingRight: "0px",
|
|
53
|
+
} })),
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
props: { size: "large" },
|
|
57
|
+
style: ({ theme }) => (Object.assign(Object.assign({}, theme.typography.body2), { height: "32px", paddingLeft: "16px", paddingRight: "16px", ".MuiChip-label": {
|
|
58
|
+
paddingLeft: "0px",
|
|
59
|
+
paddingRight: "0px",
|
|
60
|
+
} })),
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
props: { variant: "outlined" },
|
|
64
|
+
style: {
|
|
65
|
+
borderColor: colors_1.colors.silverGrayLight,
|
|
66
|
+
color: colors_1.colors.darkGray1,
|
|
67
|
+
"&.Mui-focusVisible": {
|
|
68
|
+
backgroundColor: "transparent",
|
|
69
|
+
},
|
|
70
|
+
"&.MuiChip-clickable:hover, &.MuiChip-deletable:hover": {
|
|
71
|
+
color: colors_1.colors.darkGray1,
|
|
72
|
+
borderColor: colors_1.colors.silverGrayDark,
|
|
73
|
+
backgroundColor: "transparent", // mui has a default background color for hover
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
props: { variant: "outlinedWhite" },
|
|
79
|
+
style: {
|
|
80
|
+
backgroundColor: "white",
|
|
81
|
+
border: "1px solid",
|
|
82
|
+
borderColor: colors_1.colors.silverGrayLight,
|
|
83
|
+
color: colors_1.colors.darkGray1,
|
|
84
|
+
"&.Mui-focusVisible": {
|
|
85
|
+
backgroundColor: "white",
|
|
86
|
+
},
|
|
87
|
+
"&.MuiChip-clickable:hover, &.MuiChip-deletable:hover": {
|
|
88
|
+
color: colors_1.colors.darkGray1,
|
|
89
|
+
borderColor: colors_1.colors.silverGrayDark,
|
|
90
|
+
backgroundColor: "white", // mui has a default background color hover
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
props: { variant: "gray" },
|
|
96
|
+
style: {
|
|
97
|
+
backgroundColor: colors_1.colors.lightGray2,
|
|
98
|
+
border: "none",
|
|
99
|
+
color: colors_1.colors.darkGray2,
|
|
100
|
+
"&.Mui-focusVisible": {
|
|
101
|
+
backgroundColor: colors_1.colors.lightGray2,
|
|
102
|
+
},
|
|
103
|
+
"&.MuiChip-clickable:hover, &.MuiChip-deletable:hover": {
|
|
104
|
+
color: colors_1.colors.darkGray1,
|
|
105
|
+
backgroundColor: colors_1.colors.silverGrayLight,
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
props: { variant: "dark" },
|
|
111
|
+
style: {
|
|
112
|
+
backgroundColor: colors_1.colors.silverGrayDark,
|
|
113
|
+
border: "none",
|
|
114
|
+
color: colors_1.colors.white,
|
|
115
|
+
"&.Mui-focusVisible": {
|
|
116
|
+
backgroundColor: colors_1.colors.silverGrayDark,
|
|
117
|
+
},
|
|
118
|
+
"&.MuiChip-clickable:hover, &.MuiChip-deletable:hover": {
|
|
119
|
+
backgroundColor: colors_1.colors.darkGray1,
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
props: { variant: "darker" },
|
|
125
|
+
style: {
|
|
126
|
+
backgroundColor: colors_1.colors.darkGray2,
|
|
127
|
+
border: `1px solid ${colors_1.colors.darkGray1}`,
|
|
128
|
+
color: colors_1.colors.white,
|
|
129
|
+
"&.Mui-focusVisible": {
|
|
130
|
+
backgroundColor: colors_1.colors.darkGray2,
|
|
131
|
+
},
|
|
132
|
+
"&.MuiChip-clickable:hover, &.MuiChip-deletable:hover": {
|
|
133
|
+
backgroundColor: colors_1.colors.black,
|
|
134
|
+
border: `1px solid ${colors_1.colors.silverGray}`,
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
props: { variant: "filled" },
|
|
140
|
+
style: {
|
|
141
|
+
backgroundColor: colors_1.colors.mitRed,
|
|
142
|
+
border: "none",
|
|
143
|
+
color: colors_1.colors.white,
|
|
144
|
+
"&.Mui-focusVisible": {
|
|
145
|
+
backgroundColor: colors_1.colors.mitRed,
|
|
146
|
+
},
|
|
147
|
+
"&.MuiChip-clickable:hover, &.MuiChip-deletable:hover": {
|
|
148
|
+
backgroundColor: colors_1.colors.red,
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
],
|
|
153
|
+
};
|
|
154
|
+
exports.chipComponent = chipComponent;
|