Skip to content

Conversation

@rossnelson
Copy link
Collaborator

@rossnelson rossnelson commented Aug 25, 2025

Summary

Enhanced UI components with new styling variants, configuration options, and improved maintainability.

CleanShot 2025-08-25 at 14 55 10

Changes

Combobox Enhancements

  • Ghost variant: Added variant="ghost" prop for borderless appearance with transparent background
  • Improved focus behavior: Ghost variant maintains transparent background on focus without color changes
  • Better dark mode support: Optimized hover colors using surface-interactive-secondary for improved contrast
  • Clickable chevron: Added showChevron={true} prop that displays an animated chevron icon
  • Interactive rotation: Chevron rotates 180 degrees with smooth animation when combobox opens/closes
  • Toggle functionality: Clicking the chevron toggles the combobox open/closed state

Top Navigation Improvements

  • Configurable padding: Added paddingX and paddingXMd props with backward-compatible defaults
  • Organized class structure: Refactored Tailwind classes with logical grouping for better maintainability
  • Enhanced readability: Classes now organized by surface, positioning, display, layout, alignment, borders, and padding

Menu Button Enhancement

  • Smooth rotation: Added chevron rotation animation to menu button component

Features

Ghost Variant

  • Removes visible borders for a clean, minimal appearance
  • Maintains hover and focus states for accessibility
  • Perfect for seamless integration into various layouts
  • Optimized for both light and dark themes

Animated Chevron

  • Visual indicator of combobox state (down = closed, up = open)
  • Clickable to toggle without focusing the input
  • Smooth 200ms rotation animation
  • Proper accessibility labels and focus handling

Configurable Navigation

  • Top nav padding can be customized via props while maintaining existing defaults
  • Better code organization with logical class grouping

Backward Compatibility

All changes are additive and maintain full backward compatibility. Existing component usage remains unchanged with sensible defaults.

Test Plan

  • Verify ghost variant renders without borders and shows appropriate hover effects
  • Test chevron animation on open/close actions
  • Confirm chevron click toggles combobox state
  • Validate top nav padding props work correctly
  • Test dark mode hover colors for ghost variant
  • Confirm accessibility with screen readers
  • Test keyboard navigation still works correctly
  • Verify all existing functionality remains intact

Add transition-transform class and conditional rotate-180 transform
to the chevron icon in menu button for improved visual feedback
when expanding/collapsing menus.
- Add ghost variant with transparent borders and hover effects
- Add showChevron prop with animated rotation on open/close
- Chevron is clickable to toggle combobox state
- Include stories for both new features
- Maintain backward compatibility
@rossnelson rossnelson requested a review from rossedfort as a code owner August 25, 2025 18:54
@vercel
Copy link

vercel bot commented Aug 25, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
holocene Ready Ready Preview Comment Aug 27, 2025 2:10pm

…vron

- Replace chevron-up/chevron-down icon switching with rotation animation
- Use chevron-down as base icon and rotate 180 degrees when open
- Consistent with combobox implementation and smoother animation
…t variant

- Add configurable paddingX and paddingXMd props to top-nav with defaults
- Update combobox ghost variant to not change color on focus
- Use lighter hover color (surface-interactive-secondary) for better dark mode contrast
Reorganize Tailwind classes in top-nav component with logical grouping:
- Surface styling (surface-primary)
- Positioning (sticky top-0 z-40)
- Display (hidden md:flex)
- Layout (w-full, flex-col md:flex-row)
- Alignment (items-center justify-end)
- Borders (border-b border-subtle)
- Padding (p-1 px-4 md:px-8)
- Custom class override (className)

Also added missing twMerge import for proper class merging.
<button
type="button"
class="hover:bg-gray-100 flex h-full items-center rounded pr-2 focus:outline-none"
on:click|stopPropagation={() => ($open ? closeList() : openList())}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we stop propagation here?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ternaries give me the ick I think I'd prefer an if statement

Copy link
Collaborator

Choose a reason for hiding this comment

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

Gonna have to get ourselves in a cage and duke this out. Much prefer this over an if statement

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I like little ternaries. the big ones or nested ones hurt my feelings.

Copy link
Contributor

Choose a reason for hiding this comment

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

How about a toggleList() function, no ternary needed 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Why do we stop propagation here?

Do we want the event bubbling?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

How about a toggleList() function, no ternary needed 🤔

hmm. I could add a toggle but its going to be doing essentially the same thing since the open and close callbacks do more than simply set state.

@apply opacity-50;
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Absolute cinema

- Add ClassNameValue type to top-nav for better type safety
- Refactor combobox chevron rotation to use twMerge for cleaner conditional classes
- Replace template literal class concatenation with explicit boolean conditions
@rossnelson rossnelson merged commit ae51d53 into main Aug 27, 2025
15 checks passed
@rossnelson rossnelson deleted the DT-3162-workflow-namespace-tags branch August 27, 2025 20:15
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.

5 participants