@cloudscape-design/components 3.0.97 → 3.0.98

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":"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,UAK/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;AAE7D,iBAAS,wBAAwB,CAAC,MAAM,EAAE,gBAAgB,EAAE,WAAW,EAAE,WAAW,GAAG,SAAS,UAW/F;AAED,eAAe,wBAAwB,CAAC"}
@@ -1,5 +1,11 @@
1
1
  function defaultOptionDescription(option, parentGroup) {
2
- return [parentGroup && parentGroup.label, option.label || option.value, option.description, option.labelTag]
2
+ return [
3
+ parentGroup && parentGroup.label,
4
+ option.__labelPrefix,
5
+ option.label || option.value,
6
+ option.description,
7
+ option.labelTag,
8
+ ]
3
9
  .concat(option.tags)
4
10
  .filter(function (el) { return !!el; })
5
11
  .join(' ');
@@ -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,CAAC,WAAW,IAAI,WAAW,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,QAAQ,CAAC;SACzG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;SACnB,MAAM,CAAC,UAAA,EAAE,IAAI,OAAA,CAAC,CAAC,EAAE,EAAJ,CAAI,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 [parentGroup && parentGroup.label, option.label || option.value, option.description, option.labelTag]\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":"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,UAAA,EAAE,IAAI,OAAA,CAAC,CAAC,EAAE,EAAJ,CAAI,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,5 +1,5 @@
1
1
 
2
- export var PACKAGE_VERSION = '3.0.0 (e24dced)';
2
+ export var PACKAGE_VERSION = '3.0.0 (0ec1556)';
3
3
  export var THEME = 'open-source-visual-refresh';
4
4
  export var ALWAYS_VISUAL_REFRESH = true;
5
5
 
package/package.json CHANGED
@@ -112,6 +112,6 @@
112
112
  "./internal/base-component/index.js",
113
113
  "./internal/base-component/styles.css.js"
114
114
  ],
115
- "version": "3.0.97",
115
+ "version": "3.0.98",
116
116
  "license": "Apache-2.0"
117
117
  }
@@ -30,8 +30,8 @@ export function useAnnouncement(_a) {
30
30
  return renderHighlightedAriaLive(option, group);
31
31
  }
32
32
  // Use default renderer with selected ARIA label if defined and relevant.
33
- var selectedPrefix = announceSelected && selectedAriaLabel ? selectedAriaLabel : '';
33
+ var selectedAnnouncement = announceSelected && selectedAriaLabel ? selectedAriaLabel : '';
34
34
  var defaultDescription = defaultOptionDescription(option, group);
35
- return [selectedPrefix, defaultDescription].filter(Boolean).join(' ');
35
+ return [selectedAnnouncement, defaultDescription].filter(Boolean).join(' ');
36
36
  }
37
37
  //# sourceMappingURL=use-announcement.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-announcement.js","sourceRoot":"","sources":["../../../../src/select/utils/use-announcement.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,wBAAwB,MAAM,mDAAmD,CAAC;AAMzF;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAA8B,EAY5D;QAXC,gBAAgB,sBAAA,EAChB,iBAAiB,uBAAA,EACjB,SAAS,eAAA,EACT,iBAAiB,uBAAA,EACjB,yBAAyB,+BAAA;IAQzB,IAAM,kBAAkB,GAAG,MAAM,CAA0B,SAAS,CAAC,CAAC;IAEtE,iGAAiG;IACjG,SAAS,CAAC;QACR,IAAI,iBAAiB,EAAE;YACrB,IAAM,SAAO,GAAG,qBAAqB,CAAC;gBACpC,kBAAkB,CAAC,OAAO,GAAG,SAAS,CAAC,iBAAiB,CAAC,CAAC;YAC5D,CAAC,CAAC,CAAC;YACH,OAAO,cAAM,OAAA,oBAAoB,CAAC,SAAO,CAAC,EAA7B,CAA6B,CAAC;SAC5C;IACH,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,iBAAiB,EAAE;QACtB,OAAO,EAAE,CAAC;KACX;IAED,IAAM,MAAM,GAAG,iBAAiB,CAAC,MAA0B,CAAC;IAC5D,IAAM,MAAM,GAAG,SAAS,CAAC,iBAAiB,CAAC,CAAC;IAC5C,0EAA0E;IAC1E,IAAM,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,IAAM,cAAc,GAAG,gBAAgB,IAAI,iBAAiB,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,CAAC;IACtF,IAAM,kBAAkB,GAAG,wBAAwB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACnE,OAAO,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACxE,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { OptionDefinition, OptionGroup } from '../../internal/components/option/interfaces';\nimport { SelectProps } from '../interfaces';\nimport { useEffect, useRef } from 'react';\nimport defaultOptionDescription from '../../internal/components/option/option-announcer';\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 selectedPrefix = announceSelected && selectedAriaLabel ? selectedAriaLabel : '';\n const defaultDescription = defaultOptionDescription(option, group);\n return [selectedPrefix, defaultDescription].filter(Boolean).join(' ');\n}\n"]}
1
+ {"version":3,"file":"use-announcement.js","sourceRoot":"","sources":["../../../../src/select/utils/use-announcement.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,wBAAwB,MAAM,mDAAmD,CAAC;AAMzF;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAA8B,EAY5D;QAXC,gBAAgB,sBAAA,EAChB,iBAAiB,uBAAA,EACjB,SAAS,eAAA,EACT,iBAAiB,uBAAA,EACjB,yBAAyB,+BAAA;IAQzB,IAAM,kBAAkB,GAAG,MAAM,CAA0B,SAAS,CAAC,CAAC;IAEtE,iGAAiG;IACjG,SAAS,CAAC;QACR,IAAI,iBAAiB,EAAE;YACrB,IAAM,SAAO,GAAG,qBAAqB,CAAC;gBACpC,kBAAkB,CAAC,OAAO,GAAG,SAAS,CAAC,iBAAiB,CAAC,CAAC;YAC5D,CAAC,CAAC,CAAC;YACH,OAAO,cAAM,OAAA,oBAAoB,CAAC,SAAO,CAAC,EAA7B,CAA6B,CAAC;SAC5C;IACH,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,iBAAiB,EAAE;QACtB,OAAO,EAAE,CAAC;KACX;IAED,IAAM,MAAM,GAAG,iBAAiB,CAAC,MAA0B,CAAC;IAC5D,IAAM,MAAM,GAAG,SAAS,CAAC,iBAAiB,CAAC,CAAC;IAC5C,0EAA0E;IAC1E,IAAM,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,IAAM,oBAAoB,GAAG,gBAAgB,IAAI,iBAAiB,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,CAAC;IAC5F,IAAM,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 { OptionDefinition, OptionGroup } from '../../internal/components/option/interfaces';\nimport { SelectProps } from '../interfaces';\nimport { useEffect, useRef } from 'react';\nimport defaultOptionDescription from '../../internal/components/option/option-announcer';\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"]}