Skip to content

Commit 4de80ea

Browse files
committed
fix: usability/terminology fix, Accordions -> Accordion
1 parent 9d2b58d commit 4de80ea

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

core/lib/makeswift/components.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import './components/accordions/accordions.makeswift';
1+
import './components/accordion/accordion.makeswift';
22
import './components/button-link/button-link.makeswift';
33
import './components/card-carousel/card-carousel.makeswift';
44
import './components/card/card.makeswift';

core/lib/makeswift/components/accordions/accordions.makeswift.tsx renamed to core/lib/makeswift/components/accordion/accordion.makeswift.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Group, List, Select, Slot, Style, TextInput } from '@makeswift/runtime/
33
import { Accordion, AccordionItem } from '@/vibes/soul/primitives/accordion';
44
import { runtime } from '~/lib/makeswift/runtime';
55

6-
interface MSAccordion {
6+
interface MSAccordionItem {
77
title: string;
88
children: React.ReactNode;
99
}
@@ -12,21 +12,21 @@ interface MSAccordionsProps {
1212
className: string;
1313
type: 'single' | 'multiple';
1414
colorScheme: 'light' | 'dark';
15-
accordions: MSAccordion[];
15+
items: MSAccordionItem[];
1616
}
1717

1818
runtime.registerComponent(
19-
function MSAccordions({ className, accordions, colorScheme, type }: MSAccordionsProps) {
19+
function MSAccordion({ className, items, colorScheme, type }: MSAccordionsProps) {
2020
return (
2121
<Accordion
2222
className={className}
2323
collapsible={type === 'single' ? true : undefined}
2424
type={type}
2525
>
26-
{accordions.length < 1 && (
27-
<div className="p-4 text-center text-lg text-gray-400">Add accordions</div>
26+
{items.length < 1 && (
27+
<div className="p-4 text-center text-lg text-gray-400">Add accordion items</div>
2828
)}
29-
{accordions.map(({ title, children }, index) => (
29+
{items.map(({ title, children }, index) => (
3030
<AccordionItem
3131
colorScheme={colorScheme}
3232
key={index}
@@ -41,21 +41,21 @@ runtime.registerComponent(
4141
},
4242
{
4343
type: 'primitive-accordions',
44-
label: 'Basic / Accordions',
44+
label: 'Basic / Accordion',
4545
icon: 'carousel',
4646
props: {
4747
className: Style(),
48-
accordions: List({
49-
label: 'Accordions',
48+
items: List({
49+
label: 'Items',
5050
type: Group({
5151
label: 'Accordion item',
5252
props: {
53-
title: TextInput({ label: 'Title', defaultValue: 'This is an accordion title' }),
53+
title: TextInput({ label: 'Title', defaultValue: 'This is an item title' }),
5454
children: Slot(),
5555
},
5656
}),
5757
getItemLabel(accordion) {
58-
return accordion?.title || 'Accordion';
58+
return accordion?.title || 'Untitled item';
5959
},
6060
}),
6161
type: Select({

0 commit comments

Comments
 (0)