@seamly/web-ui 22.3.0-beta.1 → 22.3.0-beta.2

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 (46) hide show
  1. package/build/dist/lib/components.js +180 -153
  2. package/build/dist/lib/components.js.map +1 -1
  3. package/build/dist/lib/components.min.js +1 -1
  4. package/build/dist/lib/components.min.js.map +1 -1
  5. package/build/dist/lib/hooks.js +150 -136
  6. package/build/dist/lib/hooks.js.map +1 -1
  7. package/build/dist/lib/hooks.min.js +1 -1
  8. package/build/dist/lib/hooks.min.js.map +1 -1
  9. package/build/dist/lib/index.debug.js +35 -35
  10. package/build/dist/lib/index.debug.min.js +1 -1
  11. package/build/dist/lib/index.debug.min.js.LICENSE.txt +4 -4
  12. package/build/dist/lib/index.debug.min.js.map +1 -1
  13. package/build/dist/lib/index.js +86 -61
  14. package/build/dist/lib/index.js.map +1 -1
  15. package/build/dist/lib/index.min.js +1 -1
  16. package/build/dist/lib/index.min.js.map +1 -1
  17. package/build/dist/lib/standalone.js +86 -62
  18. package/build/dist/lib/standalone.js.map +1 -1
  19. package/build/dist/lib/standalone.min.js +1 -1
  20. package/build/dist/lib/standalone.min.js.map +1 -1
  21. package/build/dist/lib/style-guide.js +92 -61
  22. package/build/dist/lib/style-guide.js.map +1 -1
  23. package/build/dist/lib/style-guide.min.js +1 -1
  24. package/build/dist/lib/style-guide.min.js.map +1 -1
  25. package/build/dist/lib/styles.css +1 -1
  26. package/build/dist/lib/utils.js +180 -154
  27. package/build/dist/lib/utils.js.map +1 -1
  28. package/build/dist/lib/utils.min.js +1 -1
  29. package/build/dist/lib/utils.min.js.map +1 -1
  30. package/package.json +1 -1
  31. package/src/javascripts/domains/translations/components/options-dialog/translation-option.tsx +1 -1
  32. package/src/javascripts/style-guide/states.js +8 -0
  33. package/src/javascripts/ui/components/chat-status/chat-status-action.tsx +2 -2
  34. package/src/javascripts/ui/components/conversation/event/carousel-component/components/controls.js +2 -2
  35. package/src/javascripts/ui/components/conversation/event/choice-prompt.js +1 -1
  36. package/src/javascripts/ui/components/conversation/event/image-lightbox.js +1 -1
  37. package/src/javascripts/ui/components/conversation/event-divider.js +6 -1
  38. package/src/javascripts/ui/components/form-controls/error.js +1 -1
  39. package/src/javascripts/ui/components/form-controls/file-input.js +1 -1
  40. package/src/javascripts/ui/components/layout/agent-info.js +1 -1
  41. package/src/javascripts/ui/components/layout/{icon.js → icon.tsx} +74 -37
  42. package/src/javascripts/ui/components/options/options-button.js +1 -1
  43. package/src/javascripts/ui/components/suggestions/suggestions-item.js +1 -1
  44. package/src/javascripts/ui/components/view/window-view/window-open-button.js +1 -1
  45. package/src/javascripts/ui/components/widgets/lightbox.js +1 -1
  46. package/src/stylesheets/5-components/_message-card.scss +4 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seamly/web-ui",
3
- "version": "22.3.0-beta.1",
3
+ "version": "22.3.0-beta.2",
4
4
  "main": "build/dist/lib/index.js",
5
5
  "types": "build/src/javascripts/index.d.ts",
6
6
  "module": "",
@@ -36,7 +36,7 @@ const TranslationOption: FC<TranslationOptionProps> = ({
36
36
  onKeyDown={onKeyDown}
37
37
  id={id}
38
38
  >
39
- <Icon alt="" name="check" size="16" />
39
+ <Icon name="check" size="16" alt="" />
40
40
  {label} {description && <span>({description})</span>}
41
41
  </li>
42
42
  )
@@ -1280,6 +1280,7 @@ const standardState = {
1280
1280
  cardAskText.payload.body,
1281
1281
  cardNavigate.payload.body,
1282
1282
  cardTopic.payload.body,
1283
+ cardNoImage.payload.body,
1283
1284
  ],
1284
1285
  },
1285
1286
  },
@@ -1612,6 +1613,13 @@ const standardState = {
1612
1613
  sendTranscript: { enabled: true },
1613
1614
  },
1614
1615
  },
