Skip to content

feat: add hierarchical navigation#18

Merged
timhanlon merged 26 commits intomainfrom
feat/tree
Mar 7, 2025
Merged

feat: add hierarchical navigation#18
timhanlon merged 26 commits intomainfrom
feat/tree

Conversation

@davestewart
Copy link
Collaborator

@davestewart davestewart commented Mar 3, 2025

Overview

This PR adds (optional) hierarchical tree navigation:

<NavRoot :stories="stories" :tree="true" />

It has:

  • tree icons
  • number of variants
  • persistent folder toggling
  • classes for all sub-components
  • a bt- prefix for all class names

Additionally, I added:

  • options section in sidebar
  • useOptions() composable (defaults to showing tree)

Regarding the new main code, I:

  • refactored existing icons to an Icon component (I used Hero Icons for consistency; feel free to change)
  • moved buttons to buttons/
  • added a command palette background (just because it needed one)

Screenshots

Hierarchical (open):

CleanShot 2025-03-04 at 13 11 40

Hierarchical (closed):

CleanShot 2025-03-04 at 13 19 56

Flat:

CleanShot 2025-03-04 at 14 19 24

Options:

CleanShot 2025-03-04 at 14 18 42

Command palette bg:

CleanShot 2025-03-04 at 14 20 41

@davestewart
Copy link
Collaborator Author

Not sure why there are conflicts... I've merged dev in... nothing my end

@davestewart davestewart requested a review from timhanlon March 3, 2025 22:29
@timhanlon
Copy link
Owner

Thanks! Looks like you branched off dev, which I stopped using when I open sourced this repo, and is about a month behind main, sorry 😬

@davestewart
Copy link
Collaborator Author

Oh crap!

Let me look to see how it's looking now...

* main: (23 commits)
  chore(release): v0.0.9
  fix: vite hmr issues (#17)
  chore(release): v0.0.8
  perf: async components (#16)
  perf: remove lucide-vue-nuxt dependency (#15)
  chore(release): v0.0.7
  docs: update README
  feat: better custom playground helpers + example (#14)
  fix: variant templates (#13)
  feat: command palette (#12)
  refactor: variants (#11)
  feat: syntax highlighting (#10)
  chore(release): v0.0.6
  feat: open in editor button (#9)
  chore: lint (#8)
  chore(release): v0.0.5
  feat: tailwind variants (#7)
  chore(release): v0.0.4
  feat: custom styling (#6)
  chore(release): v0.0.3
  ...
@davestewart
Copy link
Collaborator Author

OK, that's all merged in now.

Sorry, I'd done some work migrating icons, so I just finished that after merging the main code in.

I haven't updated the variables, but you can check it out and see what you think anyway

@davestewart
Copy link
Collaborator Author

davestewart commented Mar 5, 2025

OK, made a bunch of final tweaks, including some styling updates.

CleanShot 2025-03-05 at 16 21 50

The small variant text updates will be part of ou repo, not Bedtime.

Also. We need to set up Husky or such like as I keep pushing linting errors!

@timhanlon
Copy link
Owner

Nice one, thanks!

@timhanlon timhanlon merged commit 21a3d09 into main Mar 7, 2025
2 checks passed
@timhanlon timhanlon deleted the feat/tree branch March 7, 2025 00:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants