Skip to content

Commit

Permalink
fix(divider): fix divider props
Browse files Browse the repository at this point in the history
Signed-off-by: Leonid Romanov <[email protected]>
  • Loading branch information
leonid committed Aug 20, 2024
1 parent 772e161 commit 995a17c
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 25 deletions.
2 changes: 1 addition & 1 deletion packages/demos/src/divider/DividerBasic.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
<p>Some content to fill</p>
<AcvDivider />
<p>Some content to fill</p>
<AcvDivider>Insert text</AcvDivider>
<AcvDivider />
<p>Some content to fill</p>
</template>
8 changes: 6 additions & 2 deletions packages/demos/src/divider/DividerVertical.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
<script setup>
import AcvDivider from '@/components/divider/divider.vue';
</script>

<template>
<p>
Some content
<Divider vertical />
<AcvDivider vertical />
Some content
<Divider vertical />
<AcvDivider vertical />
Some content
</p>
</template>
23 changes: 10 additions & 13 deletions packages/documentation/components/divider/divider.doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Used to group content in horizontal or vertical lists,
and also serves as a visual separator between logical blocks within the interface.

:::info Figma mockups
https://www.figma.com/design/6nFlVmwDwvGloglQHxyElh/Tokens-test?node-id=123-8541
https://www.figma.com/design/6nFlVmwDwvGloglQHxyElh/Syntax-UI-3.0?node-id=123-8541&m=dev
:::

## Basic usage
Expand All @@ -13,23 +13,20 @@ https://www.figma.com/design/6nFlVmwDwvGloglQHxyElh/Tokens-test?node-id=123-8541
<<< ../../../demos/src/divider/DividerBasic.vue
:::

## With text

You can place text into default dividers slot and use `text-position` property
to align it in a _center_, _left_ or _right_ position.

<DividerVariants />

## Colors

You can use `color` property to highlight the divider with a specific color.

<DividerColors />
[//]: # '## Colors'
[//]: #
[//]: # 'You can use `color` property to highlight the divider with a specific color.'
[//]: #
[//]: # '<DividerColors />'

## On backgrounds

<DividerBackground />

::: details Source code
<<< ../../../demos/src/divider/DividerBackground.vue
:::

## Accessibility

Separators must be ignored by the screenreader.
Expand Down
12 changes: 6 additions & 6 deletions packages/documentation/components/divider/divider.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ description: This file is generated automatically from the source code. Changes

## Props

| Prop name | Description | Type | Values | Default |
| ------------ | ----------------------------------- | ------------------------- | ------------------------------------------------------------------------- | ------- |
| vertical | Orientation of the Divider | boolean | - | |
| textPosition | Position of the text in the Divider | AcvDividerTextPosition | - | |
| margin | Margin of the Divider | string \| number | - | |
| color | Color of the Divider | ColorBrand \| ColorStatus | 'primary', 'secondary', 'neutral', 'success', 'warning', 'danger', 'info' | 'brand' |
| Prop name | Description | Type | Values | Default |
| ------------ | ------------------------------------- | ------------------------- | ------------------------------------------------------------------------- | ------- |
| vertical | Orientation and height of the Divider | boolean \| number | - | |
| textPosition | Position of the text in the Divider | AcvDividerTextPosition | - | |
| margin | Margin of the Divider | string \| number | - | |
| color | Color of the Divider | ColorBrand \| ColorStatus | 'primary', 'secondary', 'neutral', 'success', 'warning', 'danger', 'info' | 'brand' |

## Slots

Expand Down
6 changes: 3 additions & 3 deletions packages/ui/src/components/divider/divider.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import type { ColorBrand, ColorStatus } from '../../utils/color.ts';
import type { ColorBrand, ColorStatus } from '@/utils/color.ts';

export type AcvDividerTextPosition = 'center' | 'left' | 'right';

export interface AcvDividerProps {
/**
* Orientation of the Divider
* Orientation and height of the Divider
*/
vertical?: boolean
vertical?: boolean | number

/**
* Position of the text in the Divider
Expand Down

0 comments on commit 995a17c

Please sign in to comment.