`s + return ( + + setCollapsed(!collapsed)} + className="flex-shrink-0 cursor-pointer flex p-4" + > + {collapsed ? ui.downIcon : ui.upIcon} + + {title} + + + + {children} + + + ); +} diff --git a/nx-dev/ui-markdoc/src/lib/tags/disclosure.schema.ts b/nx-dev/ui-markdoc/src/lib/tags/disclosure.schema.ts new file mode 100644 index 0000000000..87dc15c1be --- /dev/null +++ b/nx-dev/ui-markdoc/src/lib/tags/disclosure.schema.ts @@ -0,0 +1,14 @@ +import { Schema } from '@markdoc/markdoc'; + +export const disclosure: Schema = { + render: 'Disclosure', + description: 'Display the enclosed content in a collapsible box', + children: ['paragraph', 'tag', 'list'], + attributes: { + title: { + type: 'String', + required: true, + description: 'The title displayed at the top of the collapsible box', + }, + }, +};