diff --git a/packages/design-system/src/components/CommandBar/CommandBar.stories.ts b/packages/design-system/src/components/CommandBar/CommandBar.stories.ts new file mode 100644 index 0000000000..7acb086bf0 --- /dev/null +++ b/packages/design-system/src/components/CommandBar/CommandBar.stories.ts @@ -0,0 +1,41 @@ +import type { StoryFn } from '@storybook/vue3'; + +import CommandBar from './CommandBar.vue'; + +export default { + title: 'Modules/CommandBar', + component: CommandBar, + argTypes: {}, +}; + +const Template: StoryFn = (args, { argTypes }) => ({ + setup: () => ({ args }), + props: Object.keys(argTypes), + components: { + CommandBar, + }, + template: '', +}); + +export const Default = Template.bind({}); +Default.args = { + hotkeys: [ + { + id: 'Add node', + title: 'Add node', + section: 'Nodes', + parent: null, + }, + { + id: 'Open node', + title: 'Open node', + section: 'Nodes', + parent: null, + }, + { + id: 'Add template 1', + title: 'Add template 1', + section: 'Templates', + }, + ], +}; diff --git a/packages/design-system/src/components/CommandBar/CommandBar.vue b/packages/design-system/src/components/CommandBar/CommandBar.vue new file mode 100644 index 0000000000..82011d16a8 --- /dev/null +++ b/packages/design-system/src/components/CommandBar/CommandBar.vue @@ -0,0 +1,36 @@ + + + + + diff --git a/packages/design-system/src/components/CommandBar/index.ts b/packages/design-system/src/components/CommandBar/index.ts new file mode 100644 index 0000000000..9fa4ce5cca --- /dev/null +++ b/packages/design-system/src/components/CommandBar/index.ts @@ -0,0 +1,3 @@ +import CommandBar from './CommandBar.vue'; + +export default CommandBar; diff --git a/packages/design-system/src/components/index.ts b/packages/design-system/src/components/index.ts index 2d06e5b8c6..8d04435614 100644 --- a/packages/design-system/src/components/index.ts +++ b/packages/design-system/src/components/index.ts @@ -54,3 +54,4 @@ export { default as N8nUserSelect } from './N8nUserSelect'; export { default as N8nUsersList } from './N8nUsersList'; export { default as N8nResizeObserver } from './ResizeObserver'; export { N8nKeyboardShortcut } from './N8nKeyboardShortcut'; +export { default as N8nCommandBar } from './CommandBar'; diff --git a/packages/editor-ui/src/views/NodeView.v2.vue b/packages/editor-ui/src/views/NodeView.v2.vue index 6cca6b0614..0b29fd202d 100644 --- a/packages/editor-ui/src/views/NodeView.v2.vue +++ b/packages/editor-ui/src/views/NodeView.v2.vue @@ -100,7 +100,7 @@ import { nodeViewEventBus } from '@/event-bus'; import * as NodeViewUtils from '@/utils/nodeViewUtils'; import { tryToParseNumber } from '@/utils/typesUtils'; import { useTemplatesStore } from '@/stores/templates.store'; -import { createEventBus } from 'n8n-design-system'; +import { createEventBus, N8nCommandBar } from 'n8n-design-system'; import type { PinDataSource } from '@/composables/usePinnedData'; import { useClipboard } from '@/composables/useClipboard'; import { useBeforeUnload } from '@/composables/useBeforeUnload'; @@ -1802,11 +1802,7 @@ const subworkflowCommands = computed(() => { --> - + @@ -1837,14 +1833,4 @@ const subworkflowCommands = computed(() => { } } } - -ninja-keys { - --ninja-z-index: 1000; - --ninja-accent-color: var(--color-primary); - --ninja-actions-height: 400px; -} - -ninja-keys::part(ninja-action) { - line-height: var(--font-line-height-loose); -}