-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from askorama/feature/orm-1436
feat: add navigation bar
- Loading branch information
Showing
13 changed files
with
148 additions
and
21 deletions.
There are no files selected for viewing
This file contains 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,14 @@ | ||
import type { StoryObj, Meta } from '@storybook/web-components' | ||
import type { Components } from 'ui-stencil' | ||
|
||
const meta: Meta<Components.OramaNavigationBar> = { | ||
title: 'Internal/OramaNavigationBar', | ||
component: 'orama-navigation-bar', | ||
} | ||
|
||
export default meta | ||
type Story = StoryObj<Components.OramaNavigationBar> | ||
|
||
export const OramaNavigationBar: Story = { | ||
args: {}, | ||
} |
This file contains 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 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 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
46 changes: 46 additions & 0 deletions
46
packages/ui-stencil/src/components/internal/orama-navigation-bar/orama-navigation-bar.scss
This file contains 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,46 @@ | ||
:host { | ||
display: flex; | ||
align-items: center; | ||
padding: var(--spacing-s, $spacing-s) var(--spacing-l, $spacing-l); | ||
background-color: var(--background-color-primary, background-color('primary')); | ||
} | ||
|
||
.corner-section { | ||
flex: 1; | ||
display: flex; | ||
gap: var(--spacing-xs, $spacing-xs); | ||
|
||
&.start { | ||
display: flex; | ||
justify-content: flex-start; | ||
} | ||
|
||
&.center { | ||
display: flex; | ||
justify-content: 'center'; | ||
} | ||
|
||
&.end { | ||
display: flex; | ||
justify-content: flex-end; | ||
} | ||
} | ||
|
||
// TODO: We may want to create a Icon variant for button and use it here | ||
.navbar-button { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
background: none; | ||
border: none; | ||
cursor: pointer; | ||
|
||
color: var(--icon-color-tertiary, text-color('tertiary')); | ||
font-size: var(--font-size-lg, $font-size-lg); | ||
padding: var(--spacing-s, $spacing-s); | ||
border-radius: var(--radius-s, $radius-s); | ||
|
||
&:hover { | ||
background-color: var(--background-color-fourth, background-color('fourth')); | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
packages/ui-stencil/src/components/internal/orama-navigation-bar/orama-navigation-bar.tsx
This file contains 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,35 @@ | ||
import { Component, Host, h } from '@stencil/core' | ||
import '@phosphor-icons/webcomponents/PhClock' | ||
import '@phosphor-icons/webcomponents/PhPlus' | ||
import '@phosphor-icons/webcomponents/PhCaretLeft' | ||
import { globalContext } from '@/context/GlobalContext' | ||
|
||
@Component({ | ||
tag: 'orama-navigation-bar', | ||
styleUrl: 'orama-navigation-bar.scss', | ||
shadow: true, | ||
}) | ||
export class OramaNavigationBar { | ||
render() { | ||
return ( | ||
<Host> | ||
<div class="corner-section start"> | ||
<button class="navbar-button" type="button" onClick={() => (globalContext.open = false)}> | ||
<ph-caret-left /> | ||
</button> | ||
</div> | ||
<div class="section center"> | ||
<orama-toggler /> | ||
</div> | ||
<div class="corner-section end"> | ||
<button class="navbar-button" type="button"> | ||
<ph-clock /> | ||
</button> | ||
<button class="navbar-button" type="button"> | ||
<ph-plus /> | ||
</button> | ||
</div> | ||
</Host> | ||
) | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
packages/ui-stencil/src/components/internal/orama-navigation-bar/readme.md
This file contains 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,28 @@ | ||
# orama-navigation-bar | ||
|
||
|
||
|
||
<!-- Auto Generated Below --> | ||
|
||
|
||
## Dependencies | ||
|
||
### Used by | ||
|
||
- [search-box](../../search-box) | ||
|
||
### Depends on | ||
|
||
- [orama-toggler](../../orama-toggler) | ||
|
||
### Graph | ||
```mermaid | ||
graph TD; | ||
orama-navigation-bar --> orama-toggler | ||
search-box --> orama-navigation-bar | ||
style orama-navigation-bar fill:#f9f,stroke:#333,stroke-width:4px | ||
``` | ||
|
||
---------------------------------------------- | ||
|
||
*Built with [StencilJS](https://stenciljs.com/)* |
This file contains 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 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 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 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 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 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