-
Notifications
You must be signed in to change notification settings - Fork 1
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
74b0d23
commit 7ad1f7b
Showing
51 changed files
with
2,322 additions
and
106 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
{ | ||
"eslint.validate": ["json"] | ||
"eslint.validate": [ | ||
"json" | ||
], | ||
"typescript.tsdk": "node_modules/typescript/lib" | ||
} |
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 |
---|---|---|
@@ -1,12 +1,11 @@ | ||
const global = require('../../jest.config.global'); | ||
|
||
const esModules = ['uuid']; | ||
|
||
module.exports = { | ||
...global, | ||
displayName: 'event-tracker', | ||
coverageDirectory: '../../coverage/event-tracker', | ||
transformIgnorePatterns: [ | ||
`/node_modules/(?!${esModules})` | ||
] | ||
moduleNameMapper: { | ||
// Force module uuid to resolve with the CJS entry point, because Jest does not support package.json.exports. See https://github.com/uuidjs/uuid/issues/451 | ||
uuid: require.resolve('uuid'), | ||
}, | ||
}; |
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
Empty file.
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 @@ | ||
# @availity/mui-file-selector | ||
|
||
> Availity MUI File Selector component to be used with @availity/element design system. | ||
[](https://www.npmjs.com/package/@availity/mui-file-selector) | ||
[](https://www.npmjs.com/package/@availity/mui-file-selector) | ||
[](https://github.com/Availity/element/blob/main/packages/mui-file-selector/package.json) | ||
|
||
## Documentation | ||
|
||
This package extends the MUI File Selector component: [MUI File Selector Docs](https://mui.com/components/file-selector/) | ||
|
||
Live demo and documentation in our [Storybook](https://availity.github.io/element/?path=/docs/components-file-selector-introduction--docs) | ||
|
||
Availity standards for design and usage can be found in the [Availity Design Guide](https://zeroheight.com/2e36e50c7) | ||
|
||
## Installation | ||
|
||
### Import Through @availity/element (Recommended) | ||
|
||
#### NPM | ||
|
||
```bash | ||
npm install @availity/element | ||
``` | ||
|
||
#### Yarn | ||
|
||
```bash | ||
yarn add @availity/element | ||
``` | ||
|
||
### Direct Import | ||
|
||
#### NPM | ||
|
||
_This package has a few peer dependencies. Add `@mui/material` & `@emotion/react` to your project if not already installed._ | ||
|
||
```bash | ||
npm install @availity/mui-file-selector | ||
``` | ||
|
||
#### Yarn | ||
|
||
```bash | ||
yarn add @availity/mui-file-selector | ||
``` | ||
|
||
### Usage | ||
|
||
#### Import through @availity/element | ||
|
||
```tsx | ||
import { FileSelector } from '@availity/element'; | ||
``` | ||
|
||
#### Direct import | ||
|
||
```tsx | ||
import { FileSelector } from '@availity/mui-file-selector'; | ||
``` |
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,7 @@ | ||
import { Markdown } from '@storybook/blocks'; | ||
import { Meta } from '@storybook/addon-docs'; | ||
import ReadMe from './README.md?raw'; | ||
|
||
<Meta title="Components/File Selector/Introduction" /> | ||
|
||
<Markdown>{ReadMe}</Markdown> |
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,11 @@ | ||
const global = require('../../jest.config.global'); | ||
|
||
module.exports = { | ||
...global, | ||
displayName: 'file-selector', | ||
coverageDirectory: '../../coverage/file-selector', | ||
moduleNameMapper: { | ||
// Force module uuid to resolve with the CJS entry point, because Jest does not support package.json.exports. See https://github.com/uuidjs/uuid/issues/451 | ||
uuid: require.resolve('uuid'), | ||
}, | ||
}; |
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,65 @@ | ||
{ | ||
"name": "@availity/mui-file-selector", | ||
"version": "0.0.0", | ||
"description": "Availity MUI file-selector Component - part of the @availity/element design system", | ||
"keywords": [ | ||
"react", | ||
"typescript", | ||
"availity", | ||
"mui" | ||
], | ||
"homepage": "https://availity.github.io/element/?path=/docs/components-file-selector-introduction--docs", | ||
"bugs": { | ||
"url": "https://github.com/Availity/element/issues" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/Availity/element.git", | ||
"directory": "packages/file-selector" | ||
}, | ||
"license": "MIT", | ||
"author": "Availity Developers <[email protected]>", | ||
"browser": "./dist/index.js", | ||
"main": "./dist/index.js", | ||
"module": "./dist/index.mjs", | ||
"types": "./dist/index.d.ts", | ||
"scripts": { | ||
"build": "tsup src/index.ts --format esm,cjs --dts", | ||
"dev": "tsup src/index.ts --format esm,cjs --watch --dts", | ||
"clean": "rm -rf dist", | ||
"clean:nm": "rm -rf node_modules", | ||
"publish": "yarn npm publish --tolerate-republish --access public", | ||
"publish:canary": "yarn npm publish --access public --tag canary" | ||
}, | ||
"dependencies": { | ||
"@availity/api-axios": "^9.0.4", | ||
"@availity/mui-button": "workspace:^", | ||
"@availity/mui-divider": "workspace:^", | ||
"@availity/mui-form-utils": "workspace:^", | ||
"@availity/mui-icon": "workspace:^", | ||
"@availity/mui-layout": "workspace:^", | ||
"@availity/mui-list": "workspace:^", | ||
"@availity/mui-progress": "workspace:^", | ||
"@availity/mui-typography": "workspace:^", | ||
"@availity/upload-core": "^6.0.4", | ||
"@tanstack/react-query": "^4.36.1", | ||
"react-dropzone": "^11.7.1", | ||
"react-hook-form": "^7.51.3", | ||
"uuid": "^9.0.1" | ||
}, | ||
"devDependencies": { | ||
"@mui/material": "^5.15.15", | ||
"@types/tus-js-client": "^1.8.0", | ||
"react": "18.2.0", | ||
"react-dom": "18.2.0", | ||
"tsup": "^8.0.2", | ||
"typescript": "^5.4.5" | ||
}, | ||
"peerDependencies": { | ||
"@mui/material": "^5.11.9", | ||
"react": ">=16.3.0" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
} | ||
} |
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,41 @@ | ||
{ | ||
"name": "mui-file-selector", | ||
"$schema": "../../node_modules/nx/schemas/project-schema.json", | ||
"sourceRoot": "packages/file-selector/src", | ||
"projectType": "library", | ||
"tags": [], | ||
"targets": { | ||
"lint": { | ||
"executor": "@nx/eslint:lint", | ||
"options": { | ||
"eslintConfig": ".eslintrc.json", | ||
"silent": false, | ||
"fix": false, | ||
"cache": true, | ||
"cacheLocation": "./node_modules/.cache/file-selector/.eslintcache", | ||
"maxWarnings": -1, | ||
"quiet": false, | ||
"noEslintrc": false, | ||
"hasTypeAwareRules": true, | ||
"cacheStrategy": "metadata" | ||
} | ||
}, | ||
"test": { | ||
"executor": "@nx/jest:jest", | ||
"outputs": ["{workspaceRoot}/coverage/file-selector"], | ||
"options": { | ||
"jestConfig": "packages/file-selector/jest.config.js" | ||
} | ||
}, | ||
"version": { | ||
"executor": "@jscutlery/semver:version", | ||
"options": { | ||
"preset": "conventional", | ||
"commitMessageFormat": "chore({projectName}): release version ${version} [skip ci]", | ||
"tagPrefix": "@availity/{projectName}@", | ||
"trackDeps": true, | ||
"skipCommitTypes": ["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 @@ | ||
export * from './lib/UploadProgressBar'; |
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,28 @@ | ||
import { ReactNode } from 'react'; | ||
import { render, screen } from '@testing-library/react'; | ||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; | ||
import { useForm, FormProvider } from 'react-hook-form'; | ||
|
||
import { Dropzone } from './Dropzone'; | ||
|
||
const TestForm = ({ children }: { children: ReactNode }) => { | ||
const methods = useForm(); | ||
|
||
return <FormProvider {...methods}>{children}</FormProvider>; | ||
}; | ||
|
||
describe('Dropzone', () => { | ||
test('should render successfully', () => { | ||
const client = new QueryClient(); | ||
|
||
render( | ||
<QueryClientProvider client={client}> | ||
<TestForm> | ||
<Dropzone name="test" bucketId="test" customerId="123" clientId="test" maxSize={1000} /> | ||
</TestForm> | ||
</QueryClientProvider> | ||
); | ||
|
||
expect(screen.getByText('Drag and Drop Files Here')).toBeTruthy(); | ||
}); | ||
}); |
Oops, something went wrong.