Skip to content

Commit

Permalink
Fix crash on Select documentation (#559)
Browse files Browse the repository at this point in the history
  • Loading branch information
victortrinh2 authored Dec 20, 2024
2 parents b002222 + 5518504 commit 4b0c5f0
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions packages/components/src/Select/docs/customValue.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const renderValue = ({ defaultChildren, selectedItem }: ValueRenderProps<User>)
return (
<>
<Avatar name={name} src={avatar} />
<Text>{name}</Text>
<Text slot="label">{name}</Text>
</>
);
}
Expand All @@ -31,7 +31,7 @@ export default function Example() {
return (
<SelectItem id={id} textValue={name}>
<Avatar name={name} src={avatar} />
<Text>{name}</Text>
<Text slot="label">{name}</Text>
<Text slot="description">{role}</Text>
</SelectItem>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ export default function Example() {
isAutoMenuWidth
>
<SelectItem textValue="Designer">
<Text>Designer</Text>
<Text slot="label">Designer</Text>
<Text slot="description">Builds and maintains software.</Text>
</SelectItem>
<SelectItem textValue="Developer">
<Text>Developer</Text>
<Text slot="label">Developer</Text>
<Text slot="description">Creates visual design solutions.</Text>
</SelectItem>
<SelectItem textValue="Manager">
<Text>Manager</Text>
<Text slot="label">Manager</Text>
<Text slot="description">Leads teams and projects.</Text>
</SelectItem>
</Select>
Expand Down
6 changes: 3 additions & 3 deletions packages/components/src/Select/docs/selectDropdown/avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ export default function Example() {
<Select aria-label="Team">
<SelectItem textValue="Fred Smith">
<Avatar src="https://i.pravatar.cc/96?img=3" name="Fred Smith" />
<Text>Fred Smith</Text>
<Text slot="label">Fred Smith</Text>
</SelectItem>
<SelectItem textValue="Karen Smith">
<Avatar name="Karen Smith" />
<Text>Karen Smith</Text>
<Text slot="label">Karen Smith</Text>
</SelectItem>
<SelectItem textValue="John Doe">
<Avatar name="John Doe" />
<Text>John Doe</Text>
<Text slot="label">John Doe</Text>
</SelectItem>
</Select>
);
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/Select/docs/selectDropdown/count.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ export default function Example() {
return (
<Select aria-label="list of options">
<SelectItem textValue="Designer">
<Text>Designer</Text>
<Text slot="label">Designer</Text>
<Badge>50</Badge>
</SelectItem>
<SelectItem textValue="Developer">
<Badge variant="secondary">99+</Badge>
<Text>Developer</Text>
<Text slot="label">Developer</Text>
</SelectItem>
<SelectItem>Manager</SelectItem>
</Select>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ export default function Example() {
return (
<Select aria-label="list of options with a description">
<SelectItem textValue="Developer">
<Text>Developer</Text>
<Text slot="label">Developer</Text>
<Text slot="description">Builds and maintains software.</Text>
</SelectItem>
<SelectItem textValue="Designer">
<Text>Designer</Text>
<Text slot="label">Designer</Text>
<Text slot="description">Creates visual design solutions.</Text>
</SelectItem>
<SelectItem textValue="Manager">
<Text>Manager</Text>
<Text slot="label">Manager</Text>
<Text slot="description">Leads teams and projects.</Text>
</SelectItem>
</Select>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ export default function Example() {
return (
<Select aria-label="list of options">
<SelectItem textValue="Designer">
<Text>Designer</Text>
<Text slot="label">Designer</Text>
<IconList slot="end-icon">
<SparklesIcon /><SparklesIcon /><SparklesIcon />
</IconList>
</SelectItem>
<SelectItem textValue="Developer">
<SparklesIcon slot="end-icon" />
<Text>Developer</Text>
<Text slot="label">Developer</Text>
</SelectItem>
<SelectItem>Manager</SelectItem>
</Select>
Expand Down
6 changes: 3 additions & 3 deletions packages/components/src/Select/docs/selectDropdown/footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ export default function Example() {
footer={<Button variant="ghost-secondary" isFluid><AddIcon /><Text>Add</Text></Button>}
>
<SelectItem textValue="Designer">
<Text>Designer</Text>
<Text slot="label">Designer</Text>
<Text slot="description">Builds and maintains software.</Text>
</SelectItem>
<SelectItem textValue="Developer">
<Text>Developer</Text>
<Text slot="label">Developer</Text>
<Text slot="description">Creates visual design solutions.</Text>
</SelectItem>
<SelectItem textValue="Manager">
<Text>Manager</Text>
<Text slot="label">Manager</Text>
<Text slot="description">Leads teams and projects.</Text>
</SelectItem>
</Select>
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/Select/docs/selectDropdown/icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ export default function Example() {
return (
<Select aria-label="list of options">
<SelectItem textValue="Designer">
<Text>Designer</Text>
<Text slot="label">Designer</Text>
<IconList>
<SparklesIcon /><SparklesIcon /><SparklesIcon />
</IconList>
</SelectItem>
<SelectItem textValue="Developer">
<SparklesIcon />
<Text>Developer</Text>
<Text slot="label">Developer</Text>
</SelectItem>
<SelectItem>Manager</SelectItem>
</Select>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ export default function Example() {
selectionIndicator="input"
>
<SelectItem textValue="Developer" id="1">
<Text>Developer</Text>
<Text slot="label">Developer</Text>
<Text slot="description">Builds and maintains software.</Text>
</SelectItem>
<SelectItem textValue="Designer" id="2">
<Text>Designer</Text>
<Text slot="label">Designer</Text>
<Text slot="description">Creates visual design solutions.</Text>
</SelectItem>
<SelectItem textValue="Manager" id="3">
<Text>Manager</Text>
<Text slot="label">Manager</Text>
<Text slot="description">Leads teams and projects.</Text>
</SelectItem>
</Select>
Expand Down

0 comments on commit 4b0c5f0

Please sign in to comment.