Skip to content

Commit

Permalink
feat: new docs and refactor + divider component rework
Browse files Browse the repository at this point in the history
  • Loading branch information
mrksbnc committed Jan 11, 2025
1 parent 58c32e3 commit 2abcf37
Show file tree
Hide file tree
Showing 15 changed files with 150 additions and 546 deletions.
1 change: 1 addition & 0 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' },
];
}

Expand Down
85 changes: 85 additions & 0 deletions docs/components/divider/divider.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<script setup>
import { BoDivider, BoDividerVariant } from '@/components/bo_divider';
</script>

# bo-divider

A divider is a thin line that groups content in a list or separates sections.

<bo-divider />

## Basic usage

The component to use is called `bo-divider`.

```vue
<bo-divider />
```

## 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`

<div class="flex flex-col gap-2">
<bo-divider :variant="BoDividerVariant.default" />
<bo-divider :variant="BoDividerVariant.dotted" />
<bo-divider :variant="BoDividerVariant.dashed" />
</div>

```vue
<bo-divider variant="default" />
```

## 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.

<div class="flex flex-col gap-2">
<bo-divider :color-hex="'#41b883'" />
<bo-divider :color-hex="'#ff0000'" />
<bo-divider :color-hex="'#000000'" />
</div>

```vue
<bo-divider :color-hex="'#41b883'" />
<bo-divider :color-hex="'#ff0000'" />
<bo-divider :color-hex="'#000000'" />
```

### 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).

<div class="flex flex-col gap-2">
<bo-divider :tailwind-color="'border-blue-600'" />
<bo-divider :tailwind-color="'border-red-600'" />
<bo-divider :tailwind-color="'border-black'" />
</div>

```vue
<bo-divider :tailwind-color="'border-blue-600'" />
<bo-divider :tailwind-color="'border-red-600'" />
<bo-divider :tailwind-color="'border-black'" />
```
4 changes: 2 additions & 2 deletions src/components/bo_card/BoCard.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div
:style="slotCardWidth.style"
:class="[cardContainerClasses, 'bo-card rounded-lg border border-gray-300 bg-white shadow']"
:class="[cardContainerClasses, 'bo-card rounded-lg border border-gray-300 bg-white shadow-lg']"
>
<div v-if="$slots['content'] != null" :class="contentClasses">
<slot name="content"></slot>
Expand Down Expand Up @@ -33,7 +33,7 @@ import { BoFontFamily, BoFontSize, BoFontWeight, BoText, BoTextColor } from '@/c
import type { StyleConstruct } from '@/types';
import { TailwindUtils } from '@/utils';
import { computed, toRefs } from 'vue';
import type { BoCardProps } from './types';
import type { BoCardProps } from './bo_card';
const props = withDefaults(defineProps<BoCardProps>(), {
padding: () => ({
Expand Down
90 changes: 0 additions & 90 deletions src/components/bo_card/__stories__/bo_card.mdx

This file was deleted.

Loading

0 comments on commit 2abcf37

Please sign in to comment.