-
Notifications
You must be signed in to change notification settings - Fork 632
chore: Move keyboard button to UI #3289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
cab803e
started
MichaelUnkey 9a950c2
small changes
MichaelUnkey 9538f70
fix prose issues in eng docs
MichaelUnkey c717bc9
Merge branch 'main' of https://github.com/unkeyed/unkey into move-key…
MichaelUnkey c109f1a
Merge branch 'main' of https://github.com/unkeyed/unkey into move-key…
MichaelUnkey c9c5b7a
Merge branch 'main' of https://github.com/unkeyed/unkey into move-key…
MichaelUnkey 46638bc
fmt
MichaelUnkey d381606
Update apps/engineering/content/design/components/buttons/keyboard-bu…
MichaelUnkey File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
...app/(app)/logs/components/controls/components/logs-display/components/display-popover.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
apps/engineering/content/design/components/buttons/keyboard-button.examples.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| "use client"; | ||
| import { RenderComponentWithSnippet } from "@/app/components/render"; | ||
| import { KeyboardButton } from "@unkey/ui"; | ||
|
|
||
| export const Default = () => { | ||
| return ( | ||
| <RenderComponentWithSnippet> | ||
| <div className="flex w-300[px] h-32 border border-gray-6 rounded-md justify-center items-center p-3 gap-2"> | ||
| <span className="text-gray-9 text-[13px]">Default</span> | ||
| <KeyboardButton shortcut="D" /> | ||
| <span className="text-gray-9 text-[13px]">Modifier Key</span> | ||
| <KeyboardButton modifierKey="⌘" shortcut="K" className="w-full m-0 p-0 gap-2" /> | ||
| </div> | ||
| </RenderComponentWithSnippet> | ||
| ); | ||
| }; | ||
49 changes: 49 additions & 0 deletions
49
apps/engineering/content/design/components/keyboard-button.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| --- | ||
| title: 'KeyboardButton' | ||
| description: 'A component for displaying keyboard shortcuts with optional modifier keys' | ||
| --- | ||
| import { Default } from "./buttons/keyboard-button.examples" | ||
|
|
||
| # KeyboardButton | ||
|
|
||
| The `KeyboardButton` component is designed to display keyboard shortcuts in a visually appealing and accessible way. It supports displaying both regular keys and modifier keys (like ⌘, ⇧, CTRL, ⌥) in a consistent format. | ||
|
|
||
| ## Features | ||
|
|
||
| - Displays keyboard shortcuts with optional modifier keys | ||
| - Accessible with proper ARIA attributes | ||
| - Supports both light and dark themes | ||
| - Responsive design with mobile considerations | ||
| - Customizable through className prop | ||
|
|
||
| ## Props | ||
|
|
||
| | Prop | Type | Description | | ||
| |------|------|-------------| | ||
| | `shortcut` | `string` | The main key of the keyboard shortcut | | ||
| | `modifierKey` | `"⌘" \| "⇧" \| "CTRL" \| "⌥" \| null` | Optional modifier key to be displayed before the main shortcut | | ||
| | `className` | `string` | Additional CSS classes to customize the component | | ||
|
|
||
| The component also accepts all standard HTML div element props. | ||
|
|
||
| ## Usage | ||
|
|
||
| Default and Modifier Key | ||
|
|
||
| <Default /> | ||
|
|
||
| ## Accessibility | ||
|
|
||
| The component includes: | ||
| - Proper ARIA labels for screen readers | ||
| - Keyboard focus management | ||
| - Descriptive title attributes for tooltips | ||
|
|
||
| ## Design | ||
|
|
||
| The component features: | ||
| - Consistent padding and sizing | ||
| - Drop shadow effects | ||
| - Hover and focus states | ||
| - Dark mode support | ||
| - Responsive behavior (hidden on mobile devices) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.