diff --git a/apps/storybook/stories/public/orama-search-box.stories.tsx b/apps/storybook/stories/public/orama-search-box.stories.tsx index eb0891dc..da01214e 100644 --- a/apps/storybook/stories/public/orama-search-box.stories.tsx +++ b/apps/storybook/stories/public/orama-search-box.stories.tsx @@ -25,7 +25,8 @@ const meta: Meta }, }, }, - chatPlaceholder: { + searchPlaceholder: { + control: { type: 'text' }, table: { type: { summary: 'string', @@ -33,12 +34,13 @@ const meta: Meta defaultValue: { summary: '' }, }, }, - searchPlaceholder: { + chatPlaceholder: { + control: { type: 'text' }, table: { type: { summary: 'string', }, - defaultValue: { summary: 'Search...' }, + defaultValue: { summary: '' }, }, }, colorScheme: { @@ -64,22 +66,37 @@ const meta: Meta } export default meta -const Template = ({ preset, chatPlaceholder, searchPlaceholder, colorScheme, disableChat }) => { +const Template = ({ + preset, + chatPlaceholder, + searchPlaceholder, + colorScheme, + disableChat, + suggestions, + open, + facetProperty, + themeConfig, + index, + sourceBaseUrl, + sourcesMap, + highlight, + resultMap, +}) => { return html`
Search...
` } -const TemplateAsEmbed = ({ preset, chatPlaceholder, searchPlaceholder, colorScheme, disableChat }) => { +const TemplateAsEmbed = ({ + preset, + chatPlaceholder, + searchPlaceholder, + colorScheme, + disableChat, + open, + facetProperty, + resultMap, + themeConfig, + index, + sourceBaseURL, + suggestions, + sourcesMap, +}) => { return html`
-export const SearchBox: Story = { +export const SearchBoxAsModal: Story = { render: Template as any, args: { preset: 'orama', colorScheme: 'light', - searchPlaceholder: 'Search...', - chatPlaceholder: 'Ask me anything...', disableChat: false, }, } @@ -135,7 +164,6 @@ export const SearchBoxAsEmbed: Story = { args: { preset: 'orama', colorScheme: 'light', - searchPlaceholder: 'Search...', chatPlaceholder: 'Ask me anything...', disableChat: false, }, diff --git a/packages/ui-stencil/src/components/internal/icons.tsx b/packages/ui-stencil/src/components/internal/icons.tsx index 034c9b97..6fb79add 100644 --- a/packages/ui-stencil/src/components/internal/icons.tsx +++ b/packages/ui-stencil/src/components/internal/icons.tsx @@ -9,7 +9,7 @@ interface IconProps { export const Icon: FunctionalComponent = ({ name, size = 24, color = 'black' }) => { const getIconSvg = (iconName: string) => { const icons: { [key: string]: string } = { - star: ` + star: ` diff --git a/packages/ui-stencil/src/components/internal/orama-chat-button/orama-chat-button.tsx b/packages/ui-stencil/src/components/internal/orama-chat-button/orama-chat-button.tsx index 90f1e4e2..4d2e0129 100644 --- a/packages/ui-stencil/src/components/internal/orama-chat-button/orama-chat-button.tsx +++ b/packages/ui-stencil/src/components/internal/orama-chat-button/orama-chat-button.tsx @@ -44,7 +44,7 @@ export class OramaChatButton { type="button" > - + {this.label} diff --git a/packages/ui-stencil/src/components/internal/orama-chat-suggestions/orama-chat-suggestions.scss b/packages/ui-stencil/src/components/internal/orama-chat-suggestions/orama-chat-suggestions.scss index f4ab2a21..63507a7c 100644 --- a/packages/ui-stencil/src/components/internal/orama-chat-suggestions/orama-chat-suggestions.scss +++ b/packages/ui-stencil/src/components/internal/orama-chat-suggestions/orama-chat-suggestions.scss @@ -7,7 +7,6 @@ align-items: center; gap: var(--spacing-m, $spacing-m); padding: var(--radius-s, $spacing-s) var(--radius-l, $spacing-l); - list-style: none; margin: 0; overflow-x: auto; @@ -80,6 +79,7 @@ -webkit-text-fill-color: transparent; width: 100%; border: 1px solid transparent; + font-family: inherit; &:focus-visible { outline: none; diff --git a/packages/ui-stencil/src/components/internal/orama-embed/orama-embed.scss b/packages/ui-stencil/src/components/internal/orama-embed/orama-embed.scss index 32d15328..3bd2b2e7 100644 --- a/packages/ui-stencil/src/components/internal/orama-embed/orama-embed.scss +++ b/packages/ui-stencil/src/components/internal/orama-embed/orama-embed.scss @@ -1,5 +1,5 @@ .embed { - background-color: var(--background-color-secondary, background-color('secondary')); + background-color: var(--background-color-primary, background-color('primary')); border: 1px solid var(--border-color-primary, border-color('primary')); border-radius: var(--radius-m, $radius-m); inset: 0; @@ -14,6 +14,8 @@ flex-direction: column; @media (--md-min) { + background-color: var(--background-color-secondary, background-color('secondary')); + orama-input { padding: 0; margin: 0; @@ -24,4 +26,4 @@ border-radius: var(--radius-m, $radius-m) var(--radius-m, $radius-m) 0 0; } } -} \ No newline at end of file +} diff --git a/packages/ui-stencil/src/components/internal/orama-search/orama-search.scss b/packages/ui-stencil/src/components/internal/orama-search/orama-search.scss index b12ee160..77e95711 100644 --- a/packages/ui-stencil/src/components/internal/orama-search/orama-search.scss +++ b/packages/ui-stencil/src/components/internal/orama-search/orama-search.scss @@ -2,6 +2,7 @@ display: flex; flex-direction: column; overflow: hidden; + width: 100%; orama-input { @media (--md-max) { diff --git a/packages/ui-stencil/src/components/orama-search-box/orama-search-box.scss b/packages/ui-stencil/src/components/orama-search-box/orama-search-box.scss index f7f123a2..64a183b9 100644 --- a/packages/ui-stencil/src/components/orama-search-box/orama-search-box.scss +++ b/packages/ui-stencil/src/components/orama-search-box/orama-search-box.scss @@ -32,6 +32,7 @@ .section-active { display: flex; + overflow: hidden; } .section-inactive { diff --git a/packages/ui-stencil/src/components/orama-search-box/orama-search-box.tsx b/packages/ui-stencil/src/components/orama-search-box/orama-search-box.tsx index 17c70add..3f9deb3f 100644 --- a/packages/ui-stencil/src/components/orama-search-box/orama-search-box.tsx +++ b/packages/ui-stencil/src/components/orama-search-box/orama-search-box.tsx @@ -177,9 +177,16 @@ export class SearchBox { getSearchBox() { return ( - +
1024 + ? 'section-active' + : globalContext.currentTask === 'search' + ? 'section-active' + : 'section-inactive' + }`} + > 1024 ? 'section-active' : globalContext.currentTask === 'search' ? 'section-active' : 'section-inactive'}`} placeholder={this?.searchPlaceholder || 'Search...'} focusInput={globalContext.currentTask === 'search'} sourceBaseUrl={this.sourceBaseUrl} @@ -201,7 +208,7 @@ export class SearchBox { /> )} - +
) } diff --git a/packages/ui-stencil/src/styles/_colors.scss b/packages/ui-stencil/src/styles/_colors.scss index 8977cd6c..d0080f20 100644 --- a/packages/ui-stencil/src/styles/_colors.scss +++ b/packages/ui-stencil/src/styles/_colors.scss @@ -3,6 +3,8 @@ TODO: We'll make this task automatic in the future */ +@use 'sass:color'; + /** * * PRIMITIVE COLORS */ @@ -69,6 +71,8 @@ $semanticColors: ( $elementColors: ( 'button-text': ( + // TODO: example of how to use the color functions with semantic colors + // primary: color.adjust(text-color('primary', $semanticColors), $lightness: 10%), primary: $purple100, secondary: text-color('secondary', $semanticColors), inactive: $gray500,