@athoscommerce/snap-preact 1.5.1-beta.114 → 1.5.1-beta.116

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (21) hide show
  1. package/dist/cjs/components/src/components/Atoms/Dropdown/Dropdown.d.ts.map +1 -1
  2. package/dist/cjs/components/src/components/Atoms/Dropdown/Dropdown.js +15 -3
  3. package/dist/cjs/components/src/components/Molecules/ChatProductComparisonMessage/ChatProductComparisonMessage.d.ts.map +1 -1
  4. package/dist/cjs/components/src/components/Molecules/ChatProductComparisonMessage/ChatProductComparisonMessage.js +22 -2
  5. package/dist/cjs/components/src/components/Molecules/ChatProductQueryMessage/ChatProductQueryMessage.d.ts.map +1 -1
  6. package/dist/cjs/components/src/components/Molecules/ChatProductQueryMessage/ChatProductQueryMessage.js +96 -66
  7. package/dist/cjs/components/src/components/Organisms/Chat/Chat.d.ts.map +1 -1
  8. package/dist/cjs/components/src/components/Organisms/Chat/Chat.js +218 -43
  9. package/dist/cjs/components/src/components/Organisms/Chat/Chat.styles.d.ts.map +1 -1
  10. package/dist/cjs/components/src/components/Organisms/Chat/Chat.styles.js +211 -175
  11. package/dist/esm/components/src/components/Atoms/Dropdown/Dropdown.d.ts.map +1 -1
  12. package/dist/esm/components/src/components/Atoms/Dropdown/Dropdown.js +14 -3
  13. package/dist/esm/components/src/components/Molecules/ChatProductComparisonMessage/ChatProductComparisonMessage.d.ts.map +1 -1
  14. package/dist/esm/components/src/components/Molecules/ChatProductComparisonMessage/ChatProductComparisonMessage.js +22 -2
  15. package/dist/esm/components/src/components/Molecules/ChatProductQueryMessage/ChatProductQueryMessage.d.ts.map +1 -1
  16. package/dist/esm/components/src/components/Molecules/ChatProductQueryMessage/ChatProductQueryMessage.js +94 -65
  17. package/dist/esm/components/src/components/Organisms/Chat/Chat.d.ts.map +1 -1
  18. package/dist/esm/components/src/components/Organisms/Chat/Chat.js +194 -23
  19. package/dist/esm/components/src/components/Organisms/Chat/Chat.styles.d.ts.map +1 -1
  20. package/dist/esm/components/src/components/Organisms/Chat/Chat.styles.js +67 -5
  21. package/package.json +12 -12
@@ -208,7 +208,66 @@ export const chatDefaultStyles = ({ mobile, offset, hasSideChat, footerHeight, p
208
208
  '.ss__chat__bubble': {
209
209
  display: 'none',
210
210
  },
211
+ // At constrained viewport heights (e.g. browser zoom-in) the fixed 70vh panels
212
+ // leave too little room for the messages view once sticky header/footer content
213
+ // is accounted for. Stretch the chat to fill the window minus the offset.
214
+ ...(mobile
215
+ ? {}
216
+ : {
217
+ '@media (max-height: 800px)': {
218
+ top: offsetValue || 0,
219
+ bottom: 0,
220
+ height: offsetValue ? `calc(100vh - ${offsetValue})` : '100vh',
221
+ maxHeight: offsetValue ? `calc(100vh - ${offsetValue})` : '100vh',
222
+ '.ss__chat__primary': {
223
+ height: '100%',
224
+ },
225
+ '.ss__chat__secondary': {
226
+ height: '100%',
227
+ maxHeight: '100%',
228
+ },
229
+ // The default 90vh cap on chat content would leave unfilled space when
230
+ // the chat stretches to 100vh; primary's justifyContent: flex-end then
231
+ // pushes its content down while secondary stays anchored to the top,
232
+ // making the panels appear misaligned.
233
+ '.ss__chat__content': {
234
+ maxHeight: '100%',
235
+ },
236
+ },
237
+ }),
211
238
  },
239
+ // Welcome state: only the greeting + suggested questions are shown, so let the
240
+ // chat hug its content instead of taking the full 70vh / 100vh used once a
241
+ // conversation has started. Mobile stays fullscreen by design.
242
+ ...(mobile
243
+ ? {}
244
+ : {
245
+ '&.ss__chat--welcome.ss__chat--open': {
246
+ '.ss__chat__primary': {
247
+ height: 'auto',
248
+ },
249
+ // With an auto-sized panel, the messages container's overflow/maxHeight
250
+ // constraints (and the welcome's minHeight: 100%) resolve against an
251
+ // undefined parent height and produce a stray scrollbar / clipped layout.
252
+ // Let everything flow at its natural size.
253
+ '.ss__chat__messages': {
254
+ overflow: 'visible',
255
+ maxHeight: 'none',
256
+ },
257
+ '.ss__chat__welcome': {
258
+ minHeight: 0,
259
+ },
260
+ '@media (max-height: 800px)': {
261
+ top: 'auto',
262
+ bottom: '20px',
263
+ height: 'auto',
264
+ maxHeight: 'calc(100vh - 40px)',
265
+ '.ss__chat__primary': {
266
+ height: 'auto',
267
+ },
268
+ },
269
+ },
270
+ }),
212
271
  '.ss__chat__header': {
213
272
  display: 'flex',
214
273
  justifyContent: 'space-between',
@@ -428,9 +487,9 @@ export const chatDefaultStyles = ({ mobile, offset, hasSideChat, footerHeight, p
428
487
  '.ss__chat__content__header__comparisons': {
429
488
  display: 'flex',
430
489
  flexDirection: 'column',
431
- gap: '1em',
490
+ gap: '0.5em',
432
491
  background: new Colour(colorPrimary).lightenHex(0.95),
433
- padding: '1em',
492
+ padding: '0.5em 1em',
434
493
  '.ss__chat__content__header__comparisons__header': {
435
494
  display: 'flex',
436
495
  justifyContent: 'space-between',
@@ -534,7 +593,7 @@ export const chatDefaultStyles = ({ mobile, offset, hasSideChat, footerHeight, p
534
593
  overscrollBehavior: 'contain',
535
594
  margin: 0,
536
595
  maxHeight: '100%',
537
- background: '#f9fafc',
596
+ background: new Colour(colorPrimary).lightenHex(0.95),
538
597
  '.ss__chat__messages__end': {
539
598
  height: '1px',
540
599
  },
@@ -596,10 +655,13 @@ export const chatDefaultStyles = ({ mobile, offset, hasSideChat, footerHeight, p
596
655
  lineHeight: 1.5,
597
656
  color: '#333',
598
657
  padding: '2em',
599
- textAlign: 'center',
658
+ textAlign: 'left',
600
659
  },
601
- '.ss__chat__suggestions': {
660
+ '.ss__chat-suggested-questions': {
602
661
  marginTop: 'auto',
662
+ '.ss__chat-suggested-questions__item': {
663
+ padding: '8px 16px',
664
+ },
603
665
  },
604
666
  },
605
667
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@athoscommerce/snap-preact",
3
- "version": "1.5.1-beta.114+0c51a7fbd",
3
+ "version": "1.5.1-beta.116+2e6b3dd56",
4
4
  "description": "Snap Preact",
5
5
  "main": "dist/cjs/src/index.js",
6
6
  "module": "dist/esm/src/index.js",
@@ -26,16 +26,16 @@
26
26
  "storybook": "storybook dev -c ./components/.storybook -p 6006"
27
27
  },
28
28
  "dependencies": {
29
- "@athoscommerce/snap-client": "1.5.1-beta.114+0c51a7fbd",
30
- "@athoscommerce/snap-controller": "1.5.1-beta.114+0c51a7fbd",
31
- "@athoscommerce/snap-event-manager": "1.5.1-beta.114+0c51a7fbd",
32
- "@athoscommerce/snap-logger": "1.5.1-beta.114+0c51a7fbd",
33
- "@athoscommerce/snap-platforms": "1.5.1-beta.114+0c51a7fbd",
34
- "@athoscommerce/snap-profiler": "1.5.1-beta.114+0c51a7fbd",
35
- "@athoscommerce/snap-store-mobx": "1.5.1-beta.114+0c51a7fbd",
36
- "@athoscommerce/snap-toolbox": "1.5.1-beta.114+0c51a7fbd",
37
- "@athoscommerce/snap-tracker": "1.5.1-beta.114+0c51a7fbd",
38
- "@athoscommerce/snap-url-manager": "1.5.1-beta.114+0c51a7fbd",
29
+ "@athoscommerce/snap-client": "1.5.1-beta.116+2e6b3dd56",
30
+ "@athoscommerce/snap-controller": "1.5.1-beta.116+2e6b3dd56",
31
+ "@athoscommerce/snap-event-manager": "1.5.1-beta.116+2e6b3dd56",
32
+ "@athoscommerce/snap-logger": "1.5.1-beta.116+2e6b3dd56",
33
+ "@athoscommerce/snap-platforms": "1.5.1-beta.116+2e6b3dd56",
34
+ "@athoscommerce/snap-profiler": "1.5.1-beta.116+2e6b3dd56",
35
+ "@athoscommerce/snap-store-mobx": "1.5.1-beta.116+2e6b3dd56",
36
+ "@athoscommerce/snap-toolbox": "1.5.1-beta.116+2e6b3dd56",
37
+ "@athoscommerce/snap-tracker": "1.5.1-beta.116+2e6b3dd56",
38
+ "@athoscommerce/snap-url-manager": "1.5.1-beta.116+2e6b3dd56",
39
39
  "@emotion/react": "11.13.0",
40
40
  "classnames": "^2.3.2",
41
41
  "color": "^4.2.3",
@@ -103,5 +103,5 @@
103
103
  "require": "./dist/cjs/toolbox/src/index.js"
104
104
  }
105
105
  },
106
- "gitHead": "0c51a7fbd536458bf7babb65e8632508565284a4"
106
+ "gitHead": "2e6b3dd56715d9f0a3db4c6e221146cf1147053c"
107
107
  }