From 6f78f60fc3563b3dd5442187c03787ab7862ef52 Mon Sep 17 00:00:00 2001 From: Angus Hollands Date: Wed, 24 Apr 2024 13:53:32 +0100 Subject: [PATCH] wip: collapsible button --- .../site/src/components/DocumentOutline.tsx | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/packages/site/src/components/DocumentOutline.tsx b/packages/site/src/components/DocumentOutline.tsx index e82cae73f..56366647e 100644 --- a/packages/site/src/components/DocumentOutline.tsx +++ b/packages/site/src/components/DocumentOutline.tsx @@ -9,6 +9,9 @@ import classNames from 'classnames'; import throttle from 'lodash.throttle'; import React, { useCallback, useEffect, useRef, useState } from 'react'; import { DocumentChartBarIcon } from '@heroicons/react/24/outline'; +import { ChevronRightIcon } from '@heroicons/react/24/solid'; +import * as Collapsible from '@radix-ui/react-collapsible'; + const SELECTOR = [1, 2, 3, 4].map((n) => `main h${n}`).join(', '); const HIGHLIGHT_CLASS = 'highlight'; @@ -247,6 +250,7 @@ export const DocumentOutline = ({ return ; } return ( + + ); };