-
Notifications
You must be signed in to change notification settings - Fork 556
feat(react-instantsearch-ui): implement chat components design #6704
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 84 commits
Commits
Show all changes
93 commits
Select commit
Hold shift + click to select a range
40636a0
feat(ui-components): introduce chat components
FabienMotte 6f1ed20
chore: add passphrase input
FabienMotte 0b70363
wip
Haroenv 78ed732
toggle and header part of satellite
Haroenv 62880e9
revert js example
shaejaz 9f83bde
revert react example
shaejaz 13b1e28
remove todo
shaejaz 556c1d0
remove toggle button duplicate
shaejaz 5d2e92b
add tests
shaejaz 6ceffff
update bundlesize
shaejaz dd12b04
fix lint
shaejaz b095c41
Merge branch 'master' into feat/chat-components
shaejaz 040c035
markdown
Haroenv 8adc9ef
add chat component
shaejaz 4b2531e
update chat message
shaejaz deb8c8a
fix polyfill errors
shaejaz 5ca5ec2
update lock file
shaejaz 000f255
add chat test
shaejaz adf7f8f
address comments
shaejaz 95a463e
address comments
shaejaz 032cd1d
add base lib in is.js
shaejaz c978854
add hook in react core
shaejaz 51f350f
add react widget
shaejaz c2df1ac
move transport handling to hook
shaejaz 205ab67
update types
shaejaz 2c7406e
export it anyway
Haroenv 8b26037
add chat component props
shaejaz 88cf87d
add refine button
shaejaz 69ab089
address comment
shaejaz 5cc91f7
add tests
shaejaz 2609211
update tools usage
shaejaz 09e8b51
fix ci
shaejaz e5e5259
fix type error
shaejaz e71e483
address comments
shaejaz 9041a1a
Merge branch 'master' into feat/react-chat
shaejaz 2229762
fix is version
shaejaz bfc6b25
just one zod
Haroenv 1dd7a0a
add more tests
shaejaz 729f629
use user provided search index tool
shaejaz 678e292
init
shaejaz 52ea485
remove stick to bottom hook
shaejaz 989b274
move ui to ui components
shaejaz 93d7756
add chat components
shaejaz f5b06d3
fix widget types
shaejaz 3fea3b3
forward props
shaejaz e82095a
wip: use ai dependency in connector
Haroenv e219a32
move usechat to react core
shaejaz c136118
remove is components and widgets
shaejaz ad39f22
remove unecessary react widgets
shaejaz 84b919c
fix test
shaejaz 3b1b853
deps
Haroenv 527a280
revert rollup alias
shaejaz 38c0d1c
init
shaejaz 373ce70
use carousel
shaejaz a39aece
add tools prop
shaejaz 3473921
add carousel default tool
shaejaz bfc6910
add transport to props
shaejaz d79465c
feat(react-instantsearch-ui): implement chat components design
FabienMotte 5cd47c9
chore: review considered
FabienMotte 72375c6
chore: review considered
FabienMotte 5da6059
remove
FabienMotte 692b1d0
chore: review considered
FabienMotte 3ddfcde
chore: review considered
FabienMotte 37ecdbd
chore: revert lock
FabienMotte 1b4c24f
chore: clean types
FabienMotte a493c5d
chore: fix types
FabienMotte 33da4d5
chore: clean comments
FabienMotte e83ff45
chore: fix conflicts
FabienMotte 002ce28
feat: add clear button
FabienMotte 69eecf6
feat: add default chat prompt disclaimer
FabienMotte 6d392a5
chore: revert
FabienMotte 3580993
chore: use polyfills
FabienMotte d7fc569
chore: revert
FabienMotte c59e143
chore: revert
FabienMotte 20d493f
feat: add header/prompt gradients
FabienMotte 8ef5bff
fix: chat prompt gradient z-index
FabienMotte 39dfe62
refactor: move `use-stick-to-bottom` to Chat widget
FabienMotte f17db28
chore: add `useStickToBottom` hook instead of lib
FabienMotte 87851d2
fix: mobile fixes
FabienMotte 37656d9
chore: update bundlesizes
FabienMotte daf1409
Merge master into feat/chat-design
FabienMotte fbafb54
test: fix
FabienMotte 85332c0
test: fix lint
FabienMotte 43716b2
test: fix
FabienMotte e8a8eab
chore: remove example
FabienMotte 194f3eb
fix: chat message image styles
FabienMotte 4063a99
refactor: move chat styles to components folder
FabienMotte 830c6fb
chore: fix bundlesize
FabienMotte 484d358
chore: revert yarn lock
FabienMotte 655600b
chore: revert yarn lock
FabienMotte f827ceb
chore: avoid casting as unknown
FabienMotte 9b0939c
chore: review considered
FabienMotte 1f193ff
chore: fix type issue
FabienMotte File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,341 @@ | ||
| * { | ||
| box-sizing: border-box; | ||
| } | ||
|
|
||
| body, | ||
| h1, | ||
| h2 { | ||
| margin: 0; | ||
| padding: 0; | ||
| } | ||
|
|
||
| body { | ||
| font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, | ||
| Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; | ||
| line-height: 1.25rem; | ||
| -webkit-font-smoothing: antialiased; | ||
| } | ||
|
|
||
| h2 { | ||
| color: #21243d; | ||
| font-family: Hind, sans-serif; | ||
| font-size: 1.5rem; | ||
| font-weight: bold; | ||
| } | ||
|
|
||
| /* Header */ | ||
|
|
||
| .header { | ||
| align-items: center; | ||
| background: linear-gradient(to bottom, #fbc300, #c98a00); | ||
| background-image: url('./assets/cover.png'); | ||
| background-image: url('./assets/cover.png'), | ||
| linear-gradient(to bottom, #fbc300, #c98a00); | ||
| background-position: center; | ||
| background-size: cover; | ||
| color: #fff; | ||
| display: flex; | ||
| flex-direction: column; | ||
| justify-content: center; | ||
| min-height: 368px; | ||
| padding: 0.5rem 1rem; | ||
| text-align: center; | ||
| } | ||
|
|
||
| .header-logo { | ||
| margin: 0; | ||
| } | ||
|
|
||
| .header-logo svg { | ||
| height: 24px; | ||
| width: 92px; | ||
| } | ||
|
|
||
| .header-title { | ||
| font-size: 38px; | ||
| font-weight: 300; | ||
| } | ||
|
|
||
| /* Containers */ | ||
|
|
||
| .container { | ||
| display: flex; | ||
| margin: 0 auto; | ||
| max-width: 1300px; | ||
| padding: 2rem 1rem; | ||
| } | ||
|
|
||
| .container-filters { | ||
| flex: 1; | ||
| margin-right: 60px; | ||
| max-width: 260px; | ||
| } | ||
|
|
||
| .container-header { | ||
| align-items: center; | ||
| display: flex; | ||
| justify-content: space-between; | ||
| min-height: 80px; | ||
| } | ||
|
|
||
| .container-results { | ||
| flex: 3; | ||
| } | ||
|
|
||
| .container-options { | ||
| border-bottom: 1px solid #ebecf3; | ||
| display: flex; | ||
| justify-content: flex-end; | ||
| margin-bottom: 30px; | ||
| padding: 30px 0; | ||
| } | ||
|
|
||
| .container-options .container-option:not(:first-child) { | ||
| margin-left: 48px; | ||
| } | ||
|
|
||
| .container-options select { | ||
| min-width: 100px; | ||
| } | ||
|
|
||
| .container-footer { | ||
| margin: 4rem 0; | ||
| } | ||
|
|
||
| /* Styles the SFFV highlightings */ | ||
|
|
||
| em { | ||
| font-style: normal; | ||
| } | ||
|
|
||
| em, | ||
| mark { | ||
| background: rgba(226, 164, 0, 0.4); | ||
| } | ||
|
|
||
| /* Clear refinements container */ | ||
|
|
||
| .clear-filters { | ||
| align-items: center; | ||
| display: flex; | ||
| } | ||
|
|
||
| .clear-filters svg { | ||
| margin-right: 8px; | ||
| } | ||
|
|
||
| /* Panel */ | ||
|
|
||
| .container-body .ais-Panel { | ||
| border-top: 1px solid #ebecf3; | ||
| padding-bottom: 2rem; | ||
| padding-top: 2rem; | ||
| } | ||
|
|
||
| .ais-Panel-header { | ||
| font-family: Hind, sans-serif; | ||
| } | ||
|
|
||
| /* Search box */ | ||
|
|
||
| .header .ais-SearchBox { | ||
| height: 64px; | ||
| width: 740px; | ||
| } | ||
|
|
||
| .header .ais-SearchBox .ais-SearchBox-input { | ||
| background-color: #fff; | ||
| border-radius: 8px; | ||
| box-shadow: 0 4px 48px 0 rgba(0, 0, 0, 0.2); | ||
| font-family: Hind, sans-serif; | ||
| height: 64px; | ||
| /* | ||
| The "Hind" font family is vertically off-balance. | ||
| Adding 4px of padding top makes it more vertically aligned. | ||
| */ | ||
| padding: 4px 48px 0 64px; | ||
| } | ||
|
|
||
| .header .ais-SearchBox-submit { | ||
| padding: 0 1rem 0 2rem; | ||
| width: 64px; | ||
| } | ||
|
|
||
| .header .ais-SearchBox .ais-SearchBox-input::placeholder { | ||
| color: rgba(33, 36, 61, 0.24); | ||
| opacity: 1; /* Firefox */ | ||
| } | ||
|
|
||
| .ais-SearchBox-input:-ms-input-placeholder { | ||
| color: rgba(33, 36, 61, 0.24); | ||
| } | ||
|
|
||
| .ais-SearchBox-input::-ms-input-placeholder { | ||
| color: rgba(33, 36, 61, 0.24); | ||
| } | ||
|
|
||
| .ais-SearchBox-submit { | ||
| color: #e2a400; | ||
| } | ||
|
|
||
| .ais-RefinementList .ais-SearchBox-input { | ||
| font-family: Hind, sans-serif; | ||
| /* | ||
| The "Hind" font family is vertically off-balance. | ||
| Adding some padding top makes it more vertically aligned. | ||
| */ | ||
| padding-top: 2px; | ||
| } | ||
|
|
||
| /* Hits */ | ||
|
|
||
| .hit { | ||
| color: #21243d; | ||
| font-size: 14px; | ||
| line-height: 18px; | ||
| } | ||
|
|
||
| .hit h1 { | ||
| font-size: 14px; | ||
| } | ||
|
|
||
| .hit-category { | ||
| color: #21243d; | ||
| font-size: 12px; | ||
| font-weight: 600; | ||
| line-height: 1; | ||
| margin-bottom: 8px; | ||
| opacity: 0.7; | ||
| text-transform: uppercase; | ||
| } | ||
|
|
||
| .hit-description { | ||
| margin-top: 2px; | ||
| } | ||
|
|
||
| .hit-info-container { | ||
| overflow-wrap: break-word; | ||
| word-break: break-word; | ||
| } | ||
|
|
||
| .hit-image-container { | ||
| align-items: center; | ||
| display: flex; | ||
| height: 174px; | ||
| justify-content: center; | ||
| margin: auto; | ||
| width: 174px; | ||
| } | ||
|
|
||
| .hit-image { | ||
| height: auto; | ||
| max-height: 100%; | ||
| max-width: 100%; | ||
| } | ||
|
|
||
| .hit-em { | ||
| color: #e2a400; | ||
| font-size: 11px; | ||
| font-weight: 600; | ||
| } | ||
|
|
||
| .hit-rating { | ||
| border: 1px solid rgba(226, 164, 0, 0.5); | ||
| border-radius: 4px; | ||
| margin-left: 4px; | ||
| padding: 0 4px; | ||
| } | ||
|
|
||
| .hits-empty-state { | ||
| align-items: center; | ||
| display: flex; | ||
| flex-direction: column; | ||
| margin: auto; | ||
| max-width: 300px; | ||
| } | ||
|
|
||
| .hits-empty-state-title { | ||
| font-family: Hind; | ||
| font-size: 1.5rem; | ||
| font-weight: bold; | ||
| margin-bottom: 0; | ||
| text-align: center; | ||
| } | ||
|
|
||
| .hits-empty-state-description { | ||
| color: rgba(35, 37, 51, 0.6); | ||
| font-size: 0.875rem; | ||
| text-align: center; | ||
| } | ||
|
|
||
| .hits-empty-state .ais-ClearRefinements { | ||
| margin-top: 1rem; | ||
| } | ||
|
|
||
| .hits-empty-state .ais-ClearRefinements-button--disabled { | ||
| display: none; | ||
| } | ||
|
|
||
| .hits-empty-state .ais-ClearRefinements-button { | ||
| background: rgba(10, 8, 41, 0.04); | ||
| border-radius: 3px; | ||
| color: #21243d; | ||
| min-height: 48px; | ||
| padding: 16px 24px; | ||
| } | ||
|
|
||
| /* ToggleRefinement */ | ||
|
|
||
| .ais-ToggleRefinement-label { | ||
| display: flex; | ||
| flex-direction: row-reverse; | ||
| justify-content: space-between; | ||
| } | ||
|
|
||
| .ais-ToggleRefinement-checkbox { | ||
| font: inherit; | ||
| margin-left: 1rem; | ||
| margin-right: 0; | ||
| position: relative; | ||
| } | ||
|
|
||
| .ais-ToggleRefinement-checkbox:checked::before { | ||
| color: #e2a400; | ||
| } | ||
|
|
||
| .ais-ToggleRefinement-checkbox::before { | ||
| align-items: center; | ||
| color: rgba(33, 36, 61, 0.32); | ||
| content: 'No'; | ||
| display: flex; | ||
| font-size: 0.8rem; | ||
| height: 16px; | ||
| position: absolute; | ||
| right: 38px; | ||
| } | ||
|
|
||
| .ais-ToggleRefinement-checkbox:checked::before { | ||
| content: 'Yes'; | ||
| } | ||
|
|
||
| .ais-ToggleRefinement-count { | ||
| display: none; | ||
| } | ||
|
|
||
| /* RatingMenu */ | ||
|
|
||
| .ais-RatingMenu-item:not(.ais-RatingMenu-item--selected) { | ||
| opacity: 0.5; | ||
| } | ||
|
|
||
| .ais-RatingMenu-starIcon { | ||
| margin-right: 0.5rem; | ||
| } | ||
|
|
||
| /* Hide all mobile-specific design on desktop */ | ||
|
|
||
| @media (min-width: 900px) { | ||
| [data-layout='mobile'] { | ||
| display: none; | ||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.