Skip to content

Commit

Permalink
Merge branch 'master' into links
Browse files Browse the repository at this point in the history
  • Loading branch information
DhairyaMajmudar authored Sep 3, 2024
2 parents a087940 + dd0a977 commit c2a4879
Show file tree
Hide file tree
Showing 49 changed files with 1,247 additions and 789 deletions.
42 changes: 42 additions & 0 deletions .storybook/AsyncAPIStorybookTheme.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { create } from '@storybook/theming/create';

export default create({
// Brand Information
brandTitle: 'AsyncAPI Initiative',
brandUrl: 'https://www.asyncapi.com/',
brandImage: 'img/logos/asyncapi-horizontal-white-logo.svg',
brandTarget: '_blank',

// Typography
fontBase: '"Work Sans", sans-serif',
fontCode: 'monospace',


// Themes
base: 'dark',

/* -- FULL THEME IS NOT BEING USED DUE TO LACK OF STORYBOOK SUPPORT FOR CUSTOMIZING THE SETTINGS & ACTIONS BAR BG/TEXTCOLOR INDEPENDENTLY. --
colorPrimary: '#47BCEE',
colorSecondary: '#8851FB',
// UI
appBg: '#1b1130',
appContentBg: '#ffffff',
appPreviewBg: '#ffffff',
appBorderColor: '#dfe6ea',
appBorderRadius: 4,
// Text colors
textColor: '#ffffff',
textInverseColor: '#ffffff',
textMutedColor: '#5c6870',
inputTextColor: '#2e3438',
// Toolbar
barTextColor: '#9E9E9E',
// Toolbar default and active colors
booleanBg: '#dfe6ea',
booleanSelectedBg: '#8851FB'
*/
});
6 changes: 6 additions & 0 deletions .storybook/manager.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { addons } from '@storybook/manager-api';
import AsyncAPIStorybookTheme from './AsyncAPIStorybookTheme';

addons.setConfig({
theme: AsyncAPIStorybookTheme,
});
2 changes: 2 additions & 0 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from "react";
import "../styles/globals.css";
import type { Preview } from "@storybook/react";
import { themes } from '@storybook/theming';
import {
Title,
Subtitle,
Expand All @@ -20,6 +21,7 @@ const preview: Preview = {
},
},
docs: {
theme: themes.light,
toc: {
title: 'Table of contents',
},
Expand Down
93 changes: 63 additions & 30 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
# Contributing to AsyncAPI
We love your input! We want to make contributing to this project as easy and transparent as possible.
# Welcome to AsyncAPI

## Contribution recogniton
Welcome to our open-source project! We're excited to have you join our community and contribute to making our project better. Please follow this guide to ensure a smooth contribution process and maintain the quality of our codebase and documentation.

We use [All Contributors](https://allcontributors.org/docs/en/specification) specification to handle recognitions. For more details read [this](https://github.com/asyncapi/community/blob/master/recognize-contributors.md) document.
We encourage all contributors to familiarize themselves with these guidelines and actively participate in the project's growth. If you have any questions or need assistance, don't hesitate to contact the project maintainers or community members.

## Summary of the contribution flow
## Code of Conduct

AsyncAPI has adopted a Code of Conduct (CoC) that we expect project participants to adhere to. Please [read the full CoC text](./CODE_OF_CONDUCT.md) to understand the expected behavior.

## Our Development Process

We use Github to host code, track issues, feature requests, and accept pull requests.

## Contribution flow

The following is a summary of the ideal contribution flow. Please, note that Pull Requests can also be rejected by the maintainers when appropriate.
The following is a summary of the ideal contribution flow.

```
┌───────────────────────┐
Expand Down Expand Up @@ -36,44 +43,70 @@ The following is a summary of the ideal contribution flow. Please, note that Pul
└───────────────────────┘
```

## Code of Conduct
AsyncAPI has adopted a Code of Conduct that we expect project participants to adhere to. Please [read the full text](./CODE_OF_CONDUCT.md) so that you can understand what sort of behaviour is expected.
Issues and pull requests without activity from the creator within 14 days will be automatically closed by a triager or committer. However, closure does not mean rejection. If you wish to revisit a closed issue or pull a request, open a new one referencing the closed item.

## Our Development Process
We use Github to host code, to track issues and feature requests, as well as accept pull requests.
Issues and pull requests without activity from the triager or committer within 14 days may occur for many reasons. The creator may use the `/ptal` comment in the pull request to call out maintainers.

## Issues
[Open an issue](https://github.com/asyncapi/asyncapi/issues/new) **only** if you want to report a bug or a feature. Don't open issues for questions or support, instead join our [Slack workspace](https://www.asyncapi.com/slack-invite) and ask there. Don't forget to follow our [Slack Etiquette](https://github.com/asyncapi/community/blob/master/slack-etiquette.md) while interacting with community members! It's more likely you'll get help, and much faster!
### Issues

## Bug Reports and Feature Requests
[Open an issue](https://github.com/asyncapi/asyncapi/issues/new) **only** if you want to report a bug or a feature. Don't open issues for questions or support; join our [AsyncAPI Slack workspace](https://www.asyncapi.com/slack-invite) and post your queries on the relevant channels. Don't forget to follow our [Slack Etiquette](https://github.com/asyncapi/community/blob/master/slack-etiquette.md) while interacting with community members! It's more likely you'll get help, and much faster!

Please use our issues templates that provide you with hints on what information we need from you to help you out.
### Bug Reports and Feature Requests

## Pull Requests
Please use our issues templates, which provide hints on what information we need from you to help you out.

**Please, make sure you open an issue before starting with a Pull Request, unless it's a typo or a really obvious error.** Pull requests are the best way to propose changes to the specification. Get familiar with our document that explains [Git workflow](https://github.com/asyncapi/community/blob/master/git-workflow.md) used in our repositories.
### Pull Requests

## Conventional commits
**Please open an issue before starting a Pull Request unless it's a typo or a really obvious error.** Pull requests are the best way to propose changes to the specification. It may be rejected if no issue was created first to discuss the need for a pull request.

Our repositories follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/#summary) specification. Releasing to GitHub and NPM is done with the support of [semantic-release](https://semantic-release.gitbook.io/semantic-release/).
Get familiar with our document that explains the [Git workflow](https://github.com/asyncapi/community/blob/master/git-workflow.md) used in our repositories.

Pull requests should have a title that follows the specification, otherwise, merging is blocked. If you are not familiar with the specification simply ask maintainers to modify. You can also use this cheatsheet if you want:
## Conventional commits

Our repositories follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/#summary) specification.

- `fix: ` prefix in the title indicates that PR is a bug fix and PATCH release must be triggered.
- `feat: ` prefix in the title indicates that PR is a feature and MINOR release must be triggered.
- `docs: ` prefix in the title indicates that PR is only related to the documentation and there is no need to trigger release.
- `chore: ` prefix in the title indicates that PR is only related to cleanup in the project and there is no need to trigger release.
- `test: ` prefix in the title indicates that PR is only related to tests and there is no need to trigger release.
- `refactor: ` prefix in the title indicates that PR is only related to refactoring and there is no need to trigger release.
Pull requests should have a title that follows the specification; otherwise, merging is blocked. If you are unfamiliar with the specification, ask maintainers to modify it. You can also use this cheatsheet if you want:

What about MAJOR release? just add `!` to the prefix, like `fix!: ` or `refactor!: `
- `fix: ` prefix in the title indicates that the PR is a bug fix.
- `feat: ` prefix in the title indicates that the PR is a feature.
- `docs: ` prefix in the title indicates that the PR only relates to the documentation.
- `chore: ` prefix in the title indicates that the PR is only related to cleanup in the project.
- `test: ` prefix in the title indicates that the PR is only related to tests.
- `refactor: ` prefix in the title indicates that the PR is only related to refactoring.

Prefix that follows specification is not enough though. Remember that the title must be clear and descriptive with usage of [imperative mood](https://chris.beams.io/posts/git-commit/#imperative).
A prefix that follows specification is not enough. Remember that the title must be clear and descriptive, using the [imperative mood](https://chris.beams.io/posts/git-commit/#imperative).

Happy contributing :heart:
Happy contributing! :heart:

## License

When you submit changes, your submissions are understood to be under the same [Apache 2.0 License](https://github.com/asyncapi/asyncapi/blob/master/LICENSE) that covers the project. Feel free to [contact the maintainers](https://www.asyncapi.com/slack-invite) if that's a concern.

## References
This document was adapted from the open-source contribution guidelines for [Facebook's Draft](https://github.com/facebook/draft-js/blob/master/CONTRIBUTING.md).
## Contribution recognition

We use the [All Contributors](https://allcontributors.org/docs/en/specification) specification to handle recognitions. Read the [`recognize contributors` document](https://github.com/asyncapi/community/blob/master/recognize-contributors.md).

## Maintainers setup

To streamline project management and facilitate onboarding, the maintainer's setup includes two roles: `triager` and `committer`.

There are also two separate areas of responsibility: docs and code. A committer can be responsible for code only, and a triager can be responsible for docs only. A maintainer can hold all roles and participate in different areas.

We recognize that because of the project's size and complexity, areas of responsibility can also become more granular. For example, a committer can be responsible for docs, but only community docs or a committer can be responsible only for project design. Project maintainers assess and approve these exceptions.

### Triager

Triagers are responsible for labeling, commenting, and managing issues and pull requests.

- Triagers assess newly-opened issues and pull requests.
Responsibilities include labeling issues and pull requests, commenting, closing, and reopening items as needed, as well as assisting users and novice contributors.
- Triagers are crucial in enforcing the contributor guide and maintaining a clean backlog.
If a triager plans to become a committer, they should consult existing committers to gradually gain more rights. It's crucial to earn the trust of existing committers so they feel confident in your ability to merge PRs. A triager should consistently demonstrate dedication by regularly fulfilling their duties and actively reviewing PRs, providing code/docs suggestions and recommendations. This shows the committers that the triager is knowledgeable about the docs/codebase and committed to maintaining its quality.

### Committer

Committers are responsible for technical oversight, pull request approval, and onboarding of new maintainers.

- Committers approve pull requests and oversee the technical direction of the project.
- They are responsible for reviewing and approving pull requests for merging.
- Committers also play a role in onboarding new maintainers and triagers.
2 changes: 1 addition & 1 deletion components/ClickableLogo.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Link from 'next/link';

import AsyncAPILogo from './AsyncAPILogo';
import AsyncAPILogo from './logos/AsyncAPILogo';

interface IClickableLogoProps {
href?: string;
Expand Down
115 changes: 115 additions & 0 deletions components/Loader.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
import type { Meta, StoryObj } from '@storybook/react';

import AsyncAPIColorIcon from '@/components/icons/AsyncAPIColorIcon';
import IconCircularLoader from '@/components/icons/CircularLoader';

import Loader from './Loader';

const meta: Meta<typeof Loader> = {
title: 'Components/Loader',
component: Loader
};

export default meta;

type Story = StoryObj<typeof Loader>;

const DarkBackgroundDecorator = (Story: any) => (
<div style={{ backgroundColor: '#1b1130', padding: '12px' }}>
<Story />
</div>
);

export const TextLoader: Story = {
args: {
loaderText: 'Loading...'
}
};

export const TextLoaderInDark: Story = {
decorators: [DarkBackgroundDecorator],
args: {
loaderText: 'Loading...',
dark: true
}
};

export const PulsatingTextLoader: Story = {
args: {
loaderText: 'Loading...',
pulsating: true
}
};

export const PulsatingTextLoaderInDark: Story = {
decorators: [DarkBackgroundDecorator],
args: {
loaderText: 'Loading...',
dark: true,
pulsating: true
}
};

export const CircularAnimationLoader: Story = {
args: {
loaderIcon: <IconCircularLoader />
}
};

export const CircularAnimationLoaderInDark: Story = {
decorators: [DarkBackgroundDecorator],
args: {
loaderIcon: <IconCircularLoader dark={true} />,
dark: true
}
};

export const PulsatingIconLoader: Story = {
args: {
loaderIcon: <AsyncAPIColorIcon alt='Loading...' />,
pulsating: true
}
};

export const PulsatingIconLoaderInDark: Story = {
decorators: [DarkBackgroundDecorator],
args: {
loaderIcon: <AsyncAPIColorIcon alt='Loading...' />,
dark: true,
pulsating: true
}
};

export const CircularAnimationTextLoader: Story = {
args: {
loaderIcon: <IconCircularLoader />,
loaderText: 'Loading...'
}
};

export const CircularAnimationTextLoaderInDark: Story = {
decorators: [DarkBackgroundDecorator],
args: {
loaderIcon: <IconCircularLoader dark={true} />,
loaderText: 'Loading...',
dark: true
}
};

export const PulsatingIconTextLoader: Story = {
args: {
loaderIcon: <AsyncAPIColorIcon alt='Loading...' />,
loaderText: 'Loading...',
pulsating: true
}
};

export const PulsatingIconTextLoaderInDark: Story = {
decorators: [DarkBackgroundDecorator],
args: {
loaderIcon: <AsyncAPIColorIcon alt='Loading...' />,
loaderText: 'Loading...',
dark: true,
pulsating: true
}
};
35 changes: 25 additions & 10 deletions components/Loader.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,39 @@
import React from 'react';
import { twMerge } from 'tailwind-merge';

interface LoaderProps {
// eslint-disable-next-line prettier/prettier

/** The text to be displayed along with the loading animation. */
loaderText?: string;

/** The icon to be displayed along with the loading animation. */
loaderIcon?: React.ReactElement | null;

/** Additional classes for the loader. */
className?: string;

/** Whether the loader should be in dark mode. */
dark?: boolean;

/** Whether the loader should be pulsating. */
pulsating?: boolean;
}

/**
* This component displays a loader.
* @param {LoaderProps} props - The props for the Loader component
* @param {string} props.className - Additional classes for the loader
* @param {boolean} props.dark - Whether the loader should be in dark mode
*/
export default function Loader({ className = '', dark = false }: LoaderProps) {
export default function Loader({
loaderText = '',
loaderIcon = null,
className = '',
dark = false,
pulsating = false
}: LoaderProps) {
return (
<div className={twMerge(`w-fit flex flex-col m-auto ${className}`)}>
<svg
className={`mx-auto animate-spin border-4 border-t-transparent ${dark ? 'border-white' : 'border-black'} size-10 rounded-full`}
viewBox='0 0 24 24'
></svg>
<div className={`my-2 ${dark ? 'text-white' : 'text-black'}`}>Waiting for response...</div>
<div className={twMerge(`w-fit flex gap-4 m-auto items-center ${pulsating ? 'animate-pulse ' : ''} ${className}`)}>
{loaderIcon}
<div className={`my-2 ${dark ? 'text-white' : 'text-black'}`}>{loaderText}</div>
</div>
);
}
3 changes: 2 additions & 1 deletion components/NewsletterSubscribe.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useState } from 'react';

import IconCircularLoader from '@/components/icons/CircularLoader';
import { ButtonType } from '@/types/components/buttons/ButtonPropsType';
import { InputTypes } from '@/types/components/InputBoxPropsType';
import { HeadingLevel, HeadingTypeStyle } from '@/types/typography/Heading';
Expand Down Expand Up @@ -127,7 +128,7 @@ export default function NewsletterSubscribe({
{subtitle}
</Paragraph>
{status === 'loading' ? (
<Loader dark={dark} />
<Loader loaderText={'Waiting for response...'} loaderIcon={<IconCircularLoader dark />} dark={dark} />
) : (
<form className='flex flex-col gap-4 md:flex-row' onSubmit={handleSubmit}>
<InputBox
Expand Down
2 changes: 1 addition & 1 deletion components/footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from 'react';

import { HeadingTypeStyle } from '@/types/typography/Heading';

import AsyncAPILogoLight from '../AsyncAPILogoLight';
import AsyncAPILogoLight from '../logos/AsyncAPILogoLight';
import Heading from '../typography/Heading';
import type { InitiativeLink, SocialMediaLink } from './FooterList';
import { initiativeLinks, socialMediaLinks } from './FooterList';
Expand Down
Loading

0 comments on commit c2a4879

Please sign in to comment.