-
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.
- Loading branch information
1 parent
6776dd1
commit d5b358c
Showing
10 changed files
with
124 additions
and
10 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
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
22 changes: 22 additions & 0 deletions
22
packages/ui-stencil/src/components/internal/orama-chat-button/orama-chat-button.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,22 @@ | ||
:host { | ||
padding: var(--spacing-s, $spacing-s); | ||
} | ||
|
||
.chat-button { | ||
@include paragraph(); | ||
display: flex; | ||
width: 100%; | ||
padding: var(--spacing-s, $spacing-s); | ||
align-items: center; | ||
gap: var(--spacing-s, $spacing-s); | ||
cursor: pointer; | ||
border-radius: var(--spacing-s, $spacing-s); | ||
border: 1px solid transparent; | ||
background-color: transparent; | ||
|
||
@media (hover: hover) { | ||
&:hover { | ||
background-color: var(--background-color-tertiary, background-color('tertiary')); | ||
} | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
packages/ui-stencil/src/components/internal/orama-chat-button/orama-chat-button.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,30 @@ | ||
import { Component, Prop, h, Element, Host } from '@stencil/core' | ||
import { getNonExplicitAttributes } from '@/utils/utils' | ||
|
||
@Component({ | ||
tag: 'orama-chat-button', | ||
styleUrl: 'orama-chat-button.scss', | ||
shadow: true, | ||
}) | ||
/** | ||
* The orama-chat-button component is used to render a button element that will trigger the chat. | ||
*/ | ||
export class OramaChatButton { | ||
@Element() el: HTMLButtonElement | ||
|
||
@Prop() label: string | ||
@Prop() class?: string | ||
|
||
render() { | ||
const declaredProps = ['label', 'onClick', 'class'] | ||
const buttonProps = getNonExplicitAttributes(this.el, declaredProps) | ||
|
||
return ( | ||
<Host class={this.class}> | ||
<button class="chat-button" {...buttonProps} type="button"> | ||
{this.label} | ||
</button> | ||
</Host> | ||
) | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
packages/ui-stencil/src/components/internal/orama-chat-button/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,31 @@ | ||
# orama-chat-button | ||
|
||
|
||
|
||
<!-- Auto Generated Below --> | ||
|
||
|
||
## Properties | ||
|
||
| Property | Attribute | Description | Type | Default | | ||
| -------- | --------- | ----------- | -------- | ----------- | | ||
| `class` | `class` | | `string` | `undefined` | | ||
| `label` | `label` | | `string` | `undefined` | | ||
|
||
|
||
## Dependencies | ||
|
||
### Used by | ||
|
||
- [orama-search](../orama-search) | ||
|
||
### Graph | ||
```mermaid | ||
graph TD; | ||
orama-search --> orama-chat-button | ||
style orama-chat-button 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
Oops, something went wrong.