From de7894c64e8a318e11667e3fda87e81406aa2b65 Mon Sep 17 00:00:00 2001 From: alexcss Date: Thu, 24 Oct 2024 15:31:20 +0300 Subject: [PATCH 1/7] Shields component init --- package.json | 1 + src/components/ShieldsBadge/index.js | 20 ++++++++++++ src/pages/components.md | 8 ++--- src/theme/MDXComponents.js | 3 +- yarn.lock | 48 +++++++++++++++++++++++++++- 5 files changed, 74 insertions(+), 6 deletions(-) create mode 100644 src/components/ShieldsBadge/index.js diff --git a/package.json b/package.json index 46716788..e71a3d4b 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "@mdx-js/react": "^3.0.0", "@mendable/search": "^0.0.206", "@splidejs/react-splide": "^0.7.12", + "badge-maker": "^4.1.0", "bootstrap": "5.3.3", "clsx": "^2.0.0", "docusaurus-plugin-sass": "^0.2.5", diff --git a/src/components/ShieldsBadge/index.js b/src/components/ShieldsBadge/index.js new file mode 100644 index 00000000..3f057b4c --- /dev/null +++ b/src/components/ShieldsBadge/index.js @@ -0,0 +1,20 @@ +import React from "react"; +import Link from '/src/components/Link'; +import clsx from "clsx"; +import { makeBadge, ValidationError } from 'badge-maker' + +export default function ShieldsBadge ({variant, href, className, size, target, title, icon, stretched, children, ...props}) { + + const format = { + label: 'build', + message: 'passed', + color: 'brightgreen', + } + + const svg = makeBadge(format) + console.log(svg) // + {svg} + +} diff --git a/src/pages/components.md b/src/pages/components.md index 98df11ba..b4db3b9b 100644 --- a/src/pages/components.md +++ b/src/pages/components.md @@ -4,7 +4,7 @@ title: Components # Components -## Heading +## Heading Use this to organize your content and create a hierarchy for scannability. Use `Heading one` for the main title, `Heading two` for subheadings, and so on. - **Code** @@ -27,7 +27,7 @@ Use this to organize your content and create a hierarchy for scannability. Use ` ###### Heading level 6 ## Lists -Use this to present items in a specific sequence (ordered list) or without order (unordered list). +Use this to present items in a specific sequence (ordered list) or without order (unordered list). #### Unordered list @@ -156,7 +156,7 @@ Use this to demonstrate functionalities, complex explanations, or walkthroughs.