Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions packages/admin-ui/src/Accordion/Accordion.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,22 @@ export const WithIcon: Story = {
}
};

export const WithColorMark: Story = {
...Default,
args: {
children: (
<>
<AccordionItem
colorMark={"#ff6584"}
index={1}
description="Lorem ipsum dolor sit amet, consectetur adipiscing elit."
icon={<Accordion.Item.Icon icon={<WarningIcon />} label={"Warning icon"} />}
/>
</>
)
}
};

export const WithActionsIcon: Story = {
...Default,
args: {
Expand Down
1 change: 1 addition & 0 deletions packages/admin-ui/src/Accordion/Accordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const accordionVariants = cva("wby-group wby-w-full", {
type AccordionProps = React.ComponentPropsWithoutRef<typeof AccordionRoot> &
VariantProps<typeof accordionVariants> & {
children: React.ReactNode;
colorMark?: string;
};

const AccordionBase = ({ children, variant, background, className, ...props }: AccordionProps) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { AccordionRoot, type AccordionRootProps } from "~/Accordion/components/A
interface AccordionItemProps extends Omit<AccordionRootProps, "title"> {
title: React.ReactNode;
description?: React.ReactNode;
colorMark?: string;
icon?: React.ReactNode;
handle?: React.ReactNode;
interactive?: boolean;
Expand Down
16 changes: 15 additions & 1 deletion packages/admin-ui/src/Accordion/components/AccordionTrigger.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,21 @@ import { AccordionItemDragHandle } from "~/Accordion/components/AccordionItemDra

type AccordionTriggerProps = Pick<
AccordionItemProps,
"title" | "description" | "icon" | "handle" | "interactive" | "actions" | "draggable"
| "title"
| "description"
| "colorMark"
| "icon"
| "handle"
| "interactive"
| "actions"
| "draggable"
>;

const AccordionTrigger = ({
title,
description,
actions,
colorMark,
icon,
interactive = true,
draggable
Expand Down Expand Up @@ -53,6 +61,12 @@ const AccordionTrigger = ({
)}
>
{draggable ? <AccordionItemDragHandle /> : null}
{colorMark && (
<div
style={{ backgroundColor: colorMark }}
className={"wby-block wby-w-[4px] wby-h-[48px] wby-rounded-sm wby-ml-sm"}
/>
)}
<div
className={
"wby-w-full wby-flex wby-justify-between wby-items-center wby-px-md wby-py-sm-extra"
Expand Down
Loading
Loading