Skip to content

Commit

Permalink
refactor: headless accordion without dot syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
maiieul committed Jan 13, 2025
1 parent c788048 commit 3f75d65
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Component } from '@builder.io/qwik';
import { type AccordionRootProps, HAccordionRootImpl } from './accordion-root';
import { Accordion } from '@qwik-ui/headless';
import { HAccordionItem } from '@qwik-ui/headless';
import { findComponent, processChildren } from '../../utils/inline-component';

type InternalProps = {
accordionItemComponent?: typeof Accordion.Item;
accordionItemComponent?: typeof HAccordionItem;
};

export const HAccordionRoot: Component<AccordionRootProps & InternalProps> = (
Expand All @@ -16,7 +16,7 @@ export const HAccordionRoot: Component<AccordionRootProps & InternalProps> = (
value: initialValue,
...rest
} = props;
const Item = GivenItem || Accordion.Item;
const Item = GivenItem || HAccordionItem;
let currItemIndex = 0;
let initialIndex = null;
const itemsMap = new Map();
Expand Down
10 changes: 5 additions & 5 deletions packages/kit-headless/src/components/accordion/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export { HAccordionRoot as Root } from './accordion-inline';
export { HAccordionItem as Item } from './accordion-item';
export { HAccordionTrigger as Trigger } from './accordion-trigger';
export { HAccordionContent as Content } from './accordion-content';
export { HAccordionHeader as Header } from './accordion-heading';
export { HAccordionRoot } from './accordion-inline';
export { HAccordionItem } from './accordion-item';
export { HAccordionTrigger } from './accordion-trigger';
export { HAccordionContent } from './accordion-content';
export { HAccordionHeader } from './accordion-heading';
2 changes: 1 addition & 1 deletion packages/kit-headless/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export * as Checkbox from './components/checkbox';
export * as Checklist from './components/checklist';
export * as Accordion from './components/accordion/';
export * from './components/accordion/';
export * as Carousel from './components/carousel';
export * as Collapsible from './components/collapsible';
export * from './components/label';
Expand Down

0 comments on commit 3f75d65

Please sign in to comment.