@cloudscape-design/components 3.0.908 → 3.0.909

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.
@@ -1 +1 @@
1
- {"version":3,"file":"options-list.d.ts","sourceRoot":"","sources":["../../../src/autosuggest/options-list.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAIvF,UAAU,2BACR,SAAQ,IAAI,CAAC,gBAAgB,EAAE,eAAe,GAAG,mBAAmB,GAAG,2BAA2B,CAAC;IACnG,UAAU,EAAE,gBAAgB,CAAC,UAAU,CAAC;IACxC,qBAAqB,EAAE,qBAAqB,CAAC;IAC7C,wBAAwB,EAAE,wBAAwB,CAAC;IACnD,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AASD,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,EAC7C,UAAU,EACV,qBAAqB,EACrB,wBAAwB,EACxB,mBAAmB,EACnB,aAAa,EACb,MAAM,EACN,SAAS,EACT,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,yBAAyB,EACzB,UAAU,EACV,eAAe,GAChB,EAAE,2BAA2B,eAiC7B"}
1
+ {"version":3,"file":"options-list.d.ts","sourceRoot":"","sources":["../../../src/autosuggest/options-list.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAIvF,UAAU,2BACR,SAAQ,IAAI,CAAC,gBAAgB,EAAE,eAAe,GAAG,mBAAmB,GAAG,2BAA2B,CAAC;IACnG,UAAU,EAAE,gBAAgB,CAAC,UAAU,CAAC;IACxC,qBAAqB,EAAE,qBAAqB,CAAC;IAC7C,wBAAwB,EAAE,wBAAwB,CAAC;IACnD,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AASD,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,EAC7C,UAAU,EACV,qBAAqB,EACrB,wBAAwB,EACxB,mBAAmB,EACnB,aAAa,EACb,MAAM,EACN,SAAS,EACT,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,yBAAyB,EACzB,UAAU,EACV,eAAe,GAChB,EAAE,2BAA2B,eAkC7B"}
@@ -16,6 +16,7 @@ export default function AutosuggestOptionsList({ statusType, autosuggestItemsSta
16
16
  const handleMouseMove = createMouseEventHandler(autosuggestItemsHandlers.highlightVisibleOptionWithMouse);
17
17
  const ListComponent = virtualScroll ? VirtualList : PlainList;
18
18
  const announcement = useAnnouncement({
19
+ highlightText,
19
20
  announceSelected: ((_a = autosuggestItemsState.highlightedOption) === null || _a === void 0 ? void 0 : _a.value) === highlightText,
20
21
  highlightedOption: autosuggestItemsState.highlightedOption,
21
22
  getParent: option => autosuggestItemsState.getItemGroup(option),
@@ -1 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AEH,OAAO,CACL,oBAAC,aAAa,IACZ,UAAU,EAAE,UAAU,EACtB,cAAc,EAAE,cAAc,EAC9B,qBAAqB,EAAE,qBAAqB,EAC5C,aAAa,EAAE,aAAa,EAC5B,oBAAoB,EAAE,mBAAmB,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,mBAAmB,EAAE,CAAC,CAAC,CAAC,EAAE,EAC5E,iBAAiB,EAAE,iBAAiB,EACpC,SAAS,EAAE;YACT,EAAE,EAAE,MAAM;YACV,cAAc,EAAE,SAAS;YACzB,SAAS,EAAE,aAAa;YACxB,WAAW,EAAE,eAAe;YAC5B,eAAe;YACf,UAAU;SACX,EACD,mBAAmB,EAAE,YAAY,GACjC,CACH,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { useAnnouncement } from '../select/utils/use-announcement';\nimport { AutosuggestProps } from './interfaces';\nimport { AutosuggestItemsHandlers, AutosuggestItemsState } from './options-controller';\nimport PlainList from './plain-list';\nimport VirtualList from './virtual-list';\n\ninterface AutosuggestOptionsListProps\n extends Pick<AutosuggestProps, 'virtualScroll' | 'selectedAriaLabel' | 'renderHighlightedAriaLive'> {\n statusType: AutosuggestProps.StatusType;\n autosuggestItemsState: AutosuggestItemsState;\n autosuggestItemsHandlers: AutosuggestItemsHandlers;\n highlightedOptionId?: string;\n highlightText: string;\n listId: string;\n controlId: string;\n handleLoadMore: () => void;\n hasDropdownStatus?: boolean;\n listBottom?: React.ReactNode;\n ariaDescribedby?: string;\n}\n\nconst createMouseEventHandler = (handler: (index: number) => void) => (itemIndex: number) => {\n // prevent mouse events to avoid losing focus from the input\n if (itemIndex > -1) {\n handler(itemIndex);\n }\n};\n\nexport default function AutosuggestOptionsList({\n statusType,\n autosuggestItemsState,\n autosuggestItemsHandlers,\n highlightedOptionId,\n highlightText,\n listId,\n controlId,\n handleLoadMore,\n hasDropdownStatus,\n virtualScroll,\n selectedAriaLabel,\n renderHighlightedAriaLive,\n listBottom,\n ariaDescribedby,\n}: AutosuggestOptionsListProps) {\n const handleMouseUp = createMouseEventHandler(autosuggestItemsHandlers.selectVisibleOptionWithMouse);\n const handleMouseMove = createMouseEventHandler(autosuggestItemsHandlers.highlightVisibleOptionWithMouse);\n\n const ListComponent = virtualScroll ? VirtualList : PlainList;\n\n const announcement = useAnnouncement({\n announceSelected: autosuggestItemsState.highlightedOption?.value === highlightText,\n highlightedOption: autosuggestItemsState.highlightedOption,\n getParent: option => autosuggestItemsState.getItemGroup(option),\n selectedAriaLabel,\n renderHighlightedAriaLive,\n });\n\n return (\n <ListComponent\n listBottom={listBottom}\n handleLoadMore={handleLoadMore}\n autosuggestItemsState={autosuggestItemsState}\n highlightText={highlightText}\n highlightedA11yProps={highlightedOptionId ? { id: highlightedOptionId } : {}}\n hasDropdownStatus={hasDropdownStatus}\n menuProps={{\n id: listId,\n ariaLabelledby: controlId,\n onMouseUp: handleMouseUp,\n onMouseMove: handleMouseMove,\n ariaDescribedby,\n statusType,\n }}\n screenReaderContent={announcement}\n />\n );\n}\n"]}
1
+ {"version":3,"file":"options-list.js","sourceRoot":"","sources":["../../../src/autosuggest/options-list.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAGnE,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,WAAW,MAAM,gBAAgB,CAAC;AAiBzC,MAAM,uBAAuB,GAAG,CAAC,OAAgC,EAAE,EAAE,CAAC,CAAC,SAAiB,EAAE,EAAE;IAC1F,4DAA4D;IAC5D,IAAI,SAAS,GAAG,CAAC,CAAC,EAAE;QAClB,OAAO,CAAC,SAAS,CAAC,CAAC;KACpB;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,EAC7C,UAA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identifier: Apache-2.0\nimport React from 'react';\n\nimport { useAnnouncement } from '../select/utils/use-announcement';\nimport { AutosuggestProps } from './interfaces';\nimport { AutosuggestItemsHandlers, AutosuggestItemsState } from './options-controller';\nimport PlainList from './plain-list';\nimport VirtualList from './virtual-list';\n\ninterface AutosuggestOptionsListProps\n extends Pick<AutosuggestProps, 'virtualScroll' | 'selectedAriaLabel' | 'renderHighlightedAriaLive'> {\n statusType: AutosuggestProps.StatusType;\n autosuggestItemsState: AutosuggestItemsState;\n autosuggestItemsHandlers: AutosuggestItemsHandlers;\n highlightedOptionId?: string;\n highlightText: string;\n listId: string;\n controlId: string;\n handleLoadMore: () => void;\n hasDropdownStatus?: boolean;\n listBottom?: React.ReactNode;\n ariaDescribedby?: string;\n}\n\nconst createMouseEventHandler = (handler: (index: number) => void) => (itemIndex: number) => {\n // prevent mouse events to avoid losing focus from the input\n if (itemIndex > -1) {\n handler(itemIndex);\n }\n};\n\nexport default function AutosuggestOptionsList({\n statusType,\n autosuggestItemsState,\n autosuggestItemsHandlers,\n highlightedOptionId,\n highlightText,\n listId,\n controlId,\n handleLoadMore,\n hasDropdownStatus,\n virtualScroll,\n selectedAriaLabel,\n renderHighlightedAriaLive,\n listBottom,\n ariaDescribedby,\n}: AutosuggestOptionsListProps) {\n const handleMouseUp = createMouseEventHandler(autosuggestItemsHandlers.selectVisibleOptionWithMouse);\n const handleMouseMove = createMouseEventHandler(autosuggestItemsHandlers.highlightVisibleOptionWithMouse);\n\n const ListComponent = virtualScroll ? VirtualList : PlainList;\n\n const announcement = useAnnouncement({\n highlightText,\n announceSelected: autosuggestItemsState.highlightedOption?.value === highlightText,\n highlightedOption: autosuggestItemsState.highlightedOption,\n getParent: option => autosuggestItemsState.getItemGroup(option),\n selectedAriaLabel,\n renderHighlightedAriaLive,\n });\n\n return (\n <ListComponent\n listBottom={listBottom}\n handleLoadMore={handleLoadMore}\n autosuggestItemsState={autosuggestItemsState}\n highlightText={highlightText}\n highlightedA11yProps={highlightedOptionId ? { id: highlightedOptionId } : {}}\n hasDropdownStatus={hasDropdownStatus}\n menuProps={{\n id: listId,\n ariaLabelledby: controlId,\n onMouseUp: handleMouseUp,\n onMouseMove: handleMouseMove,\n ariaDescribedby,\n statusType,\n }}\n screenReaderContent={announcement}\n />\n );\n}\n"]}
@@ -1,4 +1,9 @@
1
1
  import { OptionDefinition, OptionGroup } from './interfaces';
2
- declare function defaultOptionDescription(option: OptionDefinition, parentGroup: OptionGroup | undefined): string;
2
+ interface DefaultOptionDescriptionProps {
3
+ option: OptionDefinition;
4
+ parentGroup?: OptionGroup;
5
+ highlightText?: string;
6
+ }
7
+ declare function defaultOptionDescription({ option, parentGroup, highlightText }: DefaultOptionDescriptionProps): string;
3
8
  export default defaultOptionDescription;
4
9
  //# sourceMappingURL=option-announcer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"option-announcer.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/option/option-announcer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE7D,iBAAS,wBAAwB,CAAC,MAAM,EAAE,gBAAgB,EAAE,WAAW,EAAE,WAAW,GAAG,SAAS,UAW/F;AAED,eAAe,wBAAwB,CAAC"}
1
+ {"version":3,"file":"option-announcer.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/option/option-announcer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAG7D,UAAU,6BAA6B;IACrC,MAAM,EAAE,gBAAgB,CAAC;IACzB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAUD,iBAAS,wBAAwB,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,EAAE,6BAA6B,UAYtG;AAED,eAAe,wBAAwB,CAAC"}
@@ -1,4 +1,11 @@
1
- function defaultOptionDescription(option, parentGroup) {
1
+ import { matchesString } from './utils/filter-options';
2
+ function getMatchingFilteringTags(filteringTags, highlightText) {
3
+ if (!highlightText || !filteringTags) {
4
+ return [];
5
+ }
6
+ return filteringTags.filter(filteringTag => matchesString(filteringTag, highlightText, false));
7
+ }
8
+ function defaultOptionDescription({ option, parentGroup, highlightText }) {
2
9
  return [
3
10
  parentGroup && parentGroup.label,
4
11
  option.__labelPrefix,
@@ -7,6 +14,7 @@ function defaultOptionDescription(option, parentGroup) {
7
14
  option.labelTag,
8
15
  ]
9
16
  .concat(option.tags)
17
+ .concat(getMatchingFilteringTags(option.filteringTags, highlightText))
10
18
  .filter(el => !!el)
11
19
  .join(' ');
12
20
  }
@@ -1 +1 @@
1
- {"version":3,"file":"option-announcer.js","sourceRoot":"","sources":["../../../../../src/internal/components/option/option-announcer.ts"],"names":[],"mappings":"AAIA,SAAS,wBAAwB,CAAC,MAAwB,EAAE,WAAoC;IAC9F,OAAO;QACL,WAAW,IAAI,WAAW,CAAC,KAAK;QAChC,MAAM,CAAC,aAAa;QACpB,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,KAAK;QAC5B,MAAM,CAAC,WAAW;QAClB,MAAM,CAAC,QAAQ;KAChB;SACE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;SACnB,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAClB,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC;AAED,eAAe,wBAAwB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { OptionDefinition, OptionGroup } from './interfaces';\n\nfunction defaultOptionDescription(option: OptionDefinition, parentGroup: OptionGroup | undefined) {\n return [\n parentGroup && parentGroup.label,\n option.__labelPrefix,\n option.label || option.value,\n option.description,\n option.labelTag,\n ]\n .concat(option.tags)\n .filter(el => !!el)\n .join(' ');\n}\n\nexport default defaultOptionDescription;\n"]}
1
+ {"version":3,"file":"option-announcer.js","sourceRoot":"","sources":["../../../../../src/internal/components/option/option-announcer.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAQvD,SAAS,wBAAwB,CAAC,aAAiC,EAAE,aAAsB;IACzF,IAAI,CAAC,aAAa,IAAI,CAAC,aAAa,EAAE;QACpC,OAAO,EAAE,CAAC;KACX;IAED,OAAO,aAAa,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC,aAAa,CAAC,YAAY,EAAE,aAAa,EAAE,KAAK,CAAC,CAAC,CAAC;AACjG,CAAC;AAED,SAAS,wBAAwB,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,aAAa,EAAiC;IACrG,OAAO;QACL,WAAW,IAAI,WAAW,CAAC,KAAK;QAChC,MAAM,CAAC,aAAa;QACpB,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,KAAK;QAC5B,MAAM,CAAC,WAAW;QAClB,MAAM,CAAC,QAAQ;KAChB;SACE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;SACnB,MAAM,CAAC,wBAAwB,CAAC,MAAM,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;SACrE,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAClB,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC;AAED,eAAe,wBAAwB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { OptionDefinition, OptionGroup } from './interfaces';\nimport { matchesString } from './utils/filter-options';\n\ninterface DefaultOptionDescriptionProps {\n option: OptionDefinition;\n parentGroup?: OptionGroup;\n highlightText?: string;\n}\n\nfunction getMatchingFilteringTags(filteringTags?: readonly string[], highlightText?: string): string[] {\n if (!highlightText || !filteringTags) {\n return [];\n }\n\n return filteringTags.filter(filteringTag => matchesString(filteringTag, highlightText, false));\n}\n\nfunction defaultOptionDescription({ option, parentGroup, highlightText }: DefaultOptionDescriptionProps) {\n return [\n parentGroup && parentGroup.label,\n option.__labelPrefix,\n option.label || option.value,\n option.description,\n option.labelTag,\n ]\n .concat(option.tags)\n .concat(getMatchingFilteringTags(option.filteringTags, highlightText))\n .filter(el => !!el)\n .join(' ');\n}\n\nexport default defaultOptionDescription;\n"]}
@@ -1,4 +1,4 @@
1
1
  export var PACKAGE_SOURCE = "components";
2
- export var PACKAGE_VERSION = "3.0.0 (06e47df8)";
2
+ export var PACKAGE_VERSION = "3.0.0 (ca702403)";
3
3
  export var THEME = "open-source-visual-refresh";
4
4
  export var ALWAYS_VISUAL_REFRESH = true;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "PACKAGE_SOURCE": "components",
3
- "PACKAGE_VERSION": "3.0.0 (06e47df8)",
3
+ "PACKAGE_VERSION": "3.0.0 (ca702403)",
4
4
  "THEME": "default",
5
5
  "ALWAYS_VISUAL_REFRESH": false
6
6
  }
@@ -1,3 +1,3 @@
1
1
  {
2
- "commit": "06e47df82b5844795ade3b9916906e6445f45b2c"
2
+ "commit": "ca7024038c115c28b1d1b464c8d9e0a2b9a1a838"
3
3
  }
package/package.json CHANGED
@@ -132,7 +132,7 @@
132
132
  "./internal/base-component/index.js",
133
133
  "./internal/base-component/styles.css.js"
134
134
  ],
135
- "version": "3.0.908",
135
+ "version": "3.0.909",
136
136
  "repository": {
137
137
  "type": "git",
138
138
  "url": "https://github.com/cloudscape-design/components.git"
@@ -9,7 +9,8 @@ interface OptionHolder {
9
9
  *
10
10
  * If the testing reveals no issues with the native announcements the live-region can be removed.
11
11
  */
12
- export declare function useAnnouncement<Option extends OptionHolder>({ announceSelected, highlightedOption, getParent, selectedAriaLabel, renderHighlightedAriaLive, }: {
12
+ export declare function useAnnouncement<Option extends OptionHolder>({ highlightText, announceSelected, highlightedOption, getParent, selectedAriaLabel, renderHighlightedAriaLive, }: {
13
+ highlightText?: string;
13
14
  announceSelected: boolean;
14
15
  highlightedOption?: Option;
15
16
  getParent: (option: Option) => undefined | OptionGroup;
@@ -1 +1 @@
1
- {"version":3,"file":"use-announcement.d.ts","sourceRoot":"","sources":["../../../../src/select/utils/use-announcement.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAE5F,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,UAAU,YAAY;IACpB,MAAM,CAAC,EAAE,gBAAgB,GAAG,WAAW,CAAC;CACzC;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,MAAM,SAAS,YAAY,EAAE,EAC3D,gBAAgB,EAChB,iBAAiB,EACjB,SAAS,EACT,iBAAiB,EACjB,yBAAyB,GAC1B,EAAE;IACD,gBAAgB,EAAE,OAAO,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,SAAS,GAAG,WAAW,CAAC;IACvD,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,yBAAyB,CAAC,EAAE,WAAW,CAAC,8BAA8B,CAAC;CACxE,UA+BA"}
1
+ {"version":3,"file":"use-announcement.d.ts","sourceRoot":"","sources":["../../../../src/select/utils/use-announcement.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAE5F,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,UAAU,YAAY;IACpB,MAAM,CAAC,EAAE,gBAAgB,GAAG,WAAW,CAAC;CACzC;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,MAAM,SAAS,YAAY,EAAE,EAC3D,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,SAAS,EACT,iBAAiB,EACjB,yBAAyB,GAC1B,EAAE;IACD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,SAAS,GAAG,WAAW,CAAC;IACvD,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,yBAAyB,CAAC,EAAE,WAAW,CAAC,8BAA8B,CAAC;CACxE,UA+BA"}
@@ -8,7 +8,7 @@ import defaultOptionDescription from '../../internal/components/option/option-an
8
8
  *
9
9
  * If the testing reveals no issues with the native announcements the live-region can be removed.
10
10
  */
11
- export function useAnnouncement({ announceSelected, highlightedOption, getParent, selectedAriaLabel, renderHighlightedAriaLive, }) {
11
+ export function useAnnouncement({ highlightText, announceSelected, highlightedOption, getParent, selectedAriaLabel, renderHighlightedAriaLive, }) {
12
12
  const prevAnnouncedGroup = useRef(undefined);
13
13
  // Record previously announced group with a delay to account for possible re-renders of the hook.
14
14
  useEffect(() => {
@@ -32,7 +32,7 @@ export function useAnnouncement({ announceSelected, highlightedOption, getParent
32
32
  }
33
33
  // Use default renderer with selected ARIA label if defined and relevant.
34
34
  const selectedAnnouncement = announceSelected && selectedAriaLabel ? selectedAriaLabel : '';
35
- const defaultDescription = defaultOptionDescription(option, group);
35
+ const defaultDescription = defaultOptionDescription({ option, parentGroup: group, highlightText });
36
36
  return [selectedAnnouncement, defaultDescription].filter(Boolean).join(' ');
37
37
  }
38
38
  //# sourceMappingURL=use-announcement.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-announcement.js","sourceRoot":"","sources":["../../../../src/select/utils/use-announcement.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAG1C,OAAO,wBAAwB,MAAM,mDAAmD,CAAC;AAOzF;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAA8B,EAC3D,gBAAgB,EAChB,iBAAiB,EACjB,SAAS,EACT,iBAAiB,EACjB,yBAAyB,GAO1B;IACC,MAAM,kBAAkB,GAAG,MAAM,CAA0B,SAAS,CAAC,CAAC;IAEtE,iGAAiG;IACjG,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,iBAAiB,EAAE;YACrB,MAAM,OAAO,GAAG,qBAAqB,CAAC,GAAG,EAAE;gBACzC,kBAAkB,CAAC,OAAO,GAAG,SAAS,CAAC,iBAAiB,CAAC,CAAC;YAC5D,CAAC,CAAC,CAAC;YACH,OAAO,GAAG,EAAE,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;SAC5C;IACH,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,iBAAiB,EAAE;QACtB,OAAO,EAAE,CAAC;KACX;IAED,MAAM,MAAM,GAAG,iBAAiB,CAAC,MAA0B,CAAC;IAC5D,MAAM,MAAM,GAAG,SAAS,CAAC,iBAAiB,CAAC,CAAC;IAC5C,0EAA0E;IAC1E,MAAM,KAAK,GAAG,MAAM,IAAI,MAAM,KAAK,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IAEnF,mCAAmC;IACnC,IAAI,yBAAyB,EAAE;QAC7B,OAAO,yBAAyB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;KACjD;IAED,yEAAyE;IACzE,MAAM,oBAAoB,GAAG,gBAAgB,IAAI,iBAAiB,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,CAAC;IAC5F,MAAM,kBAAkB,GAAG,wBAAwB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACnE,OAAO,CAAC,oBAAoB,EAAE,kBAAkB,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC9E,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useEffect, useRef } from 'react';\n\nimport { OptionDefinition, OptionGroup } from '../../internal/components/option/interfaces';\nimport defaultOptionDescription from '../../internal/components/option/option-announcer';\nimport { SelectProps } from '../interfaces';\n\ninterface OptionHolder {\n option?: OptionDefinition | OptionGroup;\n}\n\n/**\n * The hook produces the live region string to be announced when an option is highlighted.\n * This is a workaround to account for the issues with assistive technologies.\n *\n * If the testing reveals no issues with the native announcements the live-region can be removed.\n */\nexport function useAnnouncement<Option extends OptionHolder>({\n announceSelected,\n highlightedOption,\n getParent,\n selectedAriaLabel,\n renderHighlightedAriaLive,\n}: {\n announceSelected: boolean;\n highlightedOption?: Option;\n getParent: (option: Option) => undefined | OptionGroup;\n selectedAriaLabel?: string;\n renderHighlightedAriaLive?: SelectProps.ContainingOptionAndGroupString;\n}) {\n const prevAnnouncedGroup = useRef<OptionGroup | undefined>(undefined);\n\n // Record previously announced group with a delay to account for possible re-renders of the hook.\n useEffect(() => {\n if (highlightedOption) {\n const frameId = requestAnimationFrame(() => {\n prevAnnouncedGroup.current = getParent(highlightedOption);\n });\n return () => cancelAnimationFrame(frameId);\n }\n });\n\n if (!highlightedOption) {\n return '';\n }\n\n const option = highlightedOption.option as OptionDefinition;\n const parent = getParent(highlightedOption);\n // Only announce parent group if it wasn't announced with previous option.\n const group = parent && parent !== prevAnnouncedGroup.current ? parent : undefined;\n\n // Use custom renderer if provided.\n if (renderHighlightedAriaLive) {\n return renderHighlightedAriaLive(option, group);\n }\n\n // Use default renderer with selected ARIA label if defined and relevant.\n const selectedAnnouncement = announceSelected && selectedAriaLabel ? selectedAriaLabel : '';\n const defaultDescription = defaultOptionDescription(option, group);\n return [selectedAnnouncement, defaultDescription].filter(Boolean).join(' ');\n}\n"]}
1
+ {"version":3,"file":"use-announcement.js","sourceRoot":"","sources":["../../../../src/select/utils/use-announcement.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAG1C,OAAO,wBAAwB,MAAM,mDAAmD,CAAC;AAO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GAAG,CAAC,CAAC;AAC9E,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useEffect, useRef } from 'react';\n\nimport { OptionDefinition, OptionGroup } from '../../internal/components/option/interfaces';\nimport defaultOptionDescription from '../../internal/components/option/option-announcer';\nimport { SelectProps } from '../interfaces';\n\ninterface OptionHolder {\n option?: OptionDefinition | OptionGroup;\n}\n\n/**\n * The hook produces the live region string to be announced when an option is highlighted.\n * This is a workaround to account for the issues with assistive technologies.\n *\n * If the testing reveals no issues with the native announcements the live-region can be removed.\n */\nexport function useAnnouncement<Option extends OptionHolder>({\n highlightText,\n announceSelected,\n highlightedOption,\n getParent,\n selectedAriaLabel,\n renderHighlightedAriaLive,\n}: {\n highlightText?: string;\n announceSelected: boolean;\n highlightedOption?: Option;\n getParent: (option: Option) => undefined | OptionGroup;\n selectedAriaLabel?: string;\n renderHighlightedAriaLive?: SelectProps.ContainingOptionAndGroupString;\n}) {\n const prevAnnouncedGroup = useRef<OptionGroup | undefined>(undefined);\n\n // Record previously announced group with a delay to account for possible re-renders of the hook.\n useEffect(() => {\n if (highlightedOption) {\n const frameId = requestAnimationFrame(() => {\n prevAnnouncedGroup.current = getParent(highlightedOption);\n });\n return () => cancelAnimationFrame(frameId);\n }\n });\n\n if (!highlightedOption) {\n return '';\n }\n\n const option = highlightedOption.option as OptionDefinition;\n const parent = getParent(highlightedOption);\n // Only announce parent group if it wasn't announced with previous option.\n const group = parent && parent !== prevAnnouncedGroup.current ? parent : undefined;\n\n // Use custom renderer if provided.\n if (renderHighlightedAriaLive) {\n return renderHighlightedAriaLive(option, group);\n }\n\n // Use default renderer with selected ARIA label if defined and relevant.\n const selectedAnnouncement = announceSelected && selectedAriaLabel ? selectedAriaLabel : '';\n const defaultDescription = defaultOptionDescription({ option, parentGroup: group, highlightText });\n return [selectedAnnouncement, defaultDescription].filter(Boolean).join(' ');\n}\n"]}