UNPKG

@cerberus-design/react

Version:

The Cerberus Design React component library.

34 lines (29 loc) 1.49 kB
'use client'; 'use strict'; Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const jsxRuntime = require('react/jsx-runtime'); const index = require('../../utils/index.cjs'); const show = require('../show/show.cjs'); const parts = require('./parts.cjs'); const itemIndicator = require('./item-indicator.cjs'); function Accordion(props) { return /* @__PURE__ */ jsxRuntime.jsx(parts.AccordionParts.Root, { ...props }); } function AccordionItemGroup(props) { const [groupProps, itemProps] = index.splitProps(props, [ "heading", "children", "indicatorPosition" ]); const indicatorPosition = groupProps.indicatorPosition ?? "end"; return /* @__PURE__ */ jsxRuntime.jsxs(parts.AccordionParts.Item, { ...itemProps, children: [ /* @__PURE__ */ jsxRuntime.jsxs(parts.AccordionParts.ItemTrigger, { "data-indicator-position": indicatorPosition, children: [ /* @__PURE__ */ jsxRuntime.jsx(show.Show, { when: indicatorPosition === "start", children: /* @__PURE__ */ jsxRuntime.jsx(itemIndicator.AccordionChevronItemIndicator, {}) }), groupProps.heading, /* @__PURE__ */ jsxRuntime.jsx(show.Show, { when: indicatorPosition === "end", children: /* @__PURE__ */ jsxRuntime.jsx(itemIndicator.AccordionChevronItemIndicator, {}) }) ] }), /* @__PURE__ */ jsxRuntime.jsx(parts.AccordionParts.ItemContent, { children: groupProps.children }) ] }); } exports.Accordion = Accordion; exports.AccordionItemGroup = AccordionItemGroup;