1616
+ config: {
1617
+ ...baseState.config,
1618
+ context: {
1619
+ ...baseState.context,
1620
+ locale: 'nl',
1621
+ },
1622
+ },
1615
1623
  translations: {
1616
1624
  ...translationsSlice,
1617
1625
  isAvailable: true,
@@ -1,9 +1,9 @@
1
- import Icon from 'ui/components/layout/icon'
1
+ import Icon, { IconProps } from 'ui/components/layout/icon'
2
2
  import { className } from 'lib/css'
3
3
 
4
4
  type ChatStatusActionProps = {
5
5
  handleClick: () => void
6
- icon: string
6
+ icon: IconProps['name']
7
7
  title: string
8
8
  srButtonText?: string
9
9
  }
@@ -24,7 +24,7 @@ export default function CarouselControls({
24
24
  aria-label={t('carousel.controls.previous')}
25
25
  onClick={handlePrevious}
26
26
  >
27
- <Icon name="arrowLeft" size="16" />
27
+ <Icon name="arrowLeft" size="16" alt="" />
28
28
  </button>
29
29
  {children}
30
30
  <button
@@ -32,7 +32,7 @@ export default function CarouselControls({
32
32
  aria-label={t('carousel.controls.next')}
33
33
  onClick={handleNext}
34
34
  >
35
- <Icon name="arrowRight" size="16" />
35
+ <Icon name="arrowRight" size="16" alt="" />
36
36
  </button>
37
37
  </div>
38
38
  )
@@ -119,7 +119,7 @@ const ChoicePrompt = ({ event, children, ...props }) => {
119
119
  {showOptions
120
120
  ? t('message.choicePrompts.cancelChooseAgain')
121
121
  : t('message.choicePrompts.chooseAgain')}
122
- <Icon name="chevronDown" size="8" />
122
+ <Icon name="chevronDown" size="8" alt="" />
123
123
  </button>
124
124
  )}
125
125
  {showOptions && (
@@ -24,7 +24,7 @@ const ImageLightbox = ({ description, url }) => {
24
24
  onClick={onOpenLightboxHandler}
25
25
  >
26
26
  {t('message.image.srTextEnlargeButtonLabel', { description })}
27
- <Icon name="enlarge" size="32" />
27
+ <Icon name="enlarge" size="32" alt="" />
28
28
  </button>
29
29
  {showLightBox && (
30
30
  <Lightbox
@@ -31,7 +31,12 @@ export default function EventDivider({
31
31
  {hasGraphic && (
32
32
  <span className={className('divider__graphic')}>
33
33
  {iconName ? (
34
- <Icon name={iconName} size={iconSize} className={iconClassName} />
34
+ <Icon
35
+ name={iconName}
36
+ size={iconSize}
37
+ className={iconClassName}
38
+ alt=""
39
+ />
35
40
  ) : (
36
41
  <img
37
42
  src={graphicSrc}
@@ -17,7 +17,7 @@ export default function Error({ id, error }) {
17
17
  >
18
18
  {isAvailable && error && (
19
19
  <span id={id} className={className('error__message')}>
20
- <Icon name="error" size="16" />
20
+ <Icon name="error" size="16" alt="" />
21
21
  {error}
22
22
  </span>
23
23
  )}
@@ -66,7 +66,7 @@ export default function FileInput({
66
66
  ])}
67
67
  >
68
68
  <label htmlFor={id} className={className('upload__label')}>
69
- <Icon name="upload" size="32" />
69
+ <Icon name="upload" size="32" alt="" />
70
70
  <div>
71
71
  <span className={className(['upload__label--text'])}>
72
72
  {labelText}
@@ -43,7 +43,7 @@ const AgentInfo = () => {
43
43
  alt=""
44
44
  />
45
45
  ) : (
46
- <Icon name="avatar" size="32" />
46
+ <Icon name="avatar" size="32" alt="" />
47
47
  )}
48
48
  <span className={className(classNames)} aria-hidden="true">
49
49
  {unreadMessageCount}
@@ -27,44 +27,81 @@ import { className as classNameFn } from 'lib/css'
27
27
 
28
28
  /* eslint-enable import/no-webpack-loader-syntax */
29
29
 
30
- const ICONS = {
31
- send32: iconSend32,
32
- balloon32: iconBalloon32,
33
- newTopic32: iconNewTopic32,
34
- newTranslation16: iconNewTranslation16,
35
- newTranslation32: iconNewTranslation32,
36
- avatar32: iconAvatar32,
37
- chevronDown8: iconChevronDown8,
38
- chevronDown32: iconChevronDown32,
39
- chevronRight8: iconChevronRight8,
40
- chevronRight16: iconChevronRight16,
41
- close8: iconClose8,
42
- close16: iconClose16,
43
- enlarge32: iconEnlarge32,
44
- options32: iconOptions32,
45
- file32: iconFile32,
46
- upload32: iconUpload32,
47
- download16: iconDownload16,
48
- error16: iconError16,
49
- arrowLeft16: iconArrowLeft16,
50
- arrowRight16: iconArrowRight16,
51
- check32: iconCheck32,
52
- check16: iconCheck16,
53
- }
54
-
55
- const Icon = ({ name, size = '32', className = undefined, alt }) => {
56
- const iconName = `${name}${size}`
30
+ export const ICONS = {
31
+ send: {
32
+ 32: iconSend32,
33
+ },
34
+ balloon: {
35
+ 32: iconBalloon32,
36
+ },
37
+ newTopic: {
38
+ 32: iconNewTopic32,
39
+ },
40
+ newTranslation: {
41
+ 16: iconNewTranslation16,
42
+ 32: iconNewTranslation32,
43
+ },
44
+ avatar: {
45
+ 32: iconAvatar32,
46
+ },
47
+ chevronDown: {
48
+ 8: iconChevronDown8,
49
+ 32: iconChevronDown32,
50
+ },
51
+ chevronRight: {
52
+ 8: iconChevronRight8,
53
+ 16: iconChevronRight16,
54
+ },
55
+ close: {
56
+ 8: iconClose8,
57
+ 16: iconClose16,
58
+ },
59
+ enlarge: {
60
+ 32: iconEnlarge32,
61
+ },
62
+ options: {
63
+ 32: iconOptions32,
64
+ },
65
+ file: {
66
+ 32: iconFile32,
67
+ },
68
+ upload: {
69
+ 32: iconUpload32,
70
+ },
71
+ download: {
72
+ 16: iconDownload16,
73
+ },
74
+ error: {
75
+ 16: iconError16,
76
+ },
77
+ arrowLeft: {
78
+ 16: iconArrowLeft16,
79
+ },
80
+ arrowRight: {
81
+ 16: iconArrowRight16,
82
+ },
83
+ check: {
84
+ 16: iconCheck16,
85
+ 32: iconCheck32,
86
+ },
87
+ } as const
57
88
 
58
- return (
59
- <>
60
- <div
61
- aria-hidden="true"
62
- className={className || classNameFn('icon')}
63
- dangerouslySetInnerHTML={{ __html: ICONS[iconName] }}
64
- />
65
- {alt && <span className={classNameFn('visually-hidden')}>{alt}</span>}
66
- </>
67
- )
89
+ export type IconProps = {
90
+ name: keyof typeof ICONS
91
+ size?: '8' | '16' | '32'
92
+ className?: string
93
+ alt: string
68
94
  }
69
95
 
96
+ const Icon = ({ name, size = '32', className, alt }: IconProps) => (
97
+ <>
98
+ <div
99
+ aria-hidden="true"
100
+ className={className || classNameFn('icon')}
101
+ dangerouslySetInnerHTML={{ __html: ICONS[name][size] }}
102
+ />
103
+ {alt && <span className={classNameFn('visually-hidden')}>{alt}</span>}
104
+ </>
105
+ )
106
+
70
107
  export default Icon
@@ -236,7 +236,7 @@ const OptionsButton = () => {
236
236
  aria-expanded={multiMenu ? menuIsOpen.toString() : null}
237
237
  aria-disabled={!multiMenu && !firstOption.available ? 'true' : null}
238
238
  >
239
- {multiMenu && <Icon name="options" size="32" />}
239
+ {multiMenu && <Icon name="options" size="32" alt="" />}
240
240
  <span className={className('button__text')}>
241
241
  {multiMenu
242
242
  ? t('options.openButtonText')
@@ -30,7 +30,7 @@ const SuggestionsItem = ({
30
30
  onClick={handleClick}
31
31
  className={className('button', 'button--primary')}
32
32
  >
33
- {hasIcon && <Icon name="chevronRight" size="8" />}
33
+ {hasIcon && <Icon name="chevronRight" size="8" alt="" />}
34
34
  {question}
35
35
  </button>
36
36
  </li>
@@ -29,7 +29,7 @@ const ButtonIcon = () => {
29
29
  alt=""
30
30
  />
31
31
  ) : (
32
- <Icon name="avatar" size="32" />
32
+ <Icon name="avatar" size="32" alt="" />
33
33
  )
34
34
  }
35
35
 
@@ -66,7 +66,7 @@ const Lightbox = ({ url, description, onClose: onCloseHandler }) => {
66
66
  className={className('modal__close')}
67
67
  onClick={onClose}
68
68
  >
69
- <Icon name="close" size="16" />
69
+ <Icon name="close" size="16" alt="" />
70
70
  {t('lightbox.closeLabel')}
71
71
  </button>
72
72
  </div>
@@ -18,15 +18,15 @@
18
18
  .#{$n}-card__content {
19
19
  display: flex;
20
20
  flex: 1 1 auto;
21
- flex-wrap: wrap;
21
+ flex-direction: column;
22
22
  gap: $spacer * 0.5;
23
23
  padding: $spacer * 0.5 $spacer * 0.75 $spacer * 0.75;
24
24
  }
25
25
 
26
26
  .#{$n}-card__title {
27
27
  display: block;
28
- flex: 0 0 100%;
29
28
  width: 100%;
29
+ height: fit-content;
30
30
  margin: 0;
31
31
  padding: 0;
32
32
  font-size: $fontsize-default;
@@ -36,12 +36,13 @@
36
36
  .#{$n}-card__description {
37
37
  display: block;
38
38
  width: 100%;
39
+ height: fit-content;
39
40
  }
40
41
 
41
42
  .#{$n}-card__content .#{$n}-button {
42
43
  display: block;
43
- align-self: flex-end;
44
44
  width: 100%;
45
+ margin-top: auto;
45
46
  font-weight: $fontweight-bold;
46
47
  text-decoration: none;
47
48
  }