@availity/mui-badge 0.1.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/CHANGELOG.md +10 -0
- package/README.md +57 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +37 -0
- package/dist/index.mjs +10 -0
- package/introduction.mdx +7 -0
- package/jest.config.js +7 -0
- package/package.json +50 -0
- package/project.json +41 -0
- package/src/index.ts +1 -0
- package/src/lib/Badge.tsx +14 -0
- package/tsconfig.json +5 -0
- package/tsconfig.spec.json +10 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
|
+
|
|
5
|
+
## 0.1.0 (2023-02-28)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **badge:** init ([630b429](https://github.com/Availity/element/commit/630b4297f7787ca3ebd1daf5ddec36ed103bd883))
|
package/README.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# @availity/mui-badge
|
|
2
|
+
|
|
3
|
+
> Availity MUI Badge component to be used with @availity/element design system.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@availity/mui-badge)
|
|
6
|
+
[](https://www.npmjs.com/package/@availity/mui-badge)
|
|
7
|
+
[](https://github.com/Availity/availity-react/blob/master/packages/mui-badge/package.json)
|
|
8
|
+
|
|
9
|
+
## Documentation
|
|
10
|
+
|
|
11
|
+
This package extends the MUI Badge component: [MUI Badge Docs](https://v4.mui.com/components/badges/)
|
|
12
|
+
|
|
13
|
+
Live demo and documentation in our [Storybook](https://availity.github.io/element/?path=/docs/components-badge-introduction--docs)
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
### Import Through @availity/element (Recommended)
|
|
18
|
+
|
|
19
|
+
#### NPM
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm install @availity/element
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
#### Yarn
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
yarn add @availity/element
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Direct Import
|
|
32
|
+
|
|
33
|
+
#### NPM
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npm install @availity/mui-badge
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
#### Yarn
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
yarn add @availity/mui-badge
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Usage
|
|
46
|
+
|
|
47
|
+
#### Import through @availity/element
|
|
48
|
+
|
|
49
|
+
```tsx
|
|
50
|
+
import { Badge } from '@availity/element';
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
#### Direct import
|
|
54
|
+
|
|
55
|
+
```tsx
|
|
56
|
+
import Badge from '@availity/mui-badge';
|
|
57
|
+
```
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BadgeProps as BadgeProps$1 } from '@mui/material';
|
|
3
|
+
|
|
4
|
+
type BadgeProps = {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
} & BadgeProps$1;
|
|
7
|
+
declare const Badge: ({ children, ...rest }: BadgeProps) => JSX.Element;
|
|
8
|
+
|
|
9
|
+
export { Badge, BadgeProps };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var src_exports = {};
|
|
22
|
+
__export(src_exports, {
|
|
23
|
+
Badge: () => Badge
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(src_exports);
|
|
26
|
+
|
|
27
|
+
// src/lib/Badge.tsx
|
|
28
|
+
var import_material = require("@mui/material");
|
|
29
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
30
|
+
var Badge = ({ children, ...rest }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Badge, {
|
|
31
|
+
...rest,
|
|
32
|
+
children
|
|
33
|
+
});
|
|
34
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
35
|
+
0 && (module.exports = {
|
|
36
|
+
Badge
|
|
37
|
+
});
|
package/dist/index.mjs
ADDED
package/introduction.mdx
ADDED
package/jest.config.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@availity/mui-badge",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Availity MUI Badge Component - part of the @availity/element design system",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"react",
|
|
7
|
+
"typescript",
|
|
8
|
+
"availity",
|
|
9
|
+
"badge",
|
|
10
|
+
"mui"
|
|
11
|
+
],
|
|
12
|
+
"homepage": "https://availity.github.io/element/?path=/docs/components-badge-introduction--docs",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/Availity/element/issues"
|
|
15
|
+
},
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "https://github.com/Availity/element.git",
|
|
19
|
+
"directory": "packages/badge"
|
|
20
|
+
},
|
|
21
|
+
"license": "MIT",
|
|
22
|
+
"author": "Roxanne Young <roxanne.young@availity.com>",
|
|
23
|
+
"browser": "./dist/index.js",
|
|
24
|
+
"main": "./dist/index.js",
|
|
25
|
+
"module": "./dist/index.mjs",
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "tsup src/index.ts --format esm,cjs --dts",
|
|
29
|
+
"dev": "tsup src/index.ts --format esm,cjs --watch --dts",
|
|
30
|
+
"clean": "rm -rf dist",
|
|
31
|
+
"clean:nm": "rm -rf node_modules",
|
|
32
|
+
"bundlesize": "bundlesize",
|
|
33
|
+
"publish": "yarn npm publish --tolerate-republish --access public",
|
|
34
|
+
"publish:canary": "yarn npm publish --access public --tag canary"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@mui/material": "^5.11.9",
|
|
38
|
+
"react": "18.2.0",
|
|
39
|
+
"react-dom": "18.2.0",
|
|
40
|
+
"tsup": "^5.12.7",
|
|
41
|
+
"typescript": "^4.6.4"
|
|
42
|
+
},
|
|
43
|
+
"peerDependencies": {
|
|
44
|
+
"@mui/material": "^5.11.9",
|
|
45
|
+
"react": ">=16.3.0"
|
|
46
|
+
},
|
|
47
|
+
"publishConfig": {
|
|
48
|
+
"access": "public"
|
|
49
|
+
}
|
|
50
|
+
}
|
package/project.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "mui-badge",
|
|
3
|
+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
|
4
|
+
"sourceRoot": "packages/badge/src",
|
|
5
|
+
"projectType": "library",
|
|
6
|
+
"tags": [],
|
|
7
|
+
"targets": {
|
|
8
|
+
"lint": {
|
|
9
|
+
"executor": "@nrwl/linter:eslint",
|
|
10
|
+
"options": {
|
|
11
|
+
"eslintConfig": ".eslintrc.json",
|
|
12
|
+
"lintFilePatterns": ["packages/badge/**/*.{js,ts}"],
|
|
13
|
+
"silent": false,
|
|
14
|
+
"fix": false,
|
|
15
|
+
"cache": true,
|
|
16
|
+
"cacheLocation": "./node_modules/.cache/badge/.eslintcache",
|
|
17
|
+
"maxWarnings": -1,
|
|
18
|
+
"quiet": false,
|
|
19
|
+
"noEslintrc": false,
|
|
20
|
+
"hasTypeAwareRules": true,
|
|
21
|
+
"cacheStrategy": "metadata"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"test": {
|
|
25
|
+
"executor": "@nrwl/jest:jest",
|
|
26
|
+
"outputs": ["coverage/badge"],
|
|
27
|
+
"options": {
|
|
28
|
+
"jestConfig": "packages/badge/jest.config.js",
|
|
29
|
+
"passWithNoTests": true
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"version": {
|
|
33
|
+
"executor": "@jscutlery/semver:version",
|
|
34
|
+
"options": {
|
|
35
|
+
"preset": "conventional",
|
|
36
|
+
"commitMessageFormat": "chore(${projectName}): release version ${version} [skip ci]",
|
|
37
|
+
"tagPrefix": "@availity/${projectName}@"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './lib/Badge';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Badge as MUIBadge } from '@mui/material';
|
|
3
|
+
import type { BadgeProps as MUIBadgeProps } from '@mui/material';
|
|
4
|
+
// import Icon from '@availity/mui-icon';
|
|
5
|
+
|
|
6
|
+
export type BadgeProps = {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
} & MUIBadgeProps;
|
|
9
|
+
|
|
10
|
+
export const Badge = ({ children, ...rest }: BadgeProps): JSX.Element => (
|
|
11
|
+
<MUIBadge {...rest}>
|
|
12
|
+
{children}
|
|
13
|
+
</MUIBadge>
|
|
14
|
+
);
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "./tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"outDir": "../../dist/out-tsc",
|
|
5
|
+
"module": "commonjs",
|
|
6
|
+
"types": ["jest", "node", "@testing-library/jest-dom"],
|
|
7
|
+
"allowJs": true
|
|
8
|
+
},
|
|
9
|
+
"include": ["**/*.test.js", "**/*.test.ts", "**/*.test.tsx", "**/*.d.ts"]
|
|
10
|
+
}
|