From 22f6571e29eb20797a498b989de0fa457e5dd193 Mon Sep 17 00:00:00 2001 From: Arno V Date: Tue, 17 Dec 2024 18:41:55 -0500 Subject: [PATCH] docs: adding Bubble to API docs --- packages/api/.storybook/preview.jsx | 1 + packages/api/src/stories/Bubble.mdx | 7 + packages/api/src/stories/Bubble.stories.tsx | 165 ++++++++++++++++++++ 3 files changed, 173 insertions(+) create mode 100644 packages/api/src/stories/Bubble.mdx create mode 100644 packages/api/src/stories/Bubble.stories.tsx diff --git a/packages/api/.storybook/preview.jsx b/packages/api/.storybook/preview.jsx index 04ce7fd0..b776c7a4 100644 --- a/packages/api/.storybook/preview.jsx +++ b/packages/api/.storybook/preview.jsx @@ -25,6 +25,7 @@ const preview = { "Release Tags", ], "Components", + ["Bubble", "Button", "ButtonIcon", "buttonLink"], ], }, }, diff --git a/packages/api/src/stories/Bubble.mdx b/packages/api/src/stories/Bubble.mdx new file mode 100644 index 00000000..455f1445 --- /dev/null +++ b/packages/api/src/stories/Bubble.mdx @@ -0,0 +1,7 @@ +import { Meta } from "@storybook/blocks"; + +import AutoDoc from "../helpers/AutoDoc"; +import * as Stories from "./Bubble.stories"; + + + diff --git a/packages/api/src/stories/Bubble.stories.tsx b/packages/api/src/stories/Bubble.stories.tsx new file mode 100644 index 00000000..f8fd2316 --- /dev/null +++ b/packages/api/src/stories/Bubble.stories.tsx @@ -0,0 +1,165 @@ +import type { Meta, StoryObj } from "@storybook/react"; +import { Bubble } from "@versini/ui-bubble/src/components"; +import "@versini/ui-pill/dist/style.css"; +import "@versini/ui-bubble/dist/style.css"; + +type Story = StoryObj; + +const meta: Meta = { + parameters: { + layout: "centered", + docs: { + controls: { exclude: ["spacing"] }, + }, + }, + title: "Components/Bubble", + + component: Bubble, + args: {}, +}; + +export default meta; + +export const Basic: Story = { + render: (args) => ( +
+ + Right bubble... + + + + Left bubble... + +
+ ), +}; + +const string = "DOM element with string"; +export const Copy: Story = { + render: (args) => ( +
+ + Right bubble... + + + + Pure string with boolean + + + +
DOM element with boolean
+
+ + { + navigator.clipboard.writeText("DOM element with function"); + }} + {...args} + > +
DOM element with function
+
+ + +
{string}
+
+
+ ), +}; + +export const LongText: Story = { + render: (args) => ( +
+ + I have Vodka, St Germain and Grapefruit Juice. Can you suggest a few + cocktails I can make with these ingredients? + + + +

+ Certainly! With the ingredients you have, here are a few cocktail + suggestions: +

+
    +
  1. +

    + Elderflower Greyhound: +

    +
      +
    • Ingredients: Vodka, St Germain, Grapefruit Juice
    • +
    • + Recipe: Mix 2 parts vodka, 1 part St Germain, and 3 parts + grapefruit juice in a shaker with ice. Shake well and strain + into a glass filled with ice. Garnish with a grapefruit slice or + twist. +
    • +
    +
  2. +
  3. +

    + Elderflower Spritz: +

    +
      +
    • + Ingredients: Vodka, St Germain, Grapefruit Juice, Club Soda +
    • +
    • + Recipe: Fill a glass with ice, then add 1 part vodka, 1 part St + Germain, and 1 part grapefruit juice. Stir gently, then top with + club soda. Garnish with a grapefruit slice or mint sprig. +
    • +
    +
  4. +
  5. +

    + Elderflower Martini: +

    +
      +
    • Ingredients: Vodka, St Germain
    • +
    • + Recipe: In a mixing glass filled with ice, combine 2 parts vodka + and 1 part St Germain. Stir well until chilled, then strain into + a chilled martini glass. Optionally, garnish with a lemon twist + or edible flower. +
    • +
    +
  6. +
+

+ Remember to adjust the ratios according to your taste preferences and + enjoy your homemade cocktails responsibly! Cheers! +

+
+
+ ), +}; + +export const WithFooter: Story = { + render: (args) => ( +
+ + What is your name and what can you do for me? + + + + Hi, my name is UI, ask me anything! + +
+ ), +};