Skip to content

Add mobile drawer mode and UI component enhancements#110

Merged
developit merged 12 commits intomainfrom
claude/triage-overlay-picker-feature-EHCrC
Apr 11, 2026
Merged

Add mobile drawer mode and UI component enhancements#110
developit merged 12 commits intomainfrom
claude/triage-overlay-picker-feature-EHCrC

Conversation

@developit
Copy link
Copy Markdown
Owner

Summary

This PR adds adaptive mobile UI patterns and enhances component styling and functionality. The main focus is introducing a mobile drawer mode for popovers on small screens, along with new size variants for toggle buttons and a new input variant for buttons.

Key Changes

  • Adaptive Popover Drawer: Added mobile="drawer" prop to PopoverContent that transforms popovers into bottom-sheet drawers on mobile devices (≤640px) while maintaining popover behavior on larger screens. Includes smooth animations and backdrop blur effects.

  • Command System Enhancement: Implemented installAdaptiveCommands() function that intercepts beforetoggle events and automatically converts show() calls to showModal() for elements with the --modal CSS variable set, enabling the drawer behavior.

  • Toggle Button Sizes: Added size prop support with 'sm', 'md', and 'lg' presets to the Toggle component with appropriate height, padding, and border-radius adjustments.

  • Button Input Variant: Added new 'input' variant for buttons that mimics input field styling with border, background, and hover states.

  • CSS Display Logic Refactor: Reorganized popover/dropdown/context-menu/combobox display rules to use :not([open]) selector for hiding instead of default display: none, providing better control over visibility states.

Implementation Details

  • The mobile drawer uses CSS position: fixed with transform: translateY(100%) for smooth slide-up animation
  • Backdrop styling includes backdrop-filter: blur(1px) and semi-transparent overlay
  • Anchor positioning is explicitly disabled in mobile drawer mode via @supports query
  • The adaptive command system uses an allowToggle counter to prevent recursion when converting show() to showModal()
  • All new CSS transitions use allow-discrete for proper display property animation support

https://claude.ai/code/session_01Qo8Cg3pzfcfQK9kkCFNPLf

…aptive drawer

- Toggle: add size="sm" / size="lg" variants matching Button/Input dimensions
- Button: add variant="input" for picker triggers (input border, left-aligned, normal weight)
- Popover: fix display override so utility classes (.flex, etc.) work on open dialogs
  by moving display:none to :not([open]) and removing display:inline-block from [open]
- Popover: add mobile="drawer" prop for adaptive bottom-sheet on ≤640px viewports
  using beforetoggle interception to switch between show() and showModal()

https://claude.ai/code/session_01Qo8Cg3pzfcfQK9kkCFNPLf
@netlify
Copy link
Copy Markdown

netlify bot commented Apr 7, 2026

Deploy Preview for kinu-sh ready!

Name Link
🔨 Latest commit e77c98b
🔍 Latest deploy log https://app.netlify.com/projects/kinu-sh/deploys/69da570fc5b9db000870d115
😎 Deploy Preview https://deploy-preview-110--kinu-sh.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

Size Change: +753 B (+2.47%)

Total Size: 31.2 kB

📦 View Changed
Filename Size Change
benchmarks/size/.tmp/few-components/bundle.css 2.85 kB +197 B (+7.42%) 🔍
benchmarks/size/.tmp/nearly-all-components/bundle.css 8.61 kB +174 B (+2.06%)
benchmarks/size/.tmp/nearly-all-components/bundle.js 3.22 kB +42 B (+1.32%)
benchmarks/size/.tmp/one-component/bundle.css 1.43 kB +34 B (+2.44%)
dist/index.css 8.72 kB +180 B (+2.11%)
dist/index.js 5.64 kB +126 B (+2.29%)
ℹ️ View Unchanged
Filename Size
benchmarks/size/.tmp/few-components/bundle.js 405 B
benchmarks/size/.tmp/one-component/bundle.js 333 B

compressed-size-action

@developit developit marked this pull request as ready for review April 7, 2026 03:06
claude and others added 9 commits April 7, 2026 03:11
Instead of duplicating ~45 lines of drawer CSS in popover/style.css,
extend drawer/style.css selectors with [k="popover-content"][mobile="drawer"].
Popover only adds 3 overrides: --modal, max-height, border-radius.

Also fix TS error from Object.assign on beforetoggle event.

https://claude.ai/code/session_01Qo8Cg3pzfcfQK9kkCFNPLf
- Regenerate docs to pick up mobile prop on PopoverContentProps
- Add note about mobile="drawer" to popover metadata
- Replace basic popover demo with two examples: a dimensions form
  popover and an adaptive color picker that becomes a drawer on mobile
- Also regenerates toggle (size prop) and button docs

https://claude.ai/code/session_01Qo8Cg3pzfcfQK9kkCFNPLf
PopoverClose was defined but not re-exported from src/index.ts.
Add it to the public exports and use it in the popover demo.

https://claude.ai/code/session_01Qo8Cg3pzfcfQK9kkCFNPLf
The popover-as-drawer selectors in drawer/style.css were applied
unconditionally, making the popover always render as a drawer.
Wrap them in @media (max-width: 640px) so they only activate on
mobile. Also drop hardcoded widths from the demo popovers.

https://claude.ai/code/session_01Qo8Cg3pzfcfQK9kkCFNPLf
…tem in demo

Revert drawer/style.css to its original state — the adaptive popover
styles don't belong there since they can't actually be shared (media
query boundary). Full mobile drawer styles now live in popover/style.css.

Replace manual k="dropdown-item" with inline styles in the demo with
DropdownMenuItem which already has the right default styles.

https://claude.ai/code/session_01Qo8Cg3pzfcfQK9kkCFNPLf
Stack width/height fields vertically with labels on the left using a
two-column grid. Use Label and Input components instead of raw HTML,
and switch to type="number" inputs.

https://claude.ai/code/session_01Qo8Cg3pzfcfQK9kkCFNPLf
@developit developit merged commit 4795f9b into main Apr 11, 2026
6 checks passed
@developit developit deleted the claude/triage-overlay-picker-feature-EHCrC branch April 11, 2026 14:17
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