Fix minor Canon Select component documentation issues.

Signed-off-by: Johan Persson <johanopersson@gmail.com>
This commit is contained in:
Johan Persson
2025-04-02 10:38:40 +02:00
parent fc3fd5ac8c
commit c0c0a18ca5
3 changed files with 6 additions and 8 deletions
@@ -3,7 +3,6 @@ import { Snippet } from '@/components/Snippet';
import { Tabs } from '@/components/Tabs';
import { CodeBlock } from '@/components/CodeBlock';
import { SelectSnippet } from '@/snippets/stories-snippets';
import { buttonVariants } from '@/snippets/code-snippets';
import { selectPropDefs } from './props';
# Select
@@ -79,7 +78,7 @@ Select component with label and description.
### Sizes
Here's a view when buttons have different sizes.
Here's a view when the selects have different sizes.
<Snippet
align="center"
@@ -102,7 +101,7 @@ Here's a view when buttons have different sizes.
### Disabled
Here's a view when buttons are disabled.
Here's a view when the select is disabled.
<Snippet
align="center"
@@ -118,7 +117,7 @@ Here's a view when buttons are disabled.
### Responsive
Here's a view when buttons are responsive.
Here's a view when the select is responsive.
<CodeBlock
code={`<Select
@@ -31,10 +31,10 @@ export const Select = React.forwardRef<HTMLSelectElement, SelectProps>(
description,
value,
defaultValue,
placeholder,
onValueChange,
onOpenChange,
options,
placeholder = 'Select an option',
size = 'medium',
disabled = false,
required = false,
@@ -65,9 +65,7 @@ export const Select = React.forwardRef<HTMLSelectElement, SelectProps>(
`canon-SelectTrigger--size-${size}`,
)}
>
<SelectPrimitive.Value
placeholder={placeholder || 'Select an option'}
/>
<SelectPrimitive.Value placeholder={placeholder} />
<SelectPrimitive.Icon className="canon-SelectIcon">
<Icon name="chevron-down" />
</SelectPrimitive.Icon>
@@ -73,6 +73,7 @@ export interface SelectProps {
/**
* A placeholder text to show if nothing has been selected and there's no default value
* @defaultValue 'Select an option'
*/
placeholder?: string;