@salutejs/plasma-new-hope 0.76.3-canary.1180.8720362393.0 → 0.77.0-canary.1185.8720195819.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (161) hide show
  1. package/cjs/components/Avatar/Avatar.js +1 -35
  2. package/cjs/components/Avatar/Avatar.js.map +1 -1
  3. package/cjs/components/Combobox/Combobox.css +2 -2
  4. package/cjs/components/Combobox/ui/ComboboxDivider/ComboboxDivider.css +2 -2
  5. package/cjs/components/Combobox/ui/ComboboxDivider/ComboboxDivider.js +1 -1
  6. package/cjs/components/Combobox/ui/ComboboxFooter/ComboboxFooter.css +2 -2
  7. package/cjs/components/Combobox/ui/ComboboxFooter/ComboboxFooter.js +1 -1
  8. package/cjs/components/Combobox/ui/ComboboxGroup/ComboboxGroup.css +2 -2
  9. package/cjs/components/Combobox/ui/ComboboxGroup/ComboboxGroup.js +1 -1
  10. package/cjs/components/Combobox/ui/ComboboxHeader/ComboboxHeader.css +2 -2
  11. package/cjs/components/Combobox/ui/ComboboxHeader/ComboboxHeader.js +1 -1
  12. package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.css +2 -2
  13. package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.js +1 -1
  14. package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.js +1 -1
  15. package/cjs/components/Dropdown/Dropdown.css +2 -2
  16. package/cjs/components/Dropdown/Dropdown.js +27 -4
  17. package/cjs/components/Dropdown/Dropdown.js.map +1 -1
  18. package/cjs/components/Dropdown/Dropdown.styles.js +1 -1
  19. package/cjs/components/Dropdown/Dropdown.styles.js.map +1 -1
  20. package/cjs/components/Dropdown/{Dropdown.styles_1daxhqh.css → Dropdown.styles_13400l5.css} +1 -1
  21. package/cjs/components/Dropdown/Dropdown.tokens.js +1 -0
  22. package/cjs/components/Dropdown/Dropdown.tokens.js.map +1 -1
  23. package/cjs/components/Dropdown/hooks/useKeyboardNavigation.js +81 -0
  24. package/cjs/components/Dropdown/hooks/useKeyboardNavigation.js.map +1 -0
  25. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +5 -3
  26. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
  27. package/cjs/components/Dropdown/utils/index.js +43 -0
  28. package/cjs/components/Dropdown/utils/index.js.map +1 -1
  29. package/cjs/components/Pagination/Pagination.css +2 -2
  30. package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +2 -2
  31. package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles.js +1 -1
  32. package/cjs/components/Select/Select.css +2 -2
  33. package/cjs/components/Select/ui/SelectDivider/SelectDivider.css +2 -2
  34. package/cjs/components/Select/ui/SelectDivider/SelectDivider.js +1 -1
  35. package/cjs/components/Select/ui/SelectFooter/SelectFooter.css +2 -2
  36. package/cjs/components/Select/ui/SelectFooter/SelectFooter.js +1 -1
  37. package/cjs/components/Select/ui/SelectGroup/SelectGroup.css +2 -2
  38. package/cjs/components/Select/ui/SelectGroup/SelectGroup.js +1 -1
  39. package/cjs/components/Select/ui/SelectHeader/SelectHeader.css +2 -2
  40. package/cjs/components/Select/ui/SelectHeader/SelectHeader.js +1 -1
  41. package/cjs/components/Select/ui/SelectItem/SelectItem.css +2 -2
  42. package/cjs/components/Select/ui/SelectItem/SelectItem.js +1 -1
  43. package/cjs/components/Select/ui/SelectItem/SelectItem.styles.js +1 -1
  44. package/cjs/index.css +2 -2
  45. package/cjs/index.js +2 -0
  46. package/cjs/index.js.map +1 -1
  47. package/es/components/Avatar/Avatar.js +2 -36
  48. package/es/components/Avatar/Avatar.js.map +1 -1
  49. package/es/components/Combobox/Combobox.css +2 -2
  50. package/es/components/Combobox/ui/ComboboxDivider/ComboboxDivider.css +2 -2
  51. package/es/components/Combobox/ui/ComboboxDivider/ComboboxDivider.js +1 -1
  52. package/es/components/Combobox/ui/ComboboxFooter/ComboboxFooter.css +2 -2
  53. package/es/components/Combobox/ui/ComboboxFooter/ComboboxFooter.js +1 -1
  54. package/es/components/Combobox/ui/ComboboxGroup/ComboboxGroup.css +2 -2
  55. package/es/components/Combobox/ui/ComboboxGroup/ComboboxGroup.js +1 -1
  56. package/es/components/Combobox/ui/ComboboxHeader/ComboboxHeader.css +2 -2
  57. package/es/components/Combobox/ui/ComboboxHeader/ComboboxHeader.js +1 -1
  58. package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.css +2 -2
  59. package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.js +1 -1
  60. package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.js +1 -1
  61. package/es/components/Dropdown/Dropdown.css +2 -2
  62. package/es/components/Dropdown/Dropdown.js +29 -6
  63. package/es/components/Dropdown/Dropdown.js.map +1 -1
  64. package/es/components/Dropdown/Dropdown.styles.js +1 -1
  65. package/es/components/Dropdown/Dropdown.styles.js.map +1 -1
  66. package/es/components/Dropdown/{Dropdown.styles_1daxhqh.css → Dropdown.styles_13400l5.css} +1 -1
  67. package/es/components/Dropdown/Dropdown.tokens.js +1 -0
  68. package/es/components/Dropdown/Dropdown.tokens.js.map +1 -1
  69. package/es/components/Dropdown/hooks/useKeyboardNavigation.js +76 -0
  70. package/es/components/Dropdown/hooks/useKeyboardNavigation.js.map +1 -0
  71. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +5 -3
  72. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
  73. package/es/components/Dropdown/utils/index.js +45 -3
  74. package/es/components/Dropdown/utils/index.js.map +1 -1
  75. package/es/components/Pagination/Pagination.css +2 -2
  76. package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +2 -2
  77. package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles.js +1 -1
  78. package/es/components/Select/Select.css +2 -2
  79. package/es/components/Select/ui/SelectDivider/SelectDivider.css +2 -2
  80. package/es/components/Select/ui/SelectDivider/SelectDivider.js +1 -1
  81. package/es/components/Select/ui/SelectFooter/SelectFooter.css +2 -2
  82. package/es/components/Select/ui/SelectFooter/SelectFooter.js +1 -1
  83. package/es/components/Select/ui/SelectGroup/SelectGroup.css +2 -2
  84. package/es/components/Select/ui/SelectGroup/SelectGroup.js +1 -1
  85. package/es/components/Select/ui/SelectHeader/SelectHeader.css +2 -2
  86. package/es/components/Select/ui/SelectHeader/SelectHeader.js +1 -1
  87. package/es/components/Select/ui/SelectItem/SelectItem.css +2 -2
  88. package/es/components/Select/ui/SelectItem/SelectItem.js +1 -1
  89. package/es/components/Select/ui/SelectItem/SelectItem.styles.js +1 -1
  90. package/es/index.css +2 -2
  91. package/es/index.js +1 -0
  92. package/es/index.js.map +1 -1
  93. package/package.json +2 -2
  94. package/styled-components/cjs/components/Avatar/Avatar.js +1 -40
  95. package/styled-components/cjs/components/Avatar/Avatar.template-doc.mdx +2 -52
  96. package/styled-components/cjs/components/Dropdown/Dropdown.js +28 -6
  97. package/styled-components/cjs/components/Dropdown/Dropdown.styles.js +1 -1
  98. package/styled-components/cjs/components/Dropdown/Dropdown.tokens.js +1 -0
  99. package/styled-components/cjs/components/Dropdown/hooks/useKeyboardNavigation.js +83 -0
  100. package/styled-components/cjs/components/Dropdown/index.js +9 -1
  101. package/styled-components/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +5 -3
  102. package/styled-components/cjs/components/Dropdown/utils/index.js +48 -1
  103. package/styled-components/cjs/examples/plasma_b2c/components/Avatar/Avatar.stories.tsx +1 -26
  104. package/styled-components/cjs/examples/plasma_b2c/components/AvatarGroup/AvatarGroup.stories.tsx +18 -36
  105. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.config.js +1 -1
  106. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.stories.tsx +27 -7
  107. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.config.js +1 -1
  108. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.stories.tsx +30 -11
  109. package/styled-components/cjs/examples/plasma_web/components/Avatar/Avatar.stories.tsx +1 -26
  110. package/styled-components/cjs/examples/plasma_web/components/Dropdown/Normal/Dropdown.config.js +1 -1
  111. package/styled-components/cjs/examples/plasma_web/components/Dropdown/Normal/Dropdown.stories.tsx +27 -8
  112. package/styled-components/cjs/examples/plasma_web/components/Dropdown/Tight/Dropdown.config.js +1 -1
  113. package/styled-components/cjs/examples/plasma_web/components/Dropdown/Tight/Dropdown.stories.tsx +30 -11
  114. package/styled-components/cjs/examples/sds_engineer/components/Avatar/Avatar.stories.tsx +1 -27
  115. package/styled-components/es/components/Avatar/Avatar.js +1 -41
  116. package/styled-components/es/components/Avatar/Avatar.template-doc.mdx +2 -52
  117. package/styled-components/es/components/Dropdown/Dropdown.js +29 -6
  118. package/styled-components/es/components/Dropdown/Dropdown.styles.js +1 -1
  119. package/styled-components/es/components/Dropdown/Dropdown.tokens.js +1 -0
  120. package/styled-components/es/components/Dropdown/hooks/useKeyboardNavigation.js +77 -0
  121. package/styled-components/es/components/Dropdown/index.js +1 -0
  122. package/styled-components/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +5 -3
  123. package/styled-components/es/components/Dropdown/utils/index.js +48 -1
  124. package/styled-components/es/examples/plasma_b2c/components/Avatar/Avatar.stories.tsx +1 -26
  125. package/styled-components/es/examples/plasma_b2c/components/AvatarGroup/AvatarGroup.stories.tsx +18 -36
  126. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.config.js +1 -1
  127. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.stories.tsx +27 -7
  128. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.config.js +1 -1
  129. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.stories.tsx +30 -11
  130. package/styled-components/es/examples/plasma_web/components/Avatar/Avatar.stories.tsx +1 -26
  131. package/styled-components/es/examples/plasma_web/components/Dropdown/Normal/Dropdown.config.js +1 -1
  132. package/styled-components/es/examples/plasma_web/components/Dropdown/Normal/Dropdown.stories.tsx +27 -8
  133. package/styled-components/es/examples/plasma_web/components/Dropdown/Tight/Dropdown.config.js +1 -1
  134. package/styled-components/es/examples/plasma_web/components/Dropdown/Tight/Dropdown.stories.tsx +30 -11
  135. package/styled-components/es/examples/sds_engineer/components/Avatar/Avatar.stories.tsx +1 -27
  136. package/types/components/Avatar/Avatar.d.ts +1 -3
  137. package/types/components/Avatar/Avatar.d.ts.map +1 -1
  138. package/types/components/Avatar/Avatar.types.d.ts +0 -7
  139. package/types/components/Avatar/Avatar.types.d.ts.map +1 -1
  140. package/types/components/Dropdown/Dropdown.d.ts.map +1 -1
  141. package/types/components/Dropdown/Dropdown.tokens.d.ts +1 -0
  142. package/types/components/Dropdown/Dropdown.tokens.d.ts.map +1 -1
  143. package/types/components/Dropdown/Dropdown.types.d.ts +7 -2
  144. package/types/components/Dropdown/Dropdown.types.d.ts.map +1 -1
  145. package/types/components/Dropdown/hooks/useKeyboardNavigation.d.ts +13 -0
  146. package/types/components/Dropdown/hooks/useKeyboardNavigation.d.ts.map +1 -0
  147. package/types/components/Dropdown/index.d.ts +1 -0
  148. package/types/components/Dropdown/index.d.ts.map +1 -1
  149. package/types/components/Dropdown/ui/DropdownItem/DropdownItem.d.ts.map +1 -1
  150. package/types/components/Dropdown/utils/index.d.ts +5 -2
  151. package/types/components/Dropdown/utils/index.d.ts.map +1 -1
  152. package/types/examples/plasma_b2c/components/Avatar/Avatar.d.ts +0 -2
  153. package/types/examples/plasma_b2c/components/Avatar/Avatar.d.ts.map +1 -1
  154. package/types/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.config.d.ts.map +1 -1
  155. package/types/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.config.d.ts.map +1 -1
  156. package/types/examples/plasma_web/components/Avatar/Avatar.d.ts +0 -2
  157. package/types/examples/plasma_web/components/Avatar/Avatar.d.ts.map +1 -1
  158. package/types/examples/plasma_web/components/Dropdown/Normal/Dropdown.config.d.ts.map +1 -1
  159. package/types/examples/plasma_web/components/Dropdown/Tight/Dropdown.config.d.ts.map +1 -1
  160. package/types/examples/sds_engineer/components/Avatar/Avatar.d.ts +0 -1
  161. package/types/examples/sds_engineer/components/Avatar/Avatar.d.ts.map +1 -1
@@ -112,10 +112,10 @@ const StoryNormal = (args: StoryDropdownProps) => {
112
112
  }
113
113
  };
114
114
 
115
- const handleSelect = (value: string, text: string) => {
115
+ const handleSelect = (value: string, text: string, toggleIsOpen: React.Dispatch<React.SetStateAction<boolean>>) => {
116
116
  setSelected(value);
117
117
  onSelect(value, text);
118
- setIsOpen(false);
118
+ toggleIsOpen(false);
119
119
  };
120
120
 
121
121
  return (
@@ -127,34 +127,51 @@ const StoryNormal = (args: StoryDropdownProps) => {
127
127
  onToggle={onMainToggle}
128
128
  offset={[Number(skidding), Number(distance)]}
129
129
  placement={placement}
130
+ role="listbox"
130
131
  {...rest}
131
132
  >
132
133
  {getDropdownItems('item', 6).map((item) => (
133
134
  <DropdownItem
134
135
  key={item.value}
135
136
  isSelected={Boolean(item.value === selected)}
136
- onSelect={() => handleSelect(item.value, item.child)}
137
+ onSelect={() => handleSelect(item.value, item.child, setIsOpen)}
137
138
  onClick={onClick}
138
139
  value={item.value}
140
+ role="option"
139
141
  >
140
142
  {item.child}
141
143
  </DropdownItem>
142
144
  ))}
143
145
  <Dropdown
144
- target={<DropdownItem contentRight={DisclosureRightIcon} name="test" text="Nested dropdown" />}
146
+ target={
147
+ <DropdownItem
148
+ contentRight={DisclosureRightIcon}
149
+ role="option"
150
+ name="test"
151
+ text="Nested dropdown"
152
+ />
153
+ }
145
154
  onToggle={(is) => setIsOpenDropdown2(is)}
146
155
  isOpen={isOpenDropdown2}
156
+ role="listbox"
147
157
  offset={[0, 0]}
148
158
  {...rest}
149
159
  >
150
- <DropdownItem contentRight={StyledCheckbox} value="checked" onChange={onChange} text="Checkbox" />
160
+ <DropdownItem
161
+ contentRight={StyledCheckbox}
162
+ role="option"
163
+ value="checked"
164
+ onChange={onChange}
165
+ text="Checkbox"
166
+ />
151
167
  {getDropdownItems('nested', 4).map((item) => (
152
168
  <DropdownItem
153
169
  key={item.value}
154
170
  isSelected={Boolean(item.value === selected)}
155
- onSelect={() => handleSelect(item.value, item.child)}
171
+ onSelect={() => handleSelect(item.value, item.child, setIsOpenDropdown2)}
156
172
  onClick={onClick}
157
173
  value={item.value}
174
+ role="option"
158
175
  >
159
176
  {item.child}
160
177
  </DropdownItem>
@@ -165,6 +182,7 @@ const StoryNormal = (args: StoryDropdownProps) => {
165
182
  value="1"
166
183
  onChange={onChange}
167
184
  text="Radiobox 1"
185
+ role="option"
168
186
  />
169
187
  <DropdownItem
170
188
  contentLeft={StyledRadiobox}
@@ -172,14 +190,16 @@ const StoryNormal = (args: StoryDropdownProps) => {
172
190
  value="2"
173
191
  onChange={onChange}
174
192
  text="Radiobox 2"
193
+ role="option"
175
194
  />
176
195
  </Dropdown>
177
196
 
178
197
  <DropdownItem
179
198
  isSelected={selected === 'disabled'}
180
- onSelect={() => handleSelect('disabled', 'disabled')}
199
+ onSelect={() => handleSelect('disabled', 'disabled', setIsOpen)}
181
200
  onClick={onClick}
182
201
  value="disabled"
202
+ role="option"
183
203
  disabled
184
204
  >
185
205
  disabled
@@ -21,7 +21,7 @@ var config = exports.config = {
21
21
  l: /*#__PURE__*/(0, _styledComponents.css)(["", ";", ";", ":0.8125rem;", ":1rem;", ":0.8125rem;", ":1rem;", ":0.75rem;", ":var(--plasma-typo-body-l-font-family);", ":var(--plasma-typo-body-l-font-size);", ":var(--plasma-typo-body-l-font-style);", ":var(--plasma-typo-body-l-font-weight);", ":var(--plasma-typo-body-l-letter-spacing);", ":var(--plasma-typo-body-l-line-height);"], dropdownSizeCommon, dropdownItemSizeCommon, _Dropdown.dropdownTokens.itemPaddingTop, _Dropdown.dropdownTokens.itemPaddingRight, _Dropdown.dropdownTokens.itemPaddingBottom, _Dropdown.dropdownTokens.itemPaddingLeft, _Dropdown.dropdownTokens.itemBorderRadius, _Dropdown.dropdownTokens.itemFontFamily, _Dropdown.dropdownTokens.itemFontSize, _Dropdown.dropdownTokens.itemFontStyle, _Dropdown.dropdownTokens.itemFontWeightBold, _Dropdown.dropdownTokens.itemFontLetterSpacing, _Dropdown.dropdownTokens.itemFontLineHeight)
22
22
  },
23
23
  view: {
24
- "default": /*#__PURE__*/(0, _styledComponents.css)(["", ":0.4;", ":var(--surface-solid-card);", ":var(--shadow-down-soft-s);", ":var(--plasma-colors-transparent);", ":var(--surface-transparent-secondary);", ":inherit;", ":inherit;", ":inherit;", ":inherit;", ":var(--text-primary);"], _Dropdown.dropdownTokens.disabledOpacity, _Dropdown.dropdownTokens.background, _Dropdown.dropdownTokens.boxShadow, _Dropdown.dropdownTokens.itemBackground, _Dropdown.dropdownTokens.itemBackgroundHover, _Dropdown.dropdownTokens.itemBackgroundSelected, _Dropdown.dropdownTokens.itemColorSelected, _Dropdown.dropdownTokens.itemBackgroundSelectedHover, _Dropdown.dropdownTokens.itemColorSelectedHover, _Dropdown.dropdownTokens.itemColor)
24
+ "default": /*#__PURE__*/(0, _styledComponents.css)(["", ":0.4;", ":var(--surface-accent);", ":var(--surface-solid-card);", ":var(--shadow-down-soft-s);", ":var(--plasma-colors-transparent);", ":var(--surface-transparent-secondary);", ":inherit;", ":inherit;", ":inherit;", ":inherit;", ":var(--text-primary);"], _Dropdown.dropdownTokens.disabledOpacity, _Dropdown.dropdownTokens.focusColor, _Dropdown.dropdownTokens.background, _Dropdown.dropdownTokens.boxShadow, _Dropdown.dropdownTokens.itemBackground, _Dropdown.dropdownTokens.itemBackgroundHover, _Dropdown.dropdownTokens.itemBackgroundSelected, _Dropdown.dropdownTokens.itemColorSelected, _Dropdown.dropdownTokens.itemBackgroundSelectedHover, _Dropdown.dropdownTokens.itemColorSelectedHover, _Dropdown.dropdownTokens.itemColor)
25
25
  }
26
26
  }
27
27
  };
@@ -92,7 +92,7 @@ const DisclosureRightIcon = (props) => (
92
92
  </StyledDisclosureRightIcon>
93
93
  );
94
94
 
95
- const StoryTight = (args: StoryDropdownProps) => {
95
+ const StoryNormal = (args: StoryDropdownProps) => {
96
96
  const [selected, setSelected] = useState('');
97
97
  const [isOpen, setIsOpen] = useState(false);
98
98
  const [isOpenDropdown2, setIsOpenDropdown2] = useState(false);
@@ -112,10 +112,10 @@ const StoryTight = (args: StoryDropdownProps) => {
112
112
  }
113
113
  };
114
114
 
115
- const handleSelect = (value: string, text: string) => {
115
+ const handleSelect = (value: string, text: string, toggleIsOpen: React.Dispatch<React.SetStateAction<boolean>>) => {
116
116
  setSelected(value);
117
117
  onSelect(value, text);
118
- setIsOpen(false);
118
+ toggleIsOpen(false);
119
119
  };
120
120
 
121
121
  return (
@@ -127,35 +127,51 @@ const StoryTight = (args: StoryDropdownProps) => {
127
127
  onToggle={onMainToggle}
128
128
  offset={[Number(skidding), Number(distance)]}
129
129
  placement={placement}
130
+ role="listbox"
130
131
  {...rest}
131
132
  >
132
133
  {getDropdownItems('item', 6).map((item) => (
133
134
  <DropdownItem
134
135
  key={item.value}
135
136
  isSelected={Boolean(item.value === selected)}
136
- onSelect={() => handleSelect(item.value, item.child)}
137
+ onSelect={() => handleSelect(item.value, item.child, setIsOpen)}
137
138
  onClick={onClick}
138
139
  value={item.value}
140
+ role="option"
139
141
  >
140
142
  {item.child}
141
143
  </DropdownItem>
142
144
  ))}
143
145
  <Dropdown
144
- target={<DropdownItem contentRight={DisclosureRightIcon} name="test" text="Nested dropdown" />}
146
+ target={
147
+ <DropdownItem
148
+ contentRight={DisclosureRightIcon}
149
+ role="option"
150
+ name="test"
151
+ text="Nested dropdown"
152
+ />
153
+ }
145
154
  onToggle={(is) => setIsOpenDropdown2(is)}
146
155
  isOpen={isOpenDropdown2}
156
+ role="listbox"
147
157
  offset={[0, 0]}
148
- isNested
149
158
  {...rest}
150
159
  >
151
- <DropdownItem contentRight={StyledCheckbox} value="checked" onChange={onChange} text="Checkbox" />
160
+ <DropdownItem
161
+ contentRight={StyledCheckbox}
162
+ role="option"
163
+ value="checked"
164
+ onChange={onChange}
165
+ text="Checkbox"
166
+ />
152
167
  {getDropdownItems('nested', 4).map((item) => (
153
168
  <DropdownItem
154
169
  key={item.value}
155
170
  isSelected={Boolean(item.value === selected)}
156
- onSelect={() => handleSelect(item.value, item.child)}
171
+ onSelect={() => handleSelect(item.value, item.child, setIsOpenDropdown2)}
157
172
  onClick={onClick}
158
173
  value={item.value}
174
+ role="option"
159
175
  >
160
176
  {item.child}
161
177
  </DropdownItem>
@@ -166,6 +182,7 @@ const StoryTight = (args: StoryDropdownProps) => {
166
182
  value="1"
167
183
  onChange={onChange}
168
184
  text="Radiobox 1"
185
+ role="option"
169
186
  />
170
187
  <DropdownItem
171
188
  contentLeft={StyledRadiobox}
@@ -173,14 +190,16 @@ const StoryTight = (args: StoryDropdownProps) => {
173
190
  value="2"
174
191
  onChange={onChange}
175
192
  text="Radiobox 2"
193
+ role="option"
176
194
  />
177
195
  </Dropdown>
178
196
 
179
197
  <DropdownItem
180
198
  isSelected={selected === 'disabled'}
181
- onSelect={() => handleSelect('disabled', 'disabled')}
199
+ onSelect={() => handleSelect('disabled', 'disabled', setIsOpen)}
182
200
  onClick={onClick}
183
201
  value="disabled"
202
+ role="option"
184
203
  disabled
185
204
  >
186
205
  disabled
@@ -190,6 +209,6 @@ const StoryTight = (args: StoryDropdownProps) => {
190
209
  );
191
210
  };
192
211
 
193
- export const Tight: StoryObj<StoryDropdownProps> = {
194
- render: (args) => <StoryTight {...args} />,
212
+ export const Normal: StoryObj<StoryDropdownProps> = {
213
+ render: (args) => <StoryNormal {...args} />,
195
214
  };
@@ -34,38 +34,13 @@ export const Default: Story = {
34
34
  };
35
35
 
36
36
  export const Accessibility: Story = {
37
- args: {
38
- role: 'button',
39
- name: 'Геннадий Силуянович',
40
- tabIndex: 0,
41
- view: 'default',
42
- size: 'xxl',
43
- status: 'active',
44
- focused: true,
45
- },
46
- };
47
-
48
- export const AccessibilityWithURL: Story = {
49
37
  args: {
50
38
  role: 'button',
51
39
  tabIndex: 0,
52
40
  view: 'default',
53
41
  size: 'xxl',
42
+ name: 'Иван Фадеев',
54
43
  status: 'active',
55
44
  focused: true,
56
- name: 'Микула Селянинович',
57
- url: 'https://avatars.githubusercontent.com/u/1813468?v=4',
58
- },
59
- };
60
-
61
- export const AccessibilityWithCustomText: Story = {
62
- args: {
63
- role: 'button',
64
- tabIndex: 0,
65
- view: 'default',
66
- size: 'xxl',
67
- status: 'inactive',
68
- focused: true,
69
- customText: 'ФИО',
70
45
  },
71
46
  };
@@ -21,7 +21,7 @@ var config = exports.config = {
21
21
  l: /*#__PURE__*/(0, _styledComponents.css)(["", ";", ";", ":1.0625rem;", ":1rem;", ":1.0625rem;", ":1rem;", ":0.75rem;", ":var(--plasma-typo-body-l-font-family);", ":var(--plasma-typo-body-l-font-size);", ":var(--plasma-typo-body-l-font-style);", ":var(--plasma-typo-body-l-font-weight);", ":var(--plasma-typo-body-l-letter-spacing);", ":var(--plasma-typo-body-l-line-height);"], dropdownSizeCommon, dropdownItemSizeCommon, _Dropdown.dropdownTokens.itemPaddingTop, _Dropdown.dropdownTokens.itemPaddingRight, _Dropdown.dropdownTokens.itemPaddingBottom, _Dropdown.dropdownTokens.itemPaddingLeft, _Dropdown.dropdownTokens.itemBorderRadius, _Dropdown.dropdownTokens.itemFontFamily, _Dropdown.dropdownTokens.itemFontSize, _Dropdown.dropdownTokens.itemFontStyle, _Dropdown.dropdownTokens.itemFontWeightBold, _Dropdown.dropdownTokens.itemFontLetterSpacing, _Dropdown.dropdownTokens.itemFontLineHeight)
22
22
  },
23
23
  view: {
24
- "default": /*#__PURE__*/(0, _styledComponents.css)(["", ":0.4;", ":var(--surface-solid-card);", ":var(--shadow-down-soft-s);", ":var(--plasma-colors-transparent);", ":var(--surface-transparent-secondary);", ":inherit;", ":inherit;", ":inherit;", ":inherit;", ":var(--text-primary);"], _Dropdown.dropdownTokens.disabledOpacity, _Dropdown.dropdownTokens.background, _Dropdown.dropdownTokens.boxShadow, _Dropdown.dropdownTokens.itemBackground, _Dropdown.dropdownTokens.itemBackgroundHover, _Dropdown.dropdownTokens.itemBackgroundSelected, _Dropdown.dropdownTokens.itemColorSelected, _Dropdown.dropdownTokens.itemBackgroundSelectedHover, _Dropdown.dropdownTokens.itemColorSelectedHover, _Dropdown.dropdownTokens.itemColor)
24
+ "default": /*#__PURE__*/(0, _styledComponents.css)(["", ":0.4;", ":var(--surface-accent);", ":var(--surface-solid-card);", ":var(--shadow-down-soft-s);", ":var(--plasma-colors-transparent);", ":var(--surface-transparent-secondary);", ":inherit;", ":inherit;", ":inherit;", ":inherit;", ":var(--text-primary);"], _Dropdown.dropdownTokens.disabledOpacity, _Dropdown.dropdownTokens.focusColor, _Dropdown.dropdownTokens.background, _Dropdown.dropdownTokens.boxShadow, _Dropdown.dropdownTokens.itemBackground, _Dropdown.dropdownTokens.itemBackgroundHover, _Dropdown.dropdownTokens.itemBackgroundSelected, _Dropdown.dropdownTokens.itemColorSelected, _Dropdown.dropdownTokens.itemBackgroundSelectedHover, _Dropdown.dropdownTokens.itemColorSelectedHover, _Dropdown.dropdownTokens.itemColor)
25
25
  }
26
26
  }
27
27
  };
@@ -112,10 +112,10 @@ const StoryNormal = (args: StoryDropdownProps) => {
112
112
  }
113
113
  };
114
114
 
115
- const handleSelect = (value: string, text: string) => {
115
+ const handleSelect = (value: string, text: string, toggleIsOpen: React.Dispatch<React.SetStateAction<boolean>>) => {
116
116
  setSelected(value);
117
117
  onSelect(value, text);
118
- setIsOpen(false);
118
+ toggleIsOpen(false);
119
119
  };
120
120
 
121
121
  return (
@@ -127,35 +127,51 @@ const StoryNormal = (args: StoryDropdownProps) => {
127
127
  onToggle={onMainToggle}
128
128
  offset={[Number(skidding), Number(distance)]}
129
129
  placement={placement}
130
+ role="listbox"
130
131
  {...rest}
131
132
  >
132
133
  {getDropdownItems('item', 6).map((item) => (
133
134
  <DropdownItem
134
135
  key={item.value}
135
136
  isSelected={Boolean(item.value === selected)}
136
- onSelect={() => handleSelect(item.value, item.child)}
137
+ onSelect={() => handleSelect(item.value, item.child, setIsOpen)}
137
138
  onClick={onClick}
138
139
  value={item.value}
140
+ role="option"
139
141
  >
140
142
  {item.child}
141
143
  </DropdownItem>
142
144
  ))}
143
145
  <Dropdown
144
- target={<DropdownItem contentRight={DisclosureRightIcon} name="test" text="Nested dropdown" />}
146
+ target={
147
+ <DropdownItem
148
+ contentRight={DisclosureRightIcon}
149
+ role="option"
150
+ name="test"
151
+ text="Nested dropdown"
152
+ />
153
+ }
145
154
  onToggle={(is) => setIsOpenDropdown2(is)}
146
155
  isOpen={isOpenDropdown2}
156
+ role="listbox"
147
157
  offset={[0, 0]}
148
- isNested
149
158
  {...rest}
150
159
  >
151
- <DropdownItem contentRight={StyledCheckbox} value="checked" onChange={onChange} text="Checkbox" />
160
+ <DropdownItem
161
+ contentRight={StyledCheckbox}
162
+ role="option"
163
+ value="checked"
164
+ onChange={onChange}
165
+ text="Checkbox"
166
+ />
152
167
  {getDropdownItems('nested', 4).map((item) => (
153
168
  <DropdownItem
154
169
  key={item.value}
155
170
  isSelected={Boolean(item.value === selected)}
156
- onSelect={() => handleSelect(item.value, item.child)}
171
+ onSelect={() => handleSelect(item.value, item.child, setIsOpenDropdown2)}
157
172
  onClick={onClick}
158
173
  value={item.value}
174
+ role="option"
159
175
  >
160
176
  {item.child}
161
177
  </DropdownItem>
@@ -166,6 +182,7 @@ const StoryNormal = (args: StoryDropdownProps) => {
166
182
  value="1"
167
183
  onChange={onChange}
168
184
  text="Radiobox 1"
185
+ role="option"
169
186
  />
170
187
  <DropdownItem
171
188
  contentLeft={StyledRadiobox}
@@ -173,14 +190,16 @@ const StoryNormal = (args: StoryDropdownProps) => {
173
190
  value="2"
174
191
  onChange={onChange}
175
192
  text="Radiobox 2"
193
+ role="option"
176
194
  />
177
195
  </Dropdown>
178
196
 
179
197
  <DropdownItem
180
198
  isSelected={selected === 'disabled'}
181
- onSelect={() => handleSelect('disabled', 'disabled')}
199
+ onSelect={() => handleSelect('disabled', 'disabled', setIsOpen)}
182
200
  onClick={onClick}
183
201
  value="disabled"
202
+ role="option"
184
203
  disabled
185
204
  >
186
205
  disabled
@@ -21,7 +21,7 @@ var config = exports.config = {
21
21
  l: /*#__PURE__*/(0, _styledComponents.css)(["", ";", ";", ":0.8125rem;", ":1rem;", ":0.8125rem;", ":1rem;", ":0.75rem;", ":var(--plasma-typo-body-l-font-family);", ":var(--plasma-typo-body-l-font-size);", ":var(--plasma-typo-body-l-font-style);", ":var(--plasma-typo-body-l-font-weight);", ":var(--plasma-typo-body-l-letter-spacing);", ":var(--plasma-typo-body-l-line-height);"], dropdownSizeCommon, dropdownItemSizeCommon, _Dropdown.dropdownTokens.itemPaddingTop, _Dropdown.dropdownTokens.itemPaddingRight, _Dropdown.dropdownTokens.itemPaddingBottom, _Dropdown.dropdownTokens.itemPaddingLeft, _Dropdown.dropdownTokens.itemBorderRadius, _Dropdown.dropdownTokens.itemFontFamily, _Dropdown.dropdownTokens.itemFontSize, _Dropdown.dropdownTokens.itemFontStyle, _Dropdown.dropdownTokens.itemFontWeightBold, _Dropdown.dropdownTokens.itemFontLetterSpacing, _Dropdown.dropdownTokens.itemFontLineHeight)
22
22
  },
23
23
  view: {
24
- "default": /*#__PURE__*/(0, _styledComponents.css)(["", ":0.4;", ":var(--surface-solid-card);", ":var(--shadow-down-soft-s);", ":var(--plasma-colors-transparent);", ":var(--surface-transparent-secondary);", ":inherit;", ":inherit;", ":inherit;", ":inherit;", ":var(--text-primary);"], _Dropdown.dropdownTokens.disabledOpacity, _Dropdown.dropdownTokens.background, _Dropdown.dropdownTokens.boxShadow, _Dropdown.dropdownTokens.itemBackground, _Dropdown.dropdownTokens.itemBackgroundHover, _Dropdown.dropdownTokens.itemBackgroundSelected, _Dropdown.dropdownTokens.itemColorSelected, _Dropdown.dropdownTokens.itemBackgroundSelectedHover, _Dropdown.dropdownTokens.itemColorSelectedHover, _Dropdown.dropdownTokens.itemColor)
24
+ "default": /*#__PURE__*/(0, _styledComponents.css)(["", ":0.4;", ":var(--surface-accent);", ":var(--surface-solid-card);", ":var(--shadow-down-soft-s);", ":var(--plasma-colors-transparent);", ":var(--surface-transparent-secondary);", ":inherit;", ":inherit;", ":inherit;", ":inherit;", ":var(--text-primary);"], _Dropdown.dropdownTokens.disabledOpacity, _Dropdown.dropdownTokens.focusColor, _Dropdown.dropdownTokens.background, _Dropdown.dropdownTokens.boxShadow, _Dropdown.dropdownTokens.itemBackground, _Dropdown.dropdownTokens.itemBackgroundHover, _Dropdown.dropdownTokens.itemBackgroundSelected, _Dropdown.dropdownTokens.itemColorSelected, _Dropdown.dropdownTokens.itemBackgroundSelectedHover, _Dropdown.dropdownTokens.itemColorSelectedHover, _Dropdown.dropdownTokens.itemColor)
25
25
  }
26
26
  }
27
27
  };
@@ -92,7 +92,7 @@ const DisclosureRightIcon = (props) => (
92
92
  </StyledDisclosureRightIcon>
93
93
  );
94
94
 
95
- const StoryTight = (args: StoryDropdownProps) => {
95
+ const StoryNormal = (args: StoryDropdownProps) => {
96
96
  const [selected, setSelected] = useState('');
97
97
  const [isOpen, setIsOpen] = useState(false);
98
98
  const [isOpenDropdown2, setIsOpenDropdown2] = useState(false);
@@ -112,10 +112,10 @@ const StoryTight = (args: StoryDropdownProps) => {
112
112
  }
113
113
  };
114
114
 
115
- const handleSelect = (value: string, text: string) => {
115
+ const handleSelect = (value: string, text: string, toggleIsOpen: React.Dispatch<React.SetStateAction<boolean>>) => {
116
116
  setSelected(value);
117
117
  onSelect(value, text);
118
- setIsOpen(false);
118
+ toggleIsOpen(false);
119
119
  };
120
120
 
121
121
  return (
@@ -127,35 +127,51 @@ const StoryTight = (args: StoryDropdownProps) => {
127
127
  onToggle={onMainToggle}
128
128
  offset={[Number(skidding), Number(distance)]}
129
129
  placement={placement}
130
+ role="listbox"
130
131
  {...rest}
131
132
  >
132
133
  {getDropdownItems('item', 6).map((item) => (
133
134
  <DropdownItem
134
135
  key={item.value}
135
136
  isSelected={Boolean(item.value === selected)}
136
- onSelect={() => handleSelect(item.value, item.child)}
137
+ onSelect={() => handleSelect(item.value, item.child, setIsOpen)}
137
138
  onClick={onClick}
138
139
  value={item.value}
140
+ role="option"
139
141
  >
140
142
  {item.child}
141
143
  </DropdownItem>
142
144
  ))}
143
145
  <Dropdown
144
- target={<DropdownItem contentRight={DisclosureRightIcon} name="test" text="Nested dropdown" />}
146
+ target={
147
+ <DropdownItem
148
+ contentRight={DisclosureRightIcon}
149
+ role="option"
150
+ name="test"
151
+ text="Nested dropdown"
152
+ />
153
+ }
145
154
  onToggle={(is) => setIsOpenDropdown2(is)}
146
155
  isOpen={isOpenDropdown2}
156
+ role="listbox"
147
157
  offset={[0, 0]}
148
- isNested
149
158
  {...rest}
150
159
  >
151
- <DropdownItem contentRight={StyledCheckbox} value="checked" onChange={onChange} text="Checkbox" />
160
+ <DropdownItem
161
+ contentRight={StyledCheckbox}
162
+ role="option"
163
+ value="checked"
164
+ onChange={onChange}
165
+ text="Checkbox"
166
+ />
152
167
  {getDropdownItems('nested', 4).map((item) => (
153
168
  <DropdownItem
154
169
  key={item.value}
155
170
  isSelected={Boolean(item.value === selected)}
156
- onSelect={() => handleSelect(item.value, item.child)}
171
+ onSelect={() => handleSelect(item.value, item.child, setIsOpenDropdown2)}
157
172
  onClick={onClick}
158
173
  value={item.value}
174
+ role="option"
159
175
  >
160
176
  {item.child}
161
177
  </DropdownItem>
@@ -166,6 +182,7 @@ const StoryTight = (args: StoryDropdownProps) => {
166
182
  value="1"
167
183
  onChange={onChange}
168
184
  text="Radiobox 1"
185
+ role="option"
169
186
  />
170
187
  <DropdownItem
171
188
  contentLeft={StyledRadiobox}
@@ -173,14 +190,16 @@ const StoryTight = (args: StoryDropdownProps) => {
173
190
  value="2"
174
191
  onChange={onChange}
175
192
  text="Radiobox 2"
193
+ role="option"
176
194
  />
177
195
  </Dropdown>
178
196
 
179
197
  <DropdownItem
180
198
  isSelected={selected === 'disabled'}
181
- onSelect={() => handleSelect('disabled', 'disabled')}
199
+ onSelect={() => handleSelect('disabled', 'disabled', setIsOpen)}
182
200
  onClick={onClick}
183
201
  value="disabled"
202
+ role="option"
184
203
  disabled
185
204
  >
186
205
  disabled
@@ -190,6 +209,6 @@ const StoryTight = (args: StoryDropdownProps) => {
190
209
  );
191
210
  };
192
211
 
193
- export const Tight: StoryObj<StoryDropdownProps> = {
194
- render: (args) => <StoryTight {...args} />,
212
+ export const Normal: StoryObj<StoryDropdownProps> = {
213
+ render: (args) => <StoryNormal {...args} />,
195
214
  };
@@ -30,36 +30,10 @@ export const Default: Story = {
30
30
  export const Accessibility: Story = {
31
31
  args: {
32
32
  role: 'button',
33
- name: 'Геннадий Силуянович',
34
33
  tabIndex: 0,
35
34
  view: 'default',
36
35
  size: 'xxl',
37
- status: 'active',
38
- focused: true,
39
- },
40
- };
41
-
42
- export const AccessibilityWithURL: Story = {
43
- args: {
44
- role: 'button',
45
- tabIndex: 0,
46
- view: 'default',
47
- size: 'xxl',
48
- status: 'active',
49
- focused: true,
50
- name: 'Микула Селянинович',
51
- url: 'https://avatars.githubusercontent.com/u/1813468?v=4',
52
- },
53
- };
54
-
55
- export const AccessibilityWithCustomText: Story = {
56
- args: {
57
- role: 'button',
58
- tabIndex: 0,
59
- view: 'default',
60
- size: 'xxl',
61
- status: 'inactive',
36
+ name: 'Иван Фадеев',
62
37
  focused: true,
63
- customText: 'ФИО',
64
38
  },
65
39
  };
@@ -1,11 +1,5 @@
1
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- var _excluded = ["size", "name", "url", "customText", "status", "className", "focused", "isScalable", "statusDict"];
1
+ var _excluded = ["size", "name", "url", "customText", "status", "className", "focused", "isScalable"];
3
2
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
7
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
8
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
9
3
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
10
4
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
11
5
  import React, { forwardRef, useMemo } from 'react';
@@ -18,10 +12,6 @@ import { base, Wrapper, Image, StatusIcon, Text } from './Avatar.styles';
18
12
  import { base as viewCSS } from './variations/_size/base';
19
13
  import { base as focusedCSS } from './variations/_focused/base';
20
14
  import { getInitialsForName } from './utils';
21
- var StatusDictDefault = {
22
- active: 'Активен',
23
- inactive: 'Неактивен'
24
- };
25
15
  var getAvatarContent = function getAvatarContent(_ref) {
26
16
  var customText = _ref.customText,
27
17
  url = _ref.url,
@@ -38,27 +28,6 @@ var getAvatarContent = function getAvatarContent(_ref) {
38
28
  }
39
29
  return /*#__PURE__*/React.createElement(Text, null, initials);
40
30
  };
41
- var getAriaLabel = function getAriaLabel(props) {
42
- var customText = props.customText,
43
- url = props.url,
44
- name = props.name,
45
- status = props.status,
46
- ariaLabelProp = props['aria-label'],
47
- role = props.role,
48
- statusDict = props.statusDict;
49
-
50
- // INFO: В этих сценариях aria-label не нужен
51
- if (customText || !role || role !== 'button') {
52
- return undefined;
53
- }
54
-
55
- // INFO: включаем aria-label чтобы озвучить что на изображении
56
- if (url) {
57
- var ariaLabel = !ariaLabelProp || ariaLabelProp.trim() === '' ? name : ariaLabelProp;
58
- return status ? "".concat(ariaLabel, ". ").concat(statusDict[status]) : ariaLabel;
59
- }
60
- return undefined;
61
- };
62
31
  var mergedConfig = /*#__PURE__*/mergeConfig(indicatorConfig);
63
32
  var Indicator = /*#__PURE__*/component(mergedConfig);
64
33
  var StyledIndicator = /*#__PURE__*/styled(Indicator).withConfig({
@@ -78,22 +47,14 @@ export var avatarRoot = function avatarRoot(Root) {
78
47
  _props$focused = props.focused,
79
48
  focused = _props$focused === void 0 ? true : _props$focused,
80
49
  isScalable = props.isScalable,
81
- _props$statusDict = props.statusDict,
82
- statusDict = _props$statusDict === void 0 ? StatusDictDefault : _props$statusDict,
83
50
  rest = _objectWithoutProperties(props, _excluded);
84
51
  var initials = useMemo(function () {
85
52
  return getInitialsForName(name);
86
53
  }, [name]);
87
- var ariaLabel = useMemo(function () {
88
- return getAriaLabel(_objectSpread(_objectSpread({}, props), {}, {
89
- statusDict: statusDict
90
- }));
91
- }, [name, url, rest.role, status, customText, statusDict, rest['aria-label']]);
92
54
  return /*#__PURE__*/React.createElement(Root, _extends({
93
55
  ref: ref,
94
56
  size: avatarSize,
95
57
  className: cx(classes.avatarItem, className),
96
- "aria-label": ariaLabel,
97
58
  focused: focused
98
59
  }, rest), /*#__PURE__*/React.createElement(Wrapper, {
99
60
  isScalable: isScalable
@@ -103,7 +64,6 @@ export var avatarRoot = function avatarRoot(Root) {
103
64
  initials: initials,
104
65
  name: name
105
66
  })), status && /*#__PURE__*/React.createElement(StatusIcon, null, /*#__PURE__*/React.createElement(StyledIndicator, {
106
- "aria-label": statusDict[status],
107
67
  status: status
108
68
  })));
109
69
  });