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
7 changes: 7 additions & 0 deletions .changeset/fix-sidenav-showcase-bounds.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@astryxdesign/cli': patch
---

[fix] The SideNav showcase now includes support and settings destinations in its footer so the Overview preview demonstrates the complete navigation surface.

@bezabyte
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
'use client';

import type {ComponentProps} from 'react';
import {HelpIcon, SettingsIcon} from '@astryxdesign/template-icons';
Comment thread
astracat-bot[bot] marked this conversation as resolved.
Resolved

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional, non-blocking: HomeIcon, FolderIcon, ChartBarIcon and DocumentTextIcon below (lines 14-80) draw the same Heroicons the template icon table names HomeIcon, FolderIcon, ChartIcon and DocumentIcon. Importing them here removes the block's last inline SVG and about 65 lines, and brings the block under 100 lines:

import {
  ChartIcon,
  DocumentIcon,
  FolderIcon,
  HelpIcon,
  HomeIcon,
  SettingsIcon,
} from '@astryxdesign/template-icons';

Analytics and All Documents then take icon={ChartIcon} and icon={DocumentIcon}.

import {
SideNav,
SideNavHeading,
Expand Down Expand Up @@ -80,7 +81,14 @@ function DocumentTextIcon(props: ComponentProps<'svg'>) {

export default function SideNavShowcase() {
return (
<SideNav header={<SideNavHeading heading="My App" headingHref="/" />}>
<SideNav
header={<SideNavHeading heading="My App" headingHref="/" />}
footer={
<SideNavSection title="Support" isHeaderHidden>
<SideNavItem label="Help & docs" icon={HelpIcon} href="/help" />
<SideNavItem label="Settings" icon={SettingsIcon} href="/settings" />
</SideNavSection>
}>
<SideNavSection title="Main">
<SideNavItem
label="Dashboard"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,16 @@ export const doc = {
exampleFor: 'SideNavCollapseButton',
name: 'SideNavCollapseButton',
displayName: 'Side Nav Collapse Button',
description: 'Demonstrates SideNavCollapseButton inside a collapsible SideNav.',
description:
'Demonstrates SideNavCollapseButton inside a collapsible SideNav.',
isReady: true,
isShowcase: true,
aspectRatio: 4 / 3,
componentsUsed: ['SideNav', 'SideNavCollapseButton', 'SideNavItem', 'SideNavSection'],
componentsUsed: [
'SideNav',
'SideNavCollapseButton',
'SideNavItem',
'SideNavSection',
'SideNavHeading',
],
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ export const doc = {
exampleFor: 'SideNavHeading',
name: 'SideNavHeading',
displayName: 'Side Nav Heading',
description: 'Demonstrates SideNavHeading with an app name, logo icon, superheading, and subheading.',
description:
'Demonstrates SideNavHeading with an app name, logo icon, superheading, and subheading.',
isReady: true,
isShowcase: true,
aspectRatio: 4 / 3,
componentsUsed: ['SideNav', 'SideNavHeading'],
componentsUsed: ['SideNav', 'SideNavHeading', 'HStack'],
};
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

'use client';

import {SideNav, SideNavHeading} from '@astryxdesign/core/SideNav';
import {HStack} from '@astryxdesign/core/Layout';
import {SideNav, SideNavHeading} from '@astryxdesign/core/SideNav';

function AppIcon() {
return (
Expand All @@ -23,6 +23,7 @@ function AppIcon() {
);
}

// Compare a simple heading against one with a superheading and subheading.
export default function SideNavHeadingShowcase() {
return (
<HStack gap={6}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ export const doc = {
exampleFor: 'SideNavItem',
name: 'SideNavItem',
displayName: 'Side Nav Item',
description: 'Demonstrates SideNavItem with selected, icon, disabled, and nested states.',
description:
'Demonstrates SideNavItem with selected, icon, disabled, and nested states.',
isReady: true,
isShowcase: true,
aspectRatio: 4 / 3,
componentsUsed: ['SideNav', 'SideNavItem', 'SideNavSection'],
componentsUsed: ['SideNav', 'SideNavItem', 'Badge'],
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ export const doc = {
exampleFor: 'SideNavSection',
name: 'SideNavSection',
displayName: 'Side Nav Section',
description: 'Demonstrates SideNavSection with titled groups of navigation items.',
description:
'Demonstrates SideNavSection with titled groups of navigation items.',
isReady: true,
isShowcase: true,
aspectRatio: 4 / 3,
Expand Down