@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 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
+ [![Version](https://img.shields.io/npm/v/@availity/mui-badge.svg?style=for-the-badge)](https://www.npmjs.com/package/@availity/mui-badge)
6
+ [![NPM Downloads](https://img.shields.io/npm/dt/@availity/mui-badge.svg?style=for-the-badge)](https://www.npmjs.com/package/@availity/mui-badge)
7
+ [![Dependency Status](https://img.shields.io/librariesio/release/npm/@availity/mui-badge?style=for-the-badge)](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
+ ```
@@ -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
@@ -0,0 +1,10 @@
1
+ // src/lib/Badge.tsx
2
+ import { Badge as MUIBadge } from "@mui/material";
3
+ import { jsx } from "react/jsx-runtime";
4
+ var Badge = ({ children, ...rest }) => /* @__PURE__ */ jsx(MUIBadge, {
5
+ ...rest,
6
+ children
7
+ });
8
+ export {
9
+ Badge
10
+ };
@@ -0,0 +1,7 @@
1
+ import { Markdown } from '@storybook/blocks';
2
+ import { Meta, Primary, ArgTypes } from '@storybook/addon-docs';
3
+ import ReadMe from './README.md?raw';
4
+
5
+ <Meta title="Components/Badge/Introduction" />
6
+
7
+ <Markdown>{ReadMe}</Markdown>
package/jest.config.js ADDED
@@ -0,0 +1,7 @@
1
+ const global = require('../../jest.config.global');
2
+
3
+ module.exports = {
4
+ ...global,
5
+ displayName: 'badge',
6
+ coverageDirectory: '../../coverage/badge',
7
+ };
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,5 @@
1
+ {
2
+ "extends": "../../tsconfig.json",
3
+ "include": ["."],
4
+ "exclude": ["dist", "build", "node_modules", "*.mdx", "src/lib/*.stories.tsx"]
5
+ }
@@ -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
+ }