|
7 | 7 | ## Installation
|
8 | 8 |
|
9 | 9 | ```bash
|
10 |
| -npm install mod-arch-shared |
| 10 | +npm install mod-arch-shared @mui/material @mui/icons-material @mui/types sass sass-loader |
11 | 11 | ```
|
12 | 12 |
|
| 13 | +The library requires peer dependencies to be installed alongside the main package: |
| 14 | +- **MUI dependencies** (`@mui/material`, `@mui/icons-material`, `@mui/types`) are required for both PatternFly and MUI theme support |
| 15 | +- **SASS dependencies** (`sass`, `sass-loader`) are required to process SCSS files used by the library components |
| 16 | + |
| 17 | +### SASS/SCSS Processing Requirements |
| 18 | + |
| 19 | +This library contains SCSS files that need to be processed by your application's build system. You must: |
| 20 | + |
| 21 | +1. **Install the required dependencies:** |
| 22 | + ```bash |
| 23 | + npm install sass sass-loader |
| 24 | + ``` |
| 25 | + |
| 26 | +2. **Configure your webpack to handle SCSS files** by adding this rule to your webpack configuration: |
| 27 | + ```js |
| 28 | + { |
| 29 | + test: /\.s[ac]ss$/i, |
| 30 | + use: [ |
| 31 | + // Creates `style` nodes from JS strings |
| 32 | + 'style-loader', |
| 33 | + // Translates CSS into CommonJS |
| 34 | + 'css-loader', |
| 35 | + // Compiles Sass to CSS |
| 36 | + 'sass-loader', |
| 37 | + ], |
| 38 | + } |
| 39 | + ``` |
| 40 | + |
| 41 | +If you're using Create React App, Vite, or similar build tools, SCSS support is typically included by default when you install the `sass` package. |
| 42 | + |
13 | 43 | ## Usage
|
14 | 44 |
|
15 | 45 | Import components and utilities as needed:
|
@@ -154,6 +184,8 @@ root.render(
|
154 | 184 | - **`Theme.Patternfly`**: Red Hat PatternFly design system (default)
|
155 | 185 | - **`Theme.MUI`**: Material-UI design system with CSS variables
|
156 | 186 |
|
| 187 | +Both themes require the MUI peer dependencies to be installed. |
| 188 | + |
157 | 189 | ### Using the Context in Components
|
158 | 190 |
|
159 | 191 | Once providers are set up, you can access the configuration and state throughout your application:
|
|
0 commit comments