-
-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
66cce8f
commit 438ca9b
Showing
27 changed files
with
328 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import { Meta } from "@storybook/blocks"; | ||
|
||
<Meta title="How to use" /> | ||
|
||
<style> | ||
{` | ||
ol { | ||
list-style: decimal; | ||
} | ||
`} | ||
</style> | ||
|
||
# How to use | ||
|
||
If you haven't started a Material UI project yet, you can use one of the following playground: | ||
|
||
[![Edit on StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/siriwatknp/mui-treasury/tree/master/examples/mui-treasury-playground) | ||
|
||
[![Edit on CodeSandbox](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/p/sandbox/github/siriwatknp/mui-treasury/tree/master/examples/mui-treasury-playground) | ||
|
||
There are 2 ways to use the blocks: | ||
|
||
## 1. Copy and paste | ||
|
||
This is a quick way to try out a block. | ||
|
||
1. Go to the blocks that you want to clone. For example, [Card Galaxy](/story/card-galaxy--galaxy). | ||
2. Click "See code" on the toolbar at the top of the page | ||
![image](https://github.com/user-attachments/assets/9479d05d-97ae-44b7-896e-457cf0eda69a) | ||
|
||
3. Copy the code and paste it into your project. | ||
![image](https://github.com/user-attachments/assets/da618edd-71de-4fdd-876e-81d419264ab5) | ||
|
||
If you need to use a lot of blocks at once, I recommend using the [command line](#2-clone-blocks-through-cli) instead. | ||
|
||
## 2. Clone blocks through CLI | ||
|
||
You should have a working Material UI project before you start, or use one of these playgrounds: | ||
|
||
[![Edit on StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/siriwatknp/mui-treasury/tree/master/examples/mui-treasury-playground) | ||
|
||
[![Edit on CodeSandbox](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/p/sandbox/github/siriwatknp/mui-treasury/tree/master/examples/mui-treasury-playground) | ||
|
||
1. Go to the blocks that you want to **clone**. For example, [Card Galaxy](/story/card-galaxy--galaxy). | ||
2. Click "Add" on the toolbar at the top of the page | ||
![image](https://github.com/user-attachments/assets/c4afffe2-bc69-4d47-aecb-71ecaed77504) | ||
|
||
Then, you will see the block appear in the selection (other blocks that are the dependencies of the block will be added as well). | ||
![image](https://github.com/user-attachments/assets/95f30627-a518-4f4e-88e6-fc8fc82d9330) | ||
|
||
3. Click "Copy" to copy the command line to your clipboard. | ||
![image](https://github.com/user-attachments/assets/3f70c65c-e542-4a07-9aa1-ccd338d3308d) | ||
|
||
4. Go to your project, open the terminal at the root directory, and paste the command line. | ||
![image](https://github.com/user-attachments/assets/db480cf0-5e29-441f-8f72-ad125b10e8f3) | ||
|
||
After running the command, you will see the block(s) in the `src/mui-treasury` folder. | ||
|
||
5. Import the block to a page. It's that simple! | ||
|
||
For more details about the command line interface, check out the [CLI documentation](/docs/command-line--docs). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
dist | ||
dist-ssr | ||
*.local | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# MUI Treasury Playground - Vite.js in TypeScript example | ||
|
||
This is a [Vite](https://vitejs.dev/) project bootstrapped using [`create-vite`](https://vitejs.dev/guide/#scaffolding-your-first-vite-project) with [Material UI](https://mui.com/material-ui/getting-started/) installed. | ||
|
||
## How to use | ||
|
||
Download the example: | ||
|
||
<!-- #default-branch-switch --> | ||
|
||
```bash | ||
curl https://codeload.github.com/siriwatknp/mui-treasury/tar.gz/next | tar -xz --strip=2 mui-treasury-master/examples/mui-treasury-playground | ||
cd mui-treasury-playground | ||
``` | ||
|
||
Install it and run: | ||
|
||
```bash | ||
yarn install | ||
yarn dev | ||
``` | ||
|
||
Open [http://localhost:5173](http://localhost:5173) with your browser to see the result. | ||
|
||
or: | ||
|
||
<!-- #default-branch-switch --> | ||
|
||
[![Edit on StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/siriwatknp/mui-treasury/tree/master/examples/mui-treasury-playground) | ||
|
||
[![Edit on CodeSandbox](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/p/sandbox/github/siriwatknp/mui-treasury/tree/master/examples/mui-treasury-playground) | ||
|
||
## Learn more | ||
|
||
To learn more about this example: | ||
|
||
- [MUI Treasury](https://mui-treasury.com) - Get all the blocks for FREE. | ||
- [Material UI](https://mui.com/material-ui/getting-started/) - learn about Material UI components and API. | ||
- [Vite documentation](https://vitejs.dev/) - learn about Vite features and API. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import js from '@eslint/js' | ||
import globals from 'globals' | ||
import reactHooks from 'eslint-plugin-react-hooks' | ||
import reactRefresh from 'eslint-plugin-react-refresh' | ||
import tseslint from 'typescript-eslint' | ||
|
||
export default tseslint.config({ | ||
extends: [js.configs.recommended, ...tseslint.configs.recommended], | ||
files: ['**/*.{ts,tsx}'], | ||
ignores: ['dist'], | ||
languageOptions: { | ||
ecmaVersion: 2020, | ||
globals: globals.browser, | ||
}, | ||
plugins: { | ||
'react-hooks': reactHooks, | ||
'react-refresh': reactRefresh, | ||
}, | ||
rules: { | ||
...reactHooks.configs.recommended.rules, | ||
'react-refresh/only-export-components': [ | ||
'warn', | ||
{ allowConstantExport: true }, | ||
], | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Vite + React + TS</title> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/src/main.tsx"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"name": "mui-treasury-layout-vite", | ||
"private": true, | ||
"version": "0.0.0", | ||
"type": "module", | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "tsc -b && vite build", | ||
"lint": "eslint .", | ||
"preview": "vite preview" | ||
}, | ||
"dependencies": { | ||
"@emotion/react": "latest", | ||
"@emotion/styled": "latest", | ||
"@mui/icons-material": "next", | ||
"@mui/material": "next", | ||
"react": "latest", | ||
"react-dom": "latest" | ||
}, | ||
"devDependencies": { | ||
"@eslint/js": "latest", | ||
"@types/react": "latest", | ||
"@types/react-dom": "latest", | ||
"@vitejs/plugin-react": "latest", | ||
"eslint": "latest", | ||
"eslint-plugin-react-hooks": "latest", | ||
"eslint-plugin-react-refresh": "latest", | ||
"globals": "latest", | ||
"mui-treasury": "latest", | ||
"typescript": "latest", | ||
"typescript-eslint": "latest", | ||
"vite": "latest" | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import Box from "@mui/material/Box"; | ||
|
||
export default function App() { | ||
return ( | ||
<Box sx={{ display: "grid", placeItems: "center" }}> | ||
<a | ||
href="https://mui-treasury.com" | ||
target="_blank" | ||
rel="noreferrer noopener" | ||
> | ||
Get blocks | ||
</a> | ||
</Box> | ||
); | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.