@movable/ui 0.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.cjs ADDED
@@ -0,0 +1,27 @@
1
+ /* eslint-env node */
2
+
3
+ module.exports = {
4
+ root: true,
5
+ env: { browser: true, es2020: true },
6
+ extends: [
7
+ 'eslint:recommended',
8
+ 'plugin:@typescript-eslint/recommended',
9
+ 'plugin:@typescript-eslint/recommended-requiring-type-checking',
10
+ 'plugin:react-hooks/recommended',
11
+ ],
12
+ parser: '@typescript-eslint/parser',
13
+ parserOptions: {
14
+ ecmaVersion: 'latest',
15
+ sourceType: 'module',
16
+ project: true,
17
+ tsconfigRootDir: __dirname,
18
+ },
19
+ plugins: ['react-refresh'],
20
+ rules: {
21
+ 'react-refresh/only-export-components': [
22
+ 'warn',
23
+ { allowConstantExport: true },
24
+ ],
25
+ '@typescript-eslint/no-non-null-assertion': 'off',
26
+ },
27
+ }
@@ -0,0 +1,14 @@
1
+ name: Commit Lint
2
+
3
+ on: [pull_request]
4
+
5
+ jobs:
6
+ lint:
7
+ runs-on: ubuntu-latest
8
+ env:
9
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10
+ steps:
11
+ - uses: actions/checkout@v2
12
+ with:
13
+ fetch-depth: 0
14
+ - uses: wagoid/commitlint-github-action@v1
@@ -0,0 +1,4 @@
1
+ #!/bin/sh
2
+ . "$(dirname "$0")/_/husky.sh"
3
+
4
+ npx --no -- commitlint --edit
@@ -0,0 +1,4 @@
1
+ #!/bin/sh
2
+ . "$(dirname "$0")/_/husky.sh"
3
+
4
+ npx lint-staged
@@ -0,0 +1,46 @@
1
+ {
2
+ "hooks": {
3
+ "after:release": "prettier --write CHANGELOG.md"
4
+ },
5
+ "git": {
6
+ "commitMessage": "chore: release v${version}"
7
+ },
8
+ "github": {
9
+ "release": true
10
+ },
11
+ "plugins": {
12
+ "@release-it/conventional-changelog": {
13
+ "infile": "CHANGELOG.md",
14
+ "preset": {
15
+ "name": "conventionalcommits",
16
+ "types": [
17
+ {
18
+ "type": "feat",
19
+ "section": "Features"
20
+ },
21
+ {
22
+ "type": "security",
23
+ "section": "Security"
24
+ },
25
+ {
26
+ "type": "chore,refactor",
27
+ "section": "Enhancments"
28
+ },
29
+ {
30
+ "type": "style",
31
+ "section": "Style"
32
+ },
33
+ {
34
+ "type": "test,ci",
35
+ "section": "Test & Continuous Integration"
36
+ },
37
+ {
38
+ "type": "fix",
39
+ "section": "Bug Fixes"
40
+ },
41
+ {}
42
+ ]
43
+ }
44
+ }
45
+ }
46
+ }
package/CODEOWNERS ADDED
@@ -0,0 +1,2 @@
1
+ * @movableink/front-end-vite
2
+ * @movableink/design-systems
package/README.md ADDED
@@ -0,0 +1,23 @@
1
+ # @movable/ui
2
+
3
+ This repo contains the shared components for our frontend applications. Using this [react component library guide](https://prateeksurana.me/blog/react-component-library-using-storybook-7/#compiling-the-library-using-rollup)
4
+
5
+ ## Local Development
6
+ ### Installation
7
+
8
+ 1. Ensure you have [`volta`](https://volta.sh) installed on your computer
9
+ 2. Clone the repo
10
+ 3. `npm install`
11
+ ## Conventional Commits
12
+
13
+ This repo has [conventional-commits](https://www.conventionalcommits.org/en/v1.0.0/#summary) We lint for this both pre-commit and on PR actions. It is **required** and will not pass without it.
14
+
15
+ Ex:
16
+
17
+ ```
18
+ fix(percy): added percy snapshots for all component states
19
+
20
+ - active
21
+ - disabled
22
+ - focused
23
+ ```
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ extends: ['@commitlint/config-conventional'],
5
+ };
@@ -0,0 +1,2 @@
1
+ import React from "react";
2
+ export default function Button(): React.JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function sayHello(name: string): string;
@@ -0,0 +1,2 @@
1
+ import Button from "./components/Button";
2
+ export { Button };
@@ -0,0 +1,10 @@
1
+ 'use strict';
2
+
3
+ var React = require('react');
4
+
5
+ function Button() {
6
+ return (React.createElement("button", null, "Example Button"));
7
+ }
8
+
9
+ exports.Button = Button;
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../src/components/Button.tsx"],"sourcesContent":["import React from \"react\";\n\nexport default function Button() {\n return (\n <button>Example Button</button>\n )\n}"],"names":[],"mappings":";;;;AAEc,SAAU,MAAM,GAAA;IAC5B,QACE,KAA+B,CAAA,aAAA,CAAA,QAAA,EAAA,IAAA,EAAA,gBAAA,CAAA,EAChC;AACH;;;;"}
@@ -0,0 +1,2 @@
1
+ import React from "react";
2
+ export default function Button(): React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from "react";
2
+ export default function Button(): React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import Button from "./components/Button";
2
+ export { Button };
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+
3
+ function Button() {
4
+ return (React.createElement("button", null, "Example Button"));
5
+ }
6
+
7
+ export { Button };
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../src/components/Button.tsx"],"sourcesContent":["import React from \"react\";\n\nexport default function Button() {\n return (\n <button>Example Button</button>\n )\n}"],"names":[],"mappings":";;AAEc,SAAU,MAAM,GAAA;IAC5B,QACE,KAA+B,CAAA,aAAA,CAAA,QAAA,EAAA,IAAA,EAAA,gBAAA,CAAA,EAChC;AACH;;;;"}
package/lib/index.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+
3
+ declare function Button(): React.JSX.Element;
4
+
5
+ export { Button };
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+
3
+ function Button() {
4
+ return (React.createElement("button", null, "Example Button"));
5
+ }
6
+
7
+ export { Button };
8
+ //# sourceMappingURL=index.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.esm.js","sources":["../src/components/Button.tsx"],"sourcesContent":["import React from \"react\";\n\nexport default function Button() {\n return (\n <button>Example Button</button>\n )\n}"],"names":[],"mappings":";;AAEc,SAAU,MAAM,GAAA;IAC5B,QACE,KAA+B,CAAA,aAAA,CAAA,QAAA,EAAA,IAAA,EAAA,gBAAA,CAAA,EAChC;AACH;;;;"}
package/lib/index.js ADDED
@@ -0,0 +1,10 @@
1
+ 'use strict';
2
+
3
+ var React = require('react');
4
+
5
+ function Button() {
6
+ return (React.createElement("button", null, "Example Button"));
7
+ }
8
+
9
+ exports.Button = Button;
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../src/components/Button.tsx"],"sourcesContent":["import React from \"react\";\n\nexport default function Button() {\n return (\n <button>Example Button</button>\n )\n}"],"names":[],"mappings":";;;;AAEc,SAAU,MAAM,GAAA;IAC5B,QACE,KAA+B,CAAA,aAAA,CAAA,QAAA,EAAA,IAAA,EAAA,gBAAA,CAAA,EAChC;AACH;;;;"}
package/lib/theme.d.ts ADDED
@@ -0,0 +1,57 @@
1
+ declare module '@mui/material/styles' {
2
+ interface PaletteColor {
3
+ selected?: string;
4
+ }
5
+ interface Palette {
6
+ focusVisible: string;
7
+ neutral50: string;
8
+ neutral100: string;
9
+ neutral200: string;
10
+ neutral300: string;
11
+ neutral400: string;
12
+ neutral500: string;
13
+ neutral600: string;
14
+ neutral700: string;
15
+ neutral800: string;
16
+ neutral900: string;
17
+ neutralA100: string;
18
+ neutralA200: string;
19
+ neutralA400: string;
20
+ neutralA700: string;
21
+ blue50: string;
22
+ blue100: string;
23
+ blue200: string;
24
+ blue300: string;
25
+ blue400: string;
26
+ blue500: string;
27
+ blue600: string;
28
+ blue700: string;
29
+ blue800: string;
30
+ blue900: string;
31
+ }
32
+ interface PalletteOptions {
33
+ focusVisible: string;
34
+ neutral50: string;
35
+ neutral100: string;
36
+ neutral200: string;
37
+ neutral300: string;
38
+ neutral400: string;
39
+ neutral500: string;
40
+ neutral600: string;
41
+ neutral700: string;
42
+ neutral800: string;
43
+ neutral900: string;
44
+ neutralA100: string;
45
+ neutralA200: string;
46
+ neutralA400: string;
47
+ neutralA700: string;
48
+ blue50: string;
49
+ blue100: string;
50
+ blue200: string;
51
+ blue300: string;
52
+ blue400: string;
53
+ blue500: string;
54
+ }
55
+ }
56
+ declare const theme: import("@mui/material/styles").Theme;
57
+ export default theme;
package/package.json ADDED
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "@movable/ui",
3
+ "version": "0.0.0",
4
+ "description": "Movable Ink's shared MUI components and MUI theme for our vite applications",
5
+ "main": "lib/index.js",
6
+ "module": "lib/index.esm.js",
7
+ "types": "lib/index.d.ts",
8
+ "scripts": {
9
+ "lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
10
+ "build": "rollup -c",
11
+ "release": "release-it",
12
+ "prepare": "husky install"
13
+ },
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/movableink/ui.git"
17
+ },
18
+ "keywords": [
19
+ "mui",
20
+ "muitheme",
21
+ "react"
22
+ ],
23
+ "author": "Movable Ink <dev@movableink.com>",
24
+ "license": "ISC",
25
+ "bugs": {
26
+ "url": "https://github.com/movableink/ui/issues"
27
+ },
28
+ "homepage": "https://github.com/movableink/ui#readme",
29
+ "devDependencies": {
30
+ "@commitlint/cli": "^17.6.7",
31
+ "@commitlint/config-conventional": "^17.6.7",
32
+ "@rollup/plugin-commonjs": "^25.0.3",
33
+ "@rollup/plugin-node-resolve": "^15.1.0",
34
+ "@rollup/plugin-typescript": "^11.1.2",
35
+ "@types/react": "^18.2.19",
36
+ "@types/react-dom": "^18.2.7",
37
+ "husky": "^8.0.0",
38
+ "lint-staged": "^13.2.3",
39
+ "postcss": "^8.4.27",
40
+ "react": "^18.2.0",
41
+ "release-it": "^16.1.3",
42
+ "rollup": "^3.27.2",
43
+ "rollup-plugin-dts": "^5.3.1",
44
+ "rollup-plugin-peer-deps-external": "^2.2.4",
45
+ "rollup-plugin-postcss": "^4.0.2",
46
+ "typescript": "^5.1.6"
47
+ },
48
+ "peerDependencies": {
49
+ "react": "^18.2.0",
50
+ "react-dom": "^18.2.0"
51
+ },
52
+ "lint-staged": {
53
+ "src/*.{ts,tsx}": "eslint --fix"
54
+ },
55
+ "volta": {
56
+ "node": "18.17.0"
57
+ }
58
+ }
@@ -0,0 +1,44 @@
1
+ import peerDepsExternal from "rollup-plugin-peer-deps-external";
2
+ import resolve from "@rollup/plugin-node-resolve";
3
+ import commonjs from "@rollup/plugin-commonjs";
4
+ import typescript from "@rollup/plugin-typescript";
5
+ import postcss from "rollup-plugin-postcss";
6
+ import dts from "rollup-plugin-dts";
7
+
8
+ // This is required to read package.json file when
9
+ // using Native ES modules in Node.js
10
+ // https://rollupjs.org/command-line-interface/#importing-package-json
11
+ import { createRequire } from 'node:module';
12
+ const requireFile = createRequire(import.meta.url);
13
+ const packageJson = requireFile('./package.json');
14
+
15
+
16
+ export default [{
17
+ input: "src/index.ts",
18
+ output: [
19
+ {
20
+ file: packageJson.main,
21
+ format: "cjs",
22
+ sourcemap: true
23
+ },
24
+ {
25
+ file: packageJson.module,
26
+ format: "esm",
27
+ sourcemap: true
28
+ }
29
+ ],
30
+ plugins: [
31
+ peerDepsExternal(),
32
+ resolve(),
33
+ commonjs(),
34
+ typescript(),
35
+ postcss({
36
+ extensions: ['.css']
37
+ })
38
+ ]
39
+ }, {
40
+ input: 'lib/index.d.ts',
41
+ output: [{ file: 'lib/index.d.ts', format: 'es' }],
42
+ plugins: [dts()],
43
+ external: [/\.css$/]
44
+ }];
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+
3
+ export default function Button() {
4
+ return (
5
+ <button>Example Button</button>
6
+ )
7
+ }
package/src/index.ts ADDED
@@ -0,0 +1,3 @@
1
+ import Button from "./components/Button";
2
+
3
+ export { Button };
package/tsconfig.json ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "es5",
4
+ "outDir": "lib",
5
+ "lib": ["dom", "dom.iterable", "esnext"],
6
+ "declaration": true,
7
+ "declarationDir": "lib",
8
+ "allowJs": true,
9
+ "skipLibCheck": true,
10
+ "esModuleInterop": true,
11
+ "allowSyntheticDefaultImports": true,
12
+ "strict": true,
13
+ "forceConsistentCasingInFileNames": true,
14
+ "module": "esnext",
15
+ "moduleResolution": "node",
16
+ "resolveJsonModule": true,
17
+ "isolatedModules": true,
18
+ "noEmit": true,
19
+ "jsx": "react"
20
+ },
21
+ "include": ["src"],
22
+ "exclude": ["node_modules", "lib"]
23
+ }