Skip to content

Commit a08f34a

Browse files
committed
update: Faq styling and story
1 parent c6f924d commit a08f34a

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

src/components/FaqAccordion/Faq.stories.tsx renamed to src/components/Faq/Faq.stories.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const meta = {
77
component: FaqComponent,
88
decorators: [
99
(Story) => (
10-
<div className="">
10+
<div className="mx-auto w-[52rem] max-w-full p-4">
1111
<Story />
1212
</div>
1313
),
@@ -18,7 +18,7 @@ export default meta
1818

1919
export const Faq: StoryObj = {
2020
render: () => (
21-
<FaqComponent type="single" collapsible>
21+
<FaqComponent type="single" collapsible className="w-full">
2222
<FaqItem value="item-1">
2323
<FaqTrigger>
2424
<h2 className="text-start text-base md:text-xl">

src/components/FaqAccordion/index.tsx renamed to src/components/Faq/index.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ const FaqTrigger = React.forwardRef<
1717
<AccordionTrigger
1818
ref={ref}
1919
className={cn(
20-
"w-full px-4 py-3 md:px-8 md:py-6",
20+
"w-full p-4 md:px-8 md:py-6",
2121
"border-t border-body-light",
2222
"text-start font-medium",
23+
"[&_[data-label='icon-container']]:ms-8 [&_[data-label='icon-container']]:rounded-full [&_[data-label='icon-container']]:border [&_[data-label='icon-container']]:border-current [&_[data-label='icon-container']]:p-2 hover:[&_[data-label='icon-container']]:shadow-[4px_4px_0_hsla(var(--primary-low-contrast),1)] [&_svg]:text-lg",
2324
className
2425
)}
2526
{...props}
@@ -40,7 +41,7 @@ const Faq = ({
4041
collapsible
4142
className={cn(
4243
"rounded border border-body-light first:border-t-0",
43-
"max-w-4xl overflow-hidden bg-background",
44+
"w-full overflow-hidden bg-background",
4445
props?.className
4546
)}
4647
{...props}
@@ -56,7 +57,7 @@ const FaqItem = React.forwardRef<
5657
>(({ className, ...props }, ref) => (
5758
<AccordionItem
5859
ref={ref}
59-
className={cn("hover:bg-background-highlight", className)}
60+
className={cn("w-full hover:bg-background-highlight", className)}
6061
{...props}
6162
/>
6263
))

src/components/ui/accordion.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ const AccordionTrigger = React.forwardRef<
3333
<>
3434
{children}
3535
{!hideIcon && (
36-
<ChevronNext className="size-[1em] shrink-0 text-2xl transition-transform duration-200" />
36+
<div data-label="icon-container">
37+
<ChevronNext className="size-[1em] shrink-0 text-2xl transition-transform duration-200" />
38+
</div>
3739
)}
3840
</>
3941
</AccordionPrimitive.Trigger>

0 commit comments

Comments
 (0)