From 2abcf37c95d199b661a55920b8c8904acd84de96 Mon Sep 17 00:00:00 2001 From: Bence Markus Date: Sat, 11 Jan 2025 23:10:19 +0100 Subject: [PATCH] feat: new docs and refactor + divider component rework --- docs/.vitepress/config.ts | 1 + docs/components/divider/divider.md | 85 +++++++ src/components/bo_card/BoCard.vue | 4 +- .../bo_card/__stories__/bo_card.mdx | 90 ------- .../bo_card/__stories__/bo_card.stories.ts | 224 ------------------ .../bo_card/{types.ts => bo_card.ts} | 0 src/components/bo_card/index.ts | 4 +- src/components/bo_divider/BoDivider.vue | 82 ++++--- .../bo_divider/__stories__/bo_divider.mdx | 54 ----- .../__stories__/bo_divider.stories.ts | 111 --------- src/components/bo_divider/bo_divider.ts | 12 + src/components/bo_divider/constants.ts | 14 -- src/components/bo_divider/index.ts | 5 +- src/components/bo_divider/types.ts | 6 - src/components/bo_modal/BoSlotModal.vue | 4 +- 15 files changed, 150 insertions(+), 546 deletions(-) create mode 100644 docs/components/divider/divider.md delete mode 100644 src/components/bo_card/__stories__/bo_card.mdx delete mode 100644 src/components/bo_card/__stories__/bo_card.stories.ts rename src/components/bo_card/{types.ts => bo_card.ts} (100%) delete mode 100644 src/components/bo_divider/__stories__/bo_divider.mdx delete mode 100644 src/components/bo_divider/__stories__/bo_divider.stories.ts create mode 100644 src/components/bo_divider/bo_divider.ts delete mode 100644 src/components/bo_divider/constants.ts delete mode 100644 src/components/bo_divider/types.ts diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index e4b2f02..364e368 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -22,6 +22,7 @@ function getComponents() { { text: 'Badge', link: '/components/badge/badge' }, { text: 'Button', link: '/components/button/button' }, { text: 'Card', link: '/components/card/card' }, + { text: 'Divider', link: '/components/divider/divider' }, ]; } diff --git a/docs/components/divider/divider.md b/docs/components/divider/divider.md new file mode 100644 index 0000000..99adada --- /dev/null +++ b/docs/components/divider/divider.md @@ -0,0 +1,85 @@ + + +# bo-divider + +A divider is a thin line that groups content in a list or separates sections. + + + +## Basic usage + +The component to use is called `bo-divider`. + +```vue + +``` + +## Props + +| Prop name | Type | Default value | +| ---------------- | ------------------ | -------------------------- | +| `id` | `string` | `undefined` | +| `variant` | `BoDividerVariant` | `BoDividerVariant.primary` | +| `color-hex` | `string` | `undefined` | +| `tailwind-color` | `string` | `undefined` | + +## Variants + +To change the style of the divider, you can use the `variant` prop. + +The available values for the `variant` prop are: + +- `default` +- `dotted` +- `dashed` + +
+ + + +
+ +```vue + +``` + +## Colors + +There are two ways to change the color of the divider. + +- By using the `color-hex` prop +- By using the `tailwind-color` prop + +### Color by hex + +To change the color of the divider, you can use the `color-hex` prop. + +
+ + + +
+ +```vue + + + +``` + +### Color by tailwind + +To change the color of the divider, you can also use the `tailwind-color` prop. This accepts any valid border color from the [Tailwind CSS documentation](https://tailwindcss.com/docs/border-color). + +
+ + + +
+ +```vue + + + +``` diff --git a/src/components/bo_card/BoCard.vue b/src/components/bo_card/BoCard.vue index 2a1be94..8e415a5 100644 --- a/src/components/bo_card/BoCard.vue +++ b/src/components/bo_card/BoCard.vue @@ -1,7 +1,7 @@