Skip to content

Commit

Permalink
feat(3000): add 3000 styles for keyboard shortcut (#18766)
Browse files Browse the repository at this point in the history
  • Loading branch information
thmsobrmlr authored Nov 21, 2023
1 parent f34d89c commit dfc9d31
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 2 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@
color: var(--default);
text-transform: capitalize;

.posthog-3000 & {
text-transform: uppercase;
border-radius: 0.25rem;
border-bottom-width: 2px;
font-size: 0.625rem;
padding: 0.125rem 0.25rem;
}

.posthog-3000[theme='dark'] & {
border-color: var(--muted-3000);
}

.KeyboardShortcut--muted > & {
background: none;
color: var(--muted);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { Meta } from '@storybook/react'

import { KeyboardShortcut } from './KeyboardShortcut'

const meta: Meta<typeof KeyboardShortcut> = {
title: 'PostHog 3000/Keyboard Shortcut',
component: KeyboardShortcut,
tags: ['autodocs'],
}
export default meta

export const Default = {
args: {
cmd: true,
shift: true,
k: true,
},
}

export const Muted = {
args: {
muted: true,
cmd: true,
shift: true,
k: true,
},
}
2 changes: 1 addition & 1 deletion frontend/src/lib/components/CommandBar/ActionInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const ActionInput = (): JSX.Element => {
className="CommandBar__input"
fullWidth
prefix={<PrefixIcon activeFlow={activeFlow} />}
suffix={<KeyboardShortcut escape muted />}
suffix={<KeyboardShortcut escape />}
placeholder={activeFlow?.instruction ?? 'What would you like to do? Try some suggestions…'}
autoFocus
value={input}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lib/components/CommandBar/SearchInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const SearchInput = forwardRef(function _SearchInput(_, ref: Ref<HTMLInpu
size="small"
className="CommandBar__input"
fullWidth
suffix={<KeyboardShortcut escape muted />}
suffix={<KeyboardShortcut escape />}
autoFocus
value={searchQuery}
onChange={setSearchQuery}
Expand Down

0 comments on commit dfc9d31

Please sign in to comment.