// Copyright (c) Meta Platforms, Inc. and affiliates. 'use client'; import {Fragment} from 'react'; import * as stylex from '@stylexjs/stylex'; import {Divider} from '@astryxdesign/core/Divider'; import {useContainerReveal} from '@astryxdesign/core/hooks'; import {Icon} from '@astryxdesign/core/Icon'; import {IconButton} from '@astryxdesign/core/IconButton'; import {Item} from '@astryxdesign/core/Item'; import {HStack} from '@astryxdesign/core/Layout'; import {mergeProps} from '@astryxdesign/core/utils'; import { DocumentIcon as FileIcon, PlusIcon as AddIcon, XMarkIcon as CloseIcon, } from '@heroicons/react/24/outline'; const TABS = [ {name: 'Project brief', isActive: true}, {name: 'Research notes', isActive: false}, {name: 'Interaction prototype', isActive: false}, ]; const styles = stylex.create({ strip: {minWidth: 0, flexShrink: 1, scrollbarWidth: 'none'}, rule: {height: 16}, hidden: {visibility: 'hidden'}, tab: {flexShrink: 1, width: 164, minWidth: 96}, action: {margin: 'calc(-1 * var(--spacing-1))', transitionProperty: 'none'}, }); function DocumentTab({name, isActive}: (typeof TABS)[number]) { const {getContainerProps, getContentRevealProps} = useContainerReveal(); const revealProps = getContentRevealProps({ forceVisibility: isActive ? 'shown' : undefined, isLayoutPreserved: true, }); return ( {}} aria-current={isActive ? 'true' : undefined} {...getContainerProps()} startContent={ } endContent={ } {...mergeProps(revealProps, stylex.props(styles.action))} /> } xstyle={styles.tab} /> ); } export default function ItemDocumentTabs() { return ( {TABS.map((tab, index) => ( {index > 0 ? ( ) : null} ))} } /> ); }