Skip to content

Commit

Permalink
Merge branch 'upstream-master' into form-component
Browse files Browse the repository at this point in the history
  • Loading branch information
KhudaDad414 committed Oct 10, 2023
2 parents 8e0bb5d + dbeb742 commit 4791ae3
Show file tree
Hide file tree
Showing 5 changed files with 380 additions and 551 deletions.
76 changes: 76 additions & 0 deletions apps/design-system/src/components/ChipInput.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import { useState } from "react";
import { ChipInput } from "@asyncapi/studio-ui";

const meta = {
component: ChipInput,
parameters: {
layout: 'fullscreen',
backgrounds: {
default: 'light'
}
},
};

export default meta;

export const Default = () => {
const [currentChips, setCurrentChips] = useState<string[]>([]);

return (
<div className="p-4 bg-gray-100 flex items-center">
<ChipInput
name="chip-input-default"
id="chip-input-id-default"
chips={currentChips}
onChange={setCurrentChips}
/>
</div>
);
};

export const WithTags = () => {
const [currentChips, setCurrentChips] = useState<string[]>(['production', 'platform']);

return (
<div className="p-4 bg-gray-100 flex items-center">
<ChipInput
name="chip-input-chip-text"
id="chip-input-id-chip-text"
chips={currentChips}
onChange={setCurrentChips}
/>
</div>
);
};

export const WithSomeDefaultText = () => {
const [currentChips, setCurrentChips] = useState<string[]>(['production', 'platform']);

return (
<div className="p-4 bg-gray-100 flex items-center">
<ChipInput
name="chip-input-default-text-in-input"
id="chip-input-id-default-text-in-input"
chips={currentChips}
onChange={setCurrentChips}
defaultValue="registr"
/>
</div>
);
};

export const WithCustomPlaceholder = () => {
const [currentChips, setCurrentChips] = useState<string[]>([]);

return (
<div className="p-4 bg-gray-100 flex items-center">
<ChipInput
name="chip-input-custom-placeholder"
id="chip-input-id-placeholder"
chips={currentChips}
onChange={setCurrentChips}
placeholder="Enter a custom chip"
/>
</div>
);
};
4 changes: 2 additions & 2 deletions apps/studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@
"@asyncapi/go-watermill-template": "^0.2.40",
"@asyncapi/html-template": "^0.28.4",
"@asyncapi/java-spring-cloud-stream-template": "^0.13.4",
"@asyncapi/java-spring-template": "^1.2.0",
"@asyncapi/java-spring-template": "^1.3.0",
"@asyncapi/java-template": "^0.2.1",
"@asyncapi/markdown-template": "^1.3.3",
"@asyncapi/markdown-template": "^1.4.0",
"@asyncapi/nodejs-template": "^1.0.0",
"@asyncapi/nodejs-ws-template": "^0.9.33",
"@asyncapi/python-paho-template": "^0.2.13",
Expand Down
Loading

0 comments on commit 4791ae3

Please sign in to comment.