@cloudscape-design/components-themeable 3.0.1326 → 3.0.1327

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 (106) hide show
  1. package/lib/internal/manifest.json +1 -1
  2. package/lib/internal/scss/action-card/styles.scss +4 -2
  3. package/lib/internal/scss/box/styles.scss +1 -0
  4. package/lib/internal/scss/box/visual-accent.scss +117 -0
  5. package/lib/internal/scss/button-dropdown/styles.scss +6 -0
  6. package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +1 -1
  7. package/lib/internal/template/action-card/interfaces.d.ts +40 -1
  8. package/lib/internal/template/action-card/interfaces.d.ts.map +1 -1
  9. package/lib/internal/template/action-card/interfaces.js.map +1 -1
  10. package/lib/internal/template/action-card/internal.d.ts.map +1 -1
  11. package/lib/internal/template/action-card/internal.js +32 -9
  12. package/lib/internal/template/action-card/internal.js.map +1 -1
  13. package/lib/internal/template/action-card/styles.css.js +17 -17
  14. package/lib/internal/template/action-card/styles.scoped.css +96 -92
  15. package/lib/internal/template/action-card/styles.selectors.js +17 -17
  16. package/lib/internal/template/box/interfaces.d.ts +59 -0
  17. package/lib/internal/template/box/interfaces.d.ts.map +1 -1
  18. package/lib/internal/template/box/interfaces.js.map +1 -1
  19. package/lib/internal/template/box/internal.d.ts +1 -1
  20. package/lib/internal/template/box/internal.d.ts.map +1 -1
  21. package/lib/internal/template/box/internal.js +4 -2
  22. package/lib/internal/template/box/internal.js.map +1 -1
  23. package/lib/internal/template/box/styles.css.js +224 -193
  24. package/lib/internal/template/box/styles.scoped.css +424 -238
  25. package/lib/internal/template/box/styles.selectors.js +224 -193
  26. package/lib/internal/template/button-dropdown/category-elements/category-element.d.ts +1 -1
  27. package/lib/internal/template/button-dropdown/category-elements/category-element.d.ts.map +1 -1
  28. package/lib/internal/template/button-dropdown/category-elements/category-element.js +3 -3
  29. package/lib/internal/template/button-dropdown/category-elements/category-element.js.map +1 -1
  30. package/lib/internal/template/button-dropdown/category-elements/expandable-category-element.d.ts +1 -1
  31. package/lib/internal/template/button-dropdown/category-elements/expandable-category-element.d.ts.map +1 -1
  32. package/lib/internal/template/button-dropdown/category-elements/expandable-category-element.js +22 -12
  33. package/lib/internal/template/button-dropdown/category-elements/expandable-category-element.js.map +1 -1
  34. package/lib/internal/template/button-dropdown/category-elements/mobile-expandable-category-element.d.ts +1 -1
  35. package/lib/internal/template/button-dropdown/category-elements/mobile-expandable-category-element.d.ts.map +1 -1
  36. package/lib/internal/template/button-dropdown/category-elements/mobile-expandable-category-element.js +12 -10
  37. package/lib/internal/template/button-dropdown/category-elements/mobile-expandable-category-element.js.map +1 -1
  38. package/lib/internal/template/button-dropdown/filter.d.ts +8 -0
  39. package/lib/internal/template/button-dropdown/filter.d.ts.map +1 -0
  40. package/lib/internal/template/button-dropdown/filter.js +18 -0
  41. package/lib/internal/template/button-dropdown/filter.js.map +1 -0
  42. package/lib/internal/template/button-dropdown/index.d.ts.map +1 -1
  43. package/lib/internal/template/button-dropdown/index.js +3 -3
  44. package/lib/internal/template/button-dropdown/index.js.map +1 -1
  45. package/lib/internal/template/button-dropdown/interfaces.d.ts +41 -0
  46. package/lib/internal/template/button-dropdown/interfaces.d.ts.map +1 -1
  47. package/lib/internal/template/button-dropdown/interfaces.js.map +1 -1
  48. package/lib/internal/template/button-dropdown/internal-interfaces.d.ts +12 -0
  49. package/lib/internal/template/button-dropdown/internal-interfaces.d.ts.map +1 -1
  50. package/lib/internal/template/button-dropdown/internal-interfaces.js.map +1 -1
  51. package/lib/internal/template/button-dropdown/internal.d.ts.map +1 -1
  52. package/lib/internal/template/button-dropdown/internal.js +46 -7
  53. package/lib/internal/template/button-dropdown/internal.js.map +1 -1
  54. package/lib/internal/template/button-dropdown/item-element/index.d.ts +1 -1
  55. package/lib/internal/template/button-dropdown/item-element/index.d.ts.map +1 -1
  56. package/lib/internal/template/button-dropdown/item-element/index.js +35 -16
  57. package/lib/internal/template/button-dropdown/item-element/index.js.map +1 -1
  58. package/lib/internal/template/button-dropdown/items-list.d.ts +1 -1
  59. package/lib/internal/template/button-dropdown/items-list.d.ts.map +1 -1
  60. package/lib/internal/template/button-dropdown/items-list.js +4 -4
  61. package/lib/internal/template/button-dropdown/items-list.js.map +1 -1
  62. package/lib/internal/template/button-dropdown/styles.css.js +23 -22
  63. package/lib/internal/template/button-dropdown/styles.scoped.css +38 -32
  64. package/lib/internal/template/button-dropdown/styles.selectors.js +23 -22
  65. package/lib/internal/template/button-dropdown/tooltip.d.ts +2 -1
  66. package/lib/internal/template/button-dropdown/tooltip.d.ts.map +1 -1
  67. package/lib/internal/template/button-dropdown/tooltip.js +22 -14
  68. package/lib/internal/template/button-dropdown/tooltip.js.map +1 -1
  69. package/lib/internal/template/button-dropdown/utils/filter-items.d.ts +4 -0
  70. package/lib/internal/template/button-dropdown/utils/filter-items.d.ts.map +1 -0
  71. package/lib/internal/template/button-dropdown/utils/filter-items.js +55 -0
  72. package/lib/internal/template/button-dropdown/utils/filter-items.js.map +1 -0
  73. package/lib/internal/template/button-dropdown/utils/use-button-dropdown.d.ts +7 -1
  74. package/lib/internal/template/button-dropdown/utils/use-button-dropdown.d.ts.map +1 -1
  75. package/lib/internal/template/button-dropdown/utils/use-button-dropdown.js +77 -13
  76. package/lib/internal/template/button-dropdown/utils/use-button-dropdown.js.map +1 -1
  77. package/lib/internal/template/error-boundary/internal.d.ts.map +1 -1
  78. package/lib/internal/template/error-boundary/internal.js +1 -0
  79. package/lib/internal/template/error-boundary/internal.js.map +1 -1
  80. package/lib/internal/template/internal/base-component/index.js +3 -3
  81. package/lib/internal/template/internal/base-component/index.js.map +1 -1
  82. package/lib/internal/template/internal/base-component/styles.scoped.css +17 -1
  83. package/lib/internal/template/internal/environment.js +2 -2
  84. package/lib/internal/template/internal/environment.json +2 -2
  85. package/lib/internal/template/internal/generated/styles/tokens.d.ts +132 -0
  86. package/lib/internal/template/internal/generated/styles/tokens.js +132 -0
  87. package/lib/internal/template/internal/generated/theming/index.cjs +1884 -0
  88. package/lib/internal/template/internal/generated/theming/index.js +1884 -0
  89. package/lib/internal/template/item-card/internal.js +1 -1
  90. package/lib/internal/template/item-card/internal.js.map +1 -1
  91. package/lib/internal/template/multiselect/embedded.d.ts +2 -2
  92. package/lib/internal/template/multiselect/internal.d.ts +1 -1
  93. package/lib/internal/template/select/parts/filter.d.ts +1 -1
  94. package/lib/internal/template/table/index.d.ts.map +1 -1
  95. package/lib/internal/template/table/index.js +5 -3
  96. package/lib/internal/template/table/index.js.map +1 -1
  97. package/lib/internal/template/test-utils/dom/action-card/index.d.ts +4 -2
  98. package/lib/internal/template/test-utils/dom/action-card/index.js +5 -3
  99. package/lib/internal/template/test-utils/dom/action-card/index.js.map +1 -1
  100. package/lib/internal/template/test-utils/dom/button-dropdown/index.d.ts +16 -0
  101. package/lib/internal/template/test-utils/dom/button-dropdown/index.js +24 -0
  102. package/lib/internal/template/test-utils/dom/button-dropdown/index.js.map +1 -1
  103. package/lib/internal/template/test-utils/selectors/button-dropdown/index.d.ts +16 -0
  104. package/lib/internal/template/test-utils/selectors/button-dropdown/index.js +24 -0
  105. package/lib/internal/template/test-utils/selectors/button-dropdown/index.js.map +1 -1
  106. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"expandable-category-element.js","sourceRoot":"","sources":["../../../../src/button-dropdown/category-elements/expandable-category-element.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,+CAA+C,CAAC;AACrF,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAEjH,OAAO,QAAQ,MAAM,yBAAyB,CAAC;AAC/C,OAAO,YAAY,MAAM,qBAAqB,CAAC;AAC/C,OAAO,oBAAoB,MAAM,6CAA6C,CAAC;A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,CAAC;IAED,OAAO,CACL,4BACE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,WAAW,OAAO,EAAE,CAAC,EAAE,MAAM,CAAC,UAAU,EAAE;YAChF,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,QAAQ;YAC3B,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,QAAQ;YAC3B,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,WAAW;SAClC,CAAC,EACF,IAAI,EAAC,cAAc,iBACN,IAAI,CAAC,EAAE,EACpB,GAAG,EAAE,GAAG,EACR,OAAO,EAAE,OAAO,EAChB,YAAY,EAAE,OAAO,EACrB,YAAY,EAAE,OAAO,IAEpB,OAAO,CACL,CACN,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,yBAAyB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { isThemeActive, Theme } from '@cloudscape-design/component-toolkit/internal';\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport Dropdown from '../../dropdown/internal';\nimport InternalIcon from '../../icon/internal';\nimport useHiddenDescription from '../../internal/hooks/use-hidden-description';\nimport { useVisualRefresh } from '../../internal/hooks/use-visual-mode';\nimport {\n GeneratedAnalyticsMetadataButtonDropdownCollapse,\n GeneratedAnalyticsMetadataButtonDropdownExpand,\n} from '../analytics-metadata/interfaces.js';\nimport { ButtonDropdownProps } from '../interfaces';\nimport { CategoryProps } from '../internal-interfaces';\nimport ItemsList from '../items-list';\nimport Tooltip from '../tooltip.js';\nimport { getMenuItemProps } from '../utils/menu-item';\n\nimport styles from './styles.css.js';\n\nconst ExpandableCategoryElement = ({\n index,\n item,\n onItemActivate,\n onGroupToggle,\n targetItem,\n isHighlighted,\n isKeyboardHighlight,\n isExpanded,\n lastInDropdown,\n highlightItem,\n disabled,\n expandToViewport,\n variant,\n position,\n renderItem,\n}: CategoryProps) => {\n const highlighted = isHighlighted(item);\n const expanded = isExpanded(item);\n const isKeyboardHighlighted = isKeyboardHighlight(item);\n const triggerRef = React.useRef<HTMLSpanElement>(null);\n const ref = useRef<HTMLLIElement>(null);\n\n useEffect(() => {\n if (triggerRef.current && highlighted && !expanded) {\n triggerRef.current.focus();\n }\n }, [expanded, highlighted]);\n\n const onClick: React.MouseEventHandler = event => {\n if (!disabled) {\n event.preventDefault();\n onGroupToggle(item, event);\n triggerRef.current?.focus();\n }\n };\n\n const onHover = () => {\n highlightItem(item);\n };\n\n const isVisualRefresh = useVisualRefresh();\n const isOneTheme = isThemeActive(Theme.OneTheme);\n\n const isDisabledWithReason = !!item.disabledReason && item.disabled;\n const { targetProps, descriptionEl } = useHiddenDescription(item.disabledReason);\n\n const groupProps: ButtonDropdownProps.GroupRenderItem = {\n index: index ?? 0,\n type: 'group',\n option: item as ButtonDropdownProps.ItemGroup,\n disabled: !!disabled,\n highlighted: !!highlighted,\n expanded: expanded,\n expandDirection: 'horizontal',\n };\n const renderResult = renderItem?.({ item: groupProps }) ?? null;\n\n const trigger = item.text && (\n <span\n className={clsx(styles.header, styles['expandable-header'], styles[`variant-${variant}`], {\n [styles.disabled]: disabled,\n [styles.highlighted]: highlighted,\n [styles['no-content-styling']]: !!renderResult,\n [styles['is-focused']]: isKeyboardHighlighted,\n [styles['visual-refresh']]: isVisualRefresh,\n })}\n // We are using the roving tabindex technique to manage the focus state of the dropdown.\n // The current element will always have tabindex=0 which means that it can be tabbed to,\n // while all other items have tabindex=-1 so we can focus them when necessary.\n tabIndex={highlighted ? 0 : -1}\n ref={triggerRef}\n {...getMenuItemProps({ parent: true, expanded, disabled })}\n {...(isDisabledWithReason ? targetProps : {})}\n {...getAnalyticsMetadataAttribute(\n disabled\n ? {}\n : ({\n action: !expanded ? 'expand' : 'collapse',\n detail: {\n position: position || '0',\n label: { root: 'self' },\n id: item.id || '',\n },\n } as GeneratedAnalyticsMetadataButtonDropdownExpand | GeneratedAnalyticsMetadataButtonDropdownCollapse)\n )}\n >\n {renderResult ? (\n renderResult\n ) : (\n <>\n {(item.iconName || item.iconUrl || item.iconSvg) && (\n <span className={styles['icon-wrapper']}>\n <InternalIcon name={item.iconName} url={item.iconUrl} svg={item.iconSvg} alt={item.iconAlt} />\n </span>\n )}\n <span>{item.text}</span>\n <span className={clsx(styles['expand-icon'], styles['expand-icon-right'])}>\n <InternalIcon\n name={isOneTheme ? 'angle-down' : 'caret-down-filled'}\n size={isOneTheme ? 'x-small' : 'normal'}\n />\n </span>\n </>\n )}\n </span>\n );\n\n let content: React.ReactNode;\n // If the category element is disabled, we do not render a dropdown.\n // Screenreaders are confused by additional sections\n if (isDisabledWithReason) {\n content = (\n <Tooltip content={item.disabledReason}>\n {trigger}\n {descriptionEl}\n </Tooltip>\n );\n } else if (disabled) {\n content = trigger;\n } else {\n content = (\n <Dropdown\n open={expanded}\n interior={true}\n hideBlockBorder={false}\n expandToViewport={expandToViewport}\n trigger={trigger}\n content={\n item.items && expanded ? (\n <ul\n role=\"menu\"\n aria-label={item.text}\n className={clsx(styles['items-list-container'], styles['in-dropdown'])}\n >\n <ItemsList\n items={item.items}\n onItemActivate={onItemActivate}\n onGroupToggle={onGroupToggle}\n targetItem={targetItem}\n isHighlighted={isHighlighted}\n isKeyboardHighlight={isKeyboardHighlight}\n isExpanded={isExpanded}\n lastInDropdown={lastInDropdown}\n highlightItem={highlightItem}\n variant={variant}\n position={position}\n renderItem={renderItem}\n parentProps={groupProps}\n />\n </ul>\n ) : undefined\n }\n />\n );\n }\n\n return (\n <li\n className={clsx(styles.category, styles[`variant-${variant}`], styles.expandable, {\n [styles.expanded]: expanded,\n [styles.disabled]: disabled,\n [styles.highlighted]: highlighted,\n })}\n role=\"presentation\"\n data-testid={item.id}\n ref={ref}\n onClick={onClick}\n onMouseEnter={onHover}\n onTouchStart={onHover}\n >\n {content}\n </li>\n );\n};\n\nexport default ExpandableCategoryElement;\n"]}
1
+ {"version":3,"file":"expandable-category-element.js","sourceRoot":"","sources":["../../../../src/button-dropdown/category-elements/expandable-category-element.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,+CAA+C,CAAC;AACrF,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAEjH,OAAO,QAAQ,MAAM,yBAAyB,CAAC;AAC/C,OAAO,YAAY,MAAM,qBAAqB,CAAC;AAC/C,OAAO,oBAAoB,MAAM,6CAA6C,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAOxE,OAAO,SAAS,MAAM,eAAe,CAAC;AACtC,OAAO,OAAO,MAAM,eAAe,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,MAAM,yBAAyB,GAAG,CAAC,EACjC,KAAK,EACL,IAAI,EACJ,cAAc,EACd,aAAa,EACb,UAAU,EACV,aAAa,EACb,mBAAmB,EACnB,UAAU,EACV,cAAc,EACd,aAAa,EACb,QAAQ,EACR,gBAAgB,EAChB,OAAO,EACP,QAAQ,EACR,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,MAAM,EACN,sBAAsB,GACR,EAAE,EAAE;;IAClB,MAAM,WAAW,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;IACxC,MAAM,QAAQ,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;IAClC,MAAM,qBAAqB,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC;IACxD,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAkB,IAAI,CAAC,CAA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C,WAAW,OAAO,EAAE,CAAC,EAAE,MAAM,CAAC,UAAU,EAAE;YAChF,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,QAAQ;YAC3B,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,QAAQ;YAC3B,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,WAAW;SAClC,CAAC,EACF,IAAI,EAAC,cAAc,iBACN,IAAI,CAAC,EAAE,EACpB,GAAG,EAAE,GAAG,EACR,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,OAAO,EACrB,YAAY,EAAE,OAAO,IAEpB,OAAO,CACL,CACN,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,yBAAyB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { isThemeActive, Theme } from '@cloudscape-design/component-toolkit/internal';\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport Dropdown from '../../dropdown/internal';\nimport InternalIcon from '../../icon/internal';\nimport useHiddenDescription from '../../internal/hooks/use-hidden-description';\nimport { useVisualRefresh } from '../../internal/hooks/use-visual-mode';\nimport {\n GeneratedAnalyticsMetadataButtonDropdownCollapse,\n GeneratedAnalyticsMetadataButtonDropdownExpand,\n} from '../analytics-metadata/interfaces.js';\nimport { ButtonDropdownProps } from '../interfaces';\nimport { CategoryProps } from '../internal-interfaces';\nimport ItemsList from '../items-list';\nimport Tooltip from '../tooltip.js';\nimport { getMenuItemProps } from '../utils/menu-item';\n\nimport styles from './styles.css.js';\n\nconst ExpandableCategoryElement = ({\n index,\n item,\n onItemActivate,\n onGroupToggle,\n targetItem,\n isHighlighted,\n isKeyboardHighlight,\n isExpanded,\n lastInDropdown,\n highlightItem,\n disabled,\n expandToViewport,\n variant,\n position,\n renderItem,\n filteringText,\n filteringEnabled,\n menuId,\n filteringDescriptionId,\n}: CategoryProps) => {\n const highlighted = isHighlighted(item);\n const expanded = isExpanded(item);\n const isKeyboardHighlighted = isKeyboardHighlight(item);\n const triggerRef = React.useRef<HTMLSpanElement>(null);\n const ref = useRef<HTMLLIElement>(null);\n\n useEffect(() => {\n if (triggerRef.current && highlighted && !expanded && !filteringEnabled) {\n triggerRef.current.focus();\n }\n }, [expanded, highlighted, filteringEnabled]);\n\n const onClick: React.MouseEventHandler = event => {\n if (!disabled) {\n event.preventDefault();\n onGroupToggle(item, event);\n if (!filteringEnabled) {\n triggerRef.current?.focus();\n }\n }\n };\n\n const onMouseDown: React.MouseEventHandler = event => {\n // Ensure that focus remains on the filtering input at all times.\n if (filteringEnabled) {\n event.preventDefault();\n }\n };\n\n const onHover = () => {\n highlightItem(item);\n };\n\n const isVisualRefresh = useVisualRefresh();\n const isOneTheme = isThemeActive(Theme.OneTheme);\n\n const isDisabledWithReason = !!item.disabledReason && item.disabled;\n const { targetProps, descriptionEl } = useHiddenDescription(item.disabledReason);\n\n const groupProps: ButtonDropdownProps.GroupRenderItem = {\n index: index ?? 0,\n type: 'group',\n option: item as ButtonDropdownProps.ItemGroup,\n disabled: !!disabled,\n highlighted: !!highlighted,\n expanded: expanded,\n expandDirection: 'horizontal',\n };\n const renderResult = renderItem?.({ item: groupProps, filterText: filteringText }) ?? null;\n\n const trigger = item.text && (\n <span\n id={menuId && item.id ? `${menuId}-${item.id}` : undefined}\n className={clsx(styles.header, styles['expandable-header'], styles[`variant-${variant}`], {\n [styles.disabled]: disabled,\n [styles.highlighted]: highlighted,\n [styles['no-content-styling']]: !!renderResult,\n [styles['is-focused']]: isKeyboardHighlighted,\n [styles['visual-refresh']]: isVisualRefresh,\n })}\n // When filtering is enabled, we use aria-activedescendant on the filter input and provide\n // the `id` of the item to select it. When filtering is disabled, we are using the roving\n // tabindex technique to manage the focus state of the dropdown. The current element will\n // have tabindex=0 which means that it can be tabbed to, while all other items have\n // tabindex=-1 so we can focus them when necessary.\n tabIndex={filteringEnabled ? -1 : highlighted ? 0 : -1}\n ref={triggerRef}\n {...getMenuItemProps({ parent: true, expanded, disabled })}\n {...(isDisabledWithReason ? targetProps : {})}\n {...getAnalyticsMetadataAttribute(\n disabled\n ? {}\n : ({\n action: !expanded ? 'expand' : 'collapse',\n detail: {\n position: position || '0',\n label: { root: 'self' },\n id: item.id || '',\n },\n } as GeneratedAnalyticsMetadataButtonDropdownExpand | GeneratedAnalyticsMetadataButtonDropdownCollapse)\n )}\n >\n {renderResult ? (\n renderResult\n ) : (\n <>\n {(item.iconName || item.iconUrl || item.iconSvg) && (\n <span className={styles['icon-wrapper']}>\n <InternalIcon name={item.iconName} url={item.iconUrl} svg={item.iconSvg} alt={item.iconAlt} />\n </span>\n )}\n <span>{item.text}</span>\n <span className={clsx(styles['expand-icon'], styles['expand-icon-right'])}>\n <InternalIcon\n name={isOneTheme ? 'angle-down' : 'caret-down-filled'}\n size={isOneTheme ? 'x-small' : 'normal'}\n />\n </span>\n </>\n )}\n </span>\n );\n\n let content: React.ReactNode;\n // If the category element is disabled, we do not render a dropdown.\n // Screenreaders are confused by additional sections\n if (isDisabledWithReason) {\n content = (\n <Tooltip content={item.disabledReason}>\n {trigger}\n {descriptionEl}\n </Tooltip>\n );\n } else if (disabled) {\n content = trigger;\n } else {\n content = (\n <Dropdown\n open={expanded}\n interior={true}\n hideBlockBorder={false}\n expandToViewport={expandToViewport}\n trigger={trigger}\n content={\n item.items && expanded ? (\n <ul\n role=\"menu\"\n aria-label={item.text}\n className={clsx(styles['items-list-container'], styles['in-dropdown'])}\n >\n <ItemsList\n items={item.items}\n onItemActivate={onItemActivate}\n onGroupToggle={onGroupToggle}\n targetItem={targetItem}\n isHighlighted={isHighlighted}\n isKeyboardHighlight={isKeyboardHighlight}\n isExpanded={isExpanded}\n lastInDropdown={lastInDropdown}\n highlightItem={highlightItem}\n variant={variant}\n position={position}\n renderItem={renderItem}\n parentProps={groupProps}\n filteringText={filteringText}\n filteringEnabled={filteringEnabled}\n menuId={menuId}\n filteringDescriptionId={filteringDescriptionId}\n />\n </ul>\n ) : undefined\n }\n />\n );\n }\n\n return (\n <li\n className={clsx(styles.category, styles[`variant-${variant}`], styles.expandable, {\n [styles.expanded]: expanded,\n [styles.disabled]: disabled,\n [styles.highlighted]: highlighted,\n })}\n role=\"presentation\"\n data-testid={item.id}\n ref={ref}\n onClick={onClick}\n onMouseDown={onMouseDown}\n onMouseEnter={onHover}\n onTouchStart={onHover}\n >\n {content}\n </li>\n );\n};\n\nexport default ExpandableCategoryElement;\n"]}
@@ -1,4 +1,4 @@
1
1
  import { CategoryProps } from '../internal-interfaces';
2
- declare const MobileExpandableCategoryElement: ({ index, item, onItemActivate, onGroupToggle, targetItem, isHighlighted, isKeyboardHighlight, isExpanded, lastInDropdown, highlightItem, disabled, variant, position, renderItem, }: CategoryProps) => JSX.Element;
2
+ declare const MobileExpandableCategoryElement: ({ index, item, onItemActivate, onGroupToggle, targetItem, isHighlighted, isKeyboardHighlight, isExpanded, lastInDropdown, highlightItem, disabled, variant, position, renderItem, filteringText, filteringEnabled, menuId, filteringDescriptionId, }: CategoryProps) => JSX.Element;
3
3
  export default MobileExpandableCategoryElement;
4
4
  //# sourceMappingURL=mobile-expandable-category-element.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mobile-expandable-category-element.d.ts","sourceRoot":"","sources":["../../../../src/button-dropdown/category-elements/mobile-expandable-category-element.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAQvD,QAAA,MAAM,+BAA+B,GAAI,qLAetC,aAAa,gBAqJf,CAAC;AAEF,eAAe,+BAA+B,CAAC"}
1
+ {"version":3,"file":"mobile-expandable-category-element.d.ts","sourceRoot":"","sources":["../../../../src/button-dropdown/category-elements/mobile-expandable-category-element.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAQvD,QAAA,MAAM,+BAA+B,GAAI,sPAmBtC,aAAa,gBA4Jf,CAAC;AAEF,eAAe,+BAA+B,CAAC"}
@@ -11,17 +11,17 @@ import MobileExpandableGroup from '../mobile-expandable-group/mobile-expandable-
11
11
  import Tooltip from '../tooltip.js';
12
12
  import { getMenuItemProps } from '../utils/menu-item.js';
13
13
  import styles from './styles.css.js';
14
- const MobileExpandableCategoryElement = ({ index, item, onItemActivate, onGroupToggle, targetItem, isHighlighted, isKeyboardHighlight, isExpanded, lastInDropdown, highlightItem, disabled, variant, position, renderItem, }) => {
14
+ const MobileExpandableCategoryElement = ({ index, item, onItemActivate, onGroupToggle, targetItem, isHighlighted, isKeyboardHighlight, isExpanded, lastInDropdown, highlightItem, disabled, variant, position, renderItem, filteringText, filteringEnabled, menuId, filteringDescriptionId, }) => {
15
15
  var _a;
16
16
  const highlighted = isHighlighted(item);
17
17
  const expanded = isExpanded(item);
18
18
  const isKeyboardHighlighted = isKeyboardHighlight(item);
19
19
  const triggerRef = React.useRef(null);
20
20
  useEffect(() => {
21
- if (triggerRef.current && highlighted && !expanded) {
21
+ if (triggerRef.current && highlighted && !expanded && !filteringEnabled) {
22
22
  triggerRef.current.focus();
23
23
  }
24
- }, [expanded, highlighted]);
24
+ }, [expanded, highlighted, filteringEnabled]);
25
25
  const onClick = (e) => {
26
26
  if (!disabled) {
27
27
  e.preventDefault();
@@ -43,18 +43,20 @@ const MobileExpandableCategoryElement = ({ index, item, onItemActivate, onGroupT
43
43
  expanded: expanded,
44
44
  expandDirection: 'vertical',
45
45
  };
46
- const renderResult = (_a = renderItem === null || renderItem === void 0 ? void 0 : renderItem({ item: groupProps })) !== null && _a !== void 0 ? _a : null;
47
- const trigger = item.text && (React.createElement("span", { className: clsx(styles.header, styles['expandable-header'], styles[`variant-${variant}`], {
46
+ const renderResult = (_a = renderItem === null || renderItem === void 0 ? void 0 : renderItem({ item: groupProps, filterText: filteringText })) !== null && _a !== void 0 ? _a : null;
47
+ const trigger = item.text && (React.createElement("span", { id: menuId && item.id ? `${menuId}-${item.id}` : undefined, className: clsx(styles.header, styles['expandable-header'], styles[`variant-${variant}`], {
48
48
  [styles.highlighted]: highlighted,
49
49
  [styles['rolled-down']]: expanded,
50
50
  [styles['no-content-styling']]: !!renderResult,
51
51
  [styles.disabled]: disabled,
52
52
  [styles['is-focused']]: isKeyboardHighlighted,
53
53
  }),
54
- // We are using the roving tabindex technique to manage the focus state of the dropdown.
55
- // The current element will always have tabindex=0 which means that it can be tabbed to,
56
- // while all other items have tabindex=-1 so we can focus them when necessary.
57
- tabIndex: highlighted ? 0 : -1, ref: triggerRef, ...getMenuItemProps({ parent: true, disabled, expanded }), ...(isDisabledWithReason ? targetProps : {}), ...getAnalyticsMetadataAttribute(disabled
54
+ // When filtering is enabled, we use aria-activedescendant on the filter input and provide
55
+ // the `id` of the item to select it. When filtering is disabled, we are using the roving
56
+ // tabindex technique to manage the focus state of the dropdown. The current element will
57
+ // have tabindex=0 which means that it can be tabbed to, while all other items have
58
+ // tabindex=-1 so we can focus them when necessary.
59
+ tabIndex: filteringEnabled ? -1 : highlighted ? 0 : -1, ref: triggerRef, ...getMenuItemProps({ parent: true, disabled, expanded }), ...(isDisabledWithReason ? targetProps : {}), ...getAnalyticsMetadataAttribute(disabled
58
60
  ? {}
59
61
  : {
60
62
  action: 'expand',
@@ -83,7 +85,7 @@ const MobileExpandableCategoryElement = ({ index, item, onItemActivate, onGroupT
83
85
  }
84
86
  else {
85
87
  content = (React.createElement(MobileExpandableGroup, { open: expanded, trigger: trigger }, item.items && expanded && (React.createElement("ul", { role: "menu", "aria-label": item.text, className: styles['items-list-container'] },
86
- React.createElement(ItemsList, { items: item.items, onItemActivate: onItemActivate, onGroupToggle: onGroupToggle, targetItem: targetItem, isHighlighted: isHighlighted, isKeyboardHighlight: isKeyboardHighlight, isExpanded: isExpanded, lastInDropdown: lastInDropdown, highlightItem: highlightItem, hasCategoryHeader: true, variant: variant, position: position, renderItem: renderItem, parentProps: groupProps })))));
88
+ React.createElement(ItemsList, { items: item.items, onItemActivate: onItemActivate, onGroupToggle: onGroupToggle, targetItem: targetItem, isHighlighted: isHighlighted, isKeyboardHighlight: isKeyboardHighlight, isExpanded: isExpanded, lastInDropdown: lastInDropdown, highlightItem: highlightItem, hasCategoryHeader: true, variant: variant, position: position, renderItem: renderItem, parentProps: groupProps, filteringText: filteringText, filteringEnabled: filteringEnabled, menuId: menuId, filteringDescriptionId: filteringDescriptionId })))));
87
89
  }
88
90
  return (React.createElement("li", { className: clsx(styles.category, styles[`variant-${variant}`], styles.expandable, {
89
91
  [styles.expanded]: expanded,
@@ -1 +1 @@
1
- {"version":3,"file":"mobile-expandable-category-element.js","sourceRoot":"","sources":["../../../../src/button-dropdown/category-elements/mobile-expandable-category-element.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,+CAA+C,CAAC;AACrF,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAEjH,OAAO,YAAY,MAAM,qBAAqB,CAAC;AAC/C,OAAO,oBAAoB,MAAM,6CAA6C,CAAC;AAI/E,OAAO,SAAS,MAAM,eAAe,CAAC;AACtC,OAAO,qBAAqB,MAAM,oDAAoD,CAAC;AACvF,OAAO,OAAO,MAAM,eAAe,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,MAAM,+BAA+B,GAAG,CAAC,EACvC,KAAK,EACL,IAAI,EACJ,cAAc,EACd,aAAa,EACb,UAAU,EACV,aAAa,EACb,mBAAmB,EACnB,UAAU,EACV,cAAc,EACd,aAAa,EACb,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,UAAU,GACI,EAAE,EAAE;;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AAC,MAAM,gBAAa,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,CAAC,sBAAsB,CAAC;YAC9E,oBAAC,SAAS,IACR,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,cAAc,EAAE,cAAc,EAC9B,aAAa,EAAE,aAAa,EAC5B,UAAU,EAAE,UAAU,EACtB,aAAa,EAAE,aAAa,EAC5B,mBAAmB,EAAE,mBAAmB,EACxC,UAAU,EAAE,UAAU,EACtB,cAAc,EAAE,cAAc,EAC9B,aAAa,EAAE,aAAa,EAC5B,iBAAiB,EAAE,IAAI,EACvB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,UAAU,GACvB,CACC,CACN,CACqB,CACzB,CAAC;IACJ,CAAC;IAED,OAAO,CACL,4BACE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,WAAW,OAAO,EAAE,CAAC,EAAE,MAAM,CAAC,UAAU,EAAE;YAChF,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,QAAQ;YAC3B,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,QAAQ;YAC3B,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,WAAW,IAAI,QAAQ;YAC7C,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,IAAI;SAC1B,CAAC,EACF,IAAI,EAAC,cAAc,EACnB,OAAO,EAAE,OAAO,EAChB,YAAY,EAAE,OAAO,EACrB,YAAY,EAAE,OAAO,iBACR,IAAI,CAAC,EAAE,IAEnB,OAAO,CACL,CACN,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,+BAA+B,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect } from 'react';\nimport clsx from 'clsx';\n\nimport { isThemeActive, Theme } from '@cloudscape-design/component-toolkit/internal';\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport InternalIcon from '../../icon/internal';\nimport useHiddenDescription from '../../internal/hooks/use-hidden-description';\nimport { GeneratedAnalyticsMetadataButtonDropdownExpand } from '../analytics-metadata/interfaces.js';\nimport { ButtonDropdownProps } from '../interfaces';\nimport { CategoryProps } from '../internal-interfaces';\nimport ItemsList from '../items-list';\nimport MobileExpandableGroup from '../mobile-expandable-group/mobile-expandable-group';\nimport Tooltip from '../tooltip.js';\nimport { getMenuItemProps } from '../utils/menu-item.js';\n\nimport styles from './styles.css.js';\n\nconst MobileExpandableCategoryElement = ({\n index,\n item,\n onItemActivate,\n onGroupToggle,\n targetItem,\n isHighlighted,\n isKeyboardHighlight,\n isExpanded,\n lastInDropdown,\n highlightItem,\n disabled,\n variant,\n position,\n renderItem,\n}: CategoryProps) => {\n const highlighted = isHighlighted(item);\n const expanded = isExpanded(item);\n const isKeyboardHighlighted = isKeyboardHighlight(item);\n const triggerRef = React.useRef<HTMLSpanElement>(null);\n\n useEffect(() => {\n if (triggerRef.current && highlighted && !expanded) {\n triggerRef.current.focus();\n }\n }, [expanded, highlighted]);\n\n const onClick = (e: React.MouseEvent) => {\n if (!disabled) {\n e.preventDefault();\n onGroupToggle(item, e);\n }\n };\n\n const onHover = () => {\n highlightItem(item);\n };\n\n const isOneTheme = isThemeActive(Theme.OneTheme);\n\n const isDisabledWithReason = !!item.disabledReason && item.disabled;\n const { targetProps, descriptionEl } = useHiddenDescription(item.disabledReason);\n\n const groupProps: ButtonDropdownProps.GroupRenderItem = {\n index: index ?? 0,\n type: 'group',\n option: item as ButtonDropdownProps.ItemGroup,\n disabled: !!disabled,\n highlighted: !!highlighted,\n expanded: expanded,\n expandDirection: 'vertical',\n };\n const renderResult = renderItem?.({ item: groupProps }) ?? null;\n\n const trigger = item.text && (\n <span\n className={clsx(styles.header, styles['expandable-header'], styles[`variant-${variant}`], {\n [styles.highlighted]: highlighted,\n [styles['rolled-down']]: expanded,\n [styles['no-content-styling']]: !!renderResult,\n [styles.disabled]: disabled,\n [styles['is-focused']]: isKeyboardHighlighted,\n })}\n // We are using the roving tabindex technique to manage the focus state of the dropdown.\n // The current element will always have tabindex=0 which means that it can be tabbed to,\n // while all other items have tabindex=-1 so we can focus them when necessary.\n tabIndex={highlighted ? 0 : -1}\n ref={triggerRef}\n {...getMenuItemProps({ parent: true, disabled, expanded })}\n {...(isDisabledWithReason ? targetProps : {})}\n {...getAnalyticsMetadataAttribute(\n disabled\n ? {}\n : ({\n action: 'expand',\n detail: {\n position: position || '0',\n label: { root: 'self' },\n id: item.id || '',\n expanded: `${!expanded}`,\n },\n } as GeneratedAnalyticsMetadataButtonDropdownExpand)\n )}\n >\n {renderResult ? (\n renderResult\n ) : (\n <>\n {(item.iconName || item.iconUrl || item.iconSvg) && (\n <span className={styles['icon-wrapper']}>\n <InternalIcon name={item.iconName} url={item.iconUrl} svg={item.iconSvg} alt={item.iconAlt} />\n </span>\n )}\n <span>{item.text}</span>\n <span\n className={clsx(styles['expand-icon'], {\n [styles['expand-icon-up']]: expanded,\n })}\n >\n <InternalIcon\n name={isOneTheme ? 'angle-down' : 'caret-down-filled'}\n size={isOneTheme ? 'x-small' : 'normal'}\n />\n </span>\n </>\n )}\n </span>\n );\n\n let content: React.ReactNode;\n\n if (isDisabledWithReason) {\n content = (\n <>\n {descriptionEl}\n <Tooltip content={item.disabledReason}>{trigger}</Tooltip>\n </>\n );\n } else if (disabled) {\n content = trigger;\n } else {\n content = (\n <MobileExpandableGroup open={expanded} trigger={trigger}>\n {item.items && expanded && (\n <ul role=\"menu\" aria-label={item.text} className={styles['items-list-container']}>\n <ItemsList\n items={item.items}\n onItemActivate={onItemActivate}\n onGroupToggle={onGroupToggle}\n targetItem={targetItem}\n isHighlighted={isHighlighted}\n isKeyboardHighlight={isKeyboardHighlight}\n isExpanded={isExpanded}\n lastInDropdown={lastInDropdown}\n highlightItem={highlightItem}\n hasCategoryHeader={true}\n variant={variant}\n position={position}\n renderItem={renderItem}\n parentProps={groupProps}\n />\n </ul>\n )}\n </MobileExpandableGroup>\n );\n }\n\n return (\n <li\n className={clsx(styles.category, styles[`variant-${variant}`], styles.expandable, {\n [styles.expanded]: expanded,\n [styles.disabled]: disabled,\n [styles.highlighted]: highlighted || expanded,\n [styles.expandable]: true,\n })}\n role=\"presentation\"\n onClick={onClick}\n onMouseEnter={onHover}\n onTouchStart={onHover}\n data-testid={item.id}\n >\n {content}\n </li>\n );\n};\n\nexport default MobileExpandableCategoryElement;\n"]}
1
+ {"version":3,"file":"mobile-expandable-category-element.js","sourceRoot":"","sources":["../../../../src/button-dropdown/category-elements/mobile-expandable-category-element.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,+CAA+C,CAAC;AACrF,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAEjH,OAAO,YAAY,MAAM,qBAAqB,CAAC;AAC/C,OAAO,oBAAoB,MAAM,6CAA6C,CAAC;AAI/E,OAAO,SAAS,MAAM,eAAe,CAAC;AACtC,OAAO,qBAAqB,MAAM,oDAAoD,CAAC;AACvF,OAAO,OAAO,MAAM,eAAe,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,MAAM,+BAA+B,GAAG,CAAC,EACvC,KAAK,EACL,IAAI,EACJ,cAAc,EACd,aAAa,EACb,UAAU,EACV,aAAa,EACb,mBAAmB,EACnB,UAAU,EACV,cAAc,EACd,aAAa,EACb,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,MAAM,EACN,sBAAsB,GACR,EAAE,EAAE;;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,EAAE,IAAI;SAC1B,CAAC,EACF,IAAI,EAAC,cAAc,EACnB,OAAO,EAAE,OAAO,EAChB,YAAY,EAAE,OAAO,EACrB,YAAY,EAAE,OAAO,iBACR,IAAI,CAAC,EAAE,IAEnB,OAAO,CACL,CACN,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,+BAA+B,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect } from 'react';\nimport clsx from 'clsx';\n\nimport { isThemeActive, Theme } from '@cloudscape-design/component-toolkit/internal';\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport InternalIcon from '../../icon/internal';\nimport useHiddenDescription from '../../internal/hooks/use-hidden-description';\nimport { GeneratedAnalyticsMetadataButtonDropdownExpand } from '../analytics-metadata/interfaces.js';\nimport { ButtonDropdownProps } from '../interfaces';\nimport { CategoryProps } from '../internal-interfaces';\nimport ItemsList from '../items-list';\nimport MobileExpandableGroup from '../mobile-expandable-group/mobile-expandable-group';\nimport Tooltip from '../tooltip.js';\nimport { getMenuItemProps } from '../utils/menu-item.js';\n\nimport styles from './styles.css.js';\n\nconst MobileExpandableCategoryElement = ({\n index,\n item,\n onItemActivate,\n onGroupToggle,\n targetItem,\n isHighlighted,\n isKeyboardHighlight,\n isExpanded,\n lastInDropdown,\n highlightItem,\n disabled,\n variant,\n position,\n renderItem,\n filteringText,\n filteringEnabled,\n menuId,\n filteringDescriptionId,\n}: CategoryProps) => {\n const highlighted = isHighlighted(item);\n const expanded = isExpanded(item);\n const isKeyboardHighlighted = isKeyboardHighlight(item);\n const triggerRef = React.useRef<HTMLSpanElement>(null);\n\n useEffect(() => {\n if (triggerRef.current && highlighted && !expanded && !filteringEnabled) {\n triggerRef.current.focus();\n }\n }, [expanded, highlighted, filteringEnabled]);\n\n const onClick = (e: React.MouseEvent) => {\n if (!disabled) {\n e.preventDefault();\n onGroupToggle(item, e);\n }\n };\n\n const onHover = () => {\n highlightItem(item);\n };\n\n const isOneTheme = isThemeActive(Theme.OneTheme);\n\n const isDisabledWithReason = !!item.disabledReason && item.disabled;\n const { targetProps, descriptionEl } = useHiddenDescription(item.disabledReason);\n\n const groupProps: ButtonDropdownProps.GroupRenderItem = {\n index: index ?? 0,\n type: 'group',\n option: item as ButtonDropdownProps.ItemGroup,\n disabled: !!disabled,\n highlighted: !!highlighted,\n expanded: expanded,\n expandDirection: 'vertical',\n };\n const renderResult = renderItem?.({ item: groupProps, filterText: filteringText }) ?? null;\n\n const trigger = item.text && (\n <span\n id={menuId && item.id ? `${menuId}-${item.id}` : undefined}\n className={clsx(styles.header, styles['expandable-header'], styles[`variant-${variant}`], {\n [styles.highlighted]: highlighted,\n [styles['rolled-down']]: expanded,\n [styles['no-content-styling']]: !!renderResult,\n [styles.disabled]: disabled,\n [styles['is-focused']]: isKeyboardHighlighted,\n })}\n // When filtering is enabled, we use aria-activedescendant on the filter input and provide\n // the `id` of the item to select it. When filtering is disabled, we are using the roving\n // tabindex technique to manage the focus state of the dropdown. The current element will\n // have tabindex=0 which means that it can be tabbed to, while all other items have\n // tabindex=-1 so we can focus them when necessary.\n tabIndex={filteringEnabled ? -1 : highlighted ? 0 : -1}\n ref={triggerRef}\n {...getMenuItemProps({ parent: true, disabled, expanded })}\n {...(isDisabledWithReason ? targetProps : {})}\n {...getAnalyticsMetadataAttribute(\n disabled\n ? {}\n : ({\n action: 'expand',\n detail: {\n position: position || '0',\n label: { root: 'self' },\n id: item.id || '',\n expanded: `${!expanded}`,\n },\n } as GeneratedAnalyticsMetadataButtonDropdownExpand)\n )}\n >\n {renderResult ? (\n renderResult\n ) : (\n <>\n {(item.iconName || item.iconUrl || item.iconSvg) && (\n <span className={styles['icon-wrapper']}>\n <InternalIcon name={item.iconName} url={item.iconUrl} svg={item.iconSvg} alt={item.iconAlt} />\n </span>\n )}\n <span>{item.text}</span>\n <span\n className={clsx(styles['expand-icon'], {\n [styles['expand-icon-up']]: expanded,\n })}\n >\n <InternalIcon\n name={isOneTheme ? 'angle-down' : 'caret-down-filled'}\n size={isOneTheme ? 'x-small' : 'normal'}\n />\n </span>\n </>\n )}\n </span>\n );\n\n let content: React.ReactNode;\n\n if (isDisabledWithReason) {\n content = (\n <>\n {descriptionEl}\n <Tooltip content={item.disabledReason}>{trigger}</Tooltip>\n </>\n );\n } else if (disabled) {\n content = trigger;\n } else {\n content = (\n <MobileExpandableGroup open={expanded} trigger={trigger}>\n {item.items && expanded && (\n <ul role=\"menu\" aria-label={item.text} className={styles['items-list-container']}>\n <ItemsList\n items={item.items}\n onItemActivate={onItemActivate}\n onGroupToggle={onGroupToggle}\n targetItem={targetItem}\n isHighlighted={isHighlighted}\n isKeyboardHighlight={isKeyboardHighlight}\n isExpanded={isExpanded}\n lastInDropdown={lastInDropdown}\n highlightItem={highlightItem}\n hasCategoryHeader={true}\n variant={variant}\n position={position}\n renderItem={renderItem}\n parentProps={groupProps}\n filteringText={filteringText}\n filteringEnabled={filteringEnabled}\n menuId={menuId}\n filteringDescriptionId={filteringDescriptionId}\n />\n </ul>\n )}\n </MobileExpandableGroup>\n );\n }\n\n return (\n <li\n className={clsx(styles.category, styles[`variant-${variant}`], styles.expandable, {\n [styles.expanded]: expanded,\n [styles.disabled]: disabled,\n [styles.highlighted]: highlighted || expanded,\n [styles.expandable]: true,\n })}\n role=\"presentation\"\n onClick={onClick}\n onMouseEnter={onHover}\n onTouchStart={onHover}\n data-testid={item.id}\n >\n {content}\n </li>\n );\n};\n\nexport default MobileExpandableCategoryElement;\n"]}
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { InternalInputProps } from '../input/internal';
3
+ export interface ButtonDropdownFilterProps extends Omit<InternalInputProps, 'type'> {
4
+ ref?: React.Ref<HTMLInputElement>;
5
+ }
6
+ declare const ButtonDropdownFilter: React.ForwardRefExoticComponent<Pick<ButtonDropdownFilterProps, "style" | "disabled" | "className" | "id" | "name" | "onFocus" | "onBlur" | "onChange" | "onKeyDown" | "onKeyUp" | "placeholder" | "inputMode" | "autoFocus" | "value" | "autoComplete" | "readOnly" | "step" | "invalid" | "ariaLabel" | "ariaDescribedby" | "__internalRootRef" | "warning" | "ariaLabelledby" | "clearAriaLabel" | "__injectAnalyticsComponentMetadata" | "__skipNativeAttributesWarnings" | "ariaRequired" | "controlId" | "nativeInputAttributes" | "disableBrowserAutocorrect" | "spellcheck" | "__leftIcon" | "__leftIconVariant" | "__onLeftIconClick" | "__rightIcon" | "__onRightIconClick" | "__noBorderRadius" | "__onDelayedInput" | "__onBlurWithDetail" | "__inheritFormFieldProps" | "__inlineLabelText" | "__fullWidth"> & React.RefAttributes<HTMLInputElement>>;
7
+ export default ButtonDropdownFilter;
8
+ //# sourceMappingURL=filter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../../../src/button-dropdown/filter.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAsB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAItE,MAAM,WAAW,yBAA0B,SAAQ,IAAI,CAAC,kBAAkB,EAAE,MAAM,CAAC;IACjF,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;CACnC;AAED,QAAA,MAAM,oBAAoB,o0BAuBxB,CAAC;AAEH,eAAe,oBAAoB,CAAC"}
@@ -0,0 +1,18 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import React from 'react';
4
+ import InternalInput from '../input/internal';
5
+ import styles from './styles.css.js';
6
+ const ButtonDropdownFilter = React.forwardRef((props, ref) => {
7
+ return (React.createElement("div", { className: styles.filter },
8
+ React.createElement(InternalInput, { ref: ref, type: "visualSearch", autoComplete: false, disableBrowserAutocorrect: true, invalid: false, __noBorderRadius: true, ...props, nativeInputAttributes: {
9
+ 'aria-expanded': true,
10
+ 'aria-haspopup': true,
11
+ role: 'combobox',
12
+ autoCorrect: 'off',
13
+ autoCapitalize: 'off',
14
+ ...props.nativeInputAttributes,
15
+ }, __skipNativeAttributesWarnings: true })));
16
+ });
17
+ export default ButtonDropdownFilter;
18
+ //# sourceMappingURL=filter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filter.js","sourceRoot":"","sources":["../../../src/button-dropdown/filter.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,aAAqC,MAAM,mBAAmB,CAAC;AAEtE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAMrC,MAAM,oBAAoB,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,KAAgC,EAAE,GAAgC,EAAE,EAAE;IACnH,OAAO,CACL,6BAAK,SAAS,EAAE,MAAM,CAAC,MAAM;QAC3B,oBAAC,aAAa,IACZ,GAAG,EAAE,GAAG,EACR,IAAI,EAAC,cAAc,EACnB,YAAY,EAAE,KAAK,EACnB,yBAAyB,EAAE,IAAI,EAC/B,OAAO,EAAE,KAAK,EACd,gBAAgB,EAAE,IAAI,KAClB,KAAK,EACT,qBAAqB,EAAE;gBACrB,eAAe,EAAE,IAAI;gBACrB,eAAe,EAAE,IAAI;gBACrB,IAAI,EAAE,UAAU;gBAChB,WAAW,EAAE,KAAK;gBAClB,cAAc,EAAE,KAAK;gBACrB,GAAG,KAAK,CAAC,qBAAqB;aAC/B,EACD,8BAA8B,EAAE,IAAI,GACpC,CACE,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,oBAAoB,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 InternalInput, { InternalInputProps } from '../input/internal';\n\nimport styles from './styles.css.js';\n\nexport interface ButtonDropdownFilterProps extends Omit<InternalInputProps, 'type'> {\n ref?: React.Ref<HTMLInputElement>;\n}\n\nconst ButtonDropdownFilter = React.forwardRef((props: ButtonDropdownFilterProps, ref: React.Ref<HTMLInputElement>) => {\n return (\n <div className={styles.filter}>\n <InternalInput\n ref={ref}\n type=\"visualSearch\"\n autoComplete={false}\n disableBrowserAutocorrect={true}\n invalid={false}\n __noBorderRadius={true}\n {...props}\n nativeInputAttributes={{\n 'aria-expanded': true,\n 'aria-haspopup': true,\n role: 'combobox',\n autoCorrect: 'off',\n autoCapitalize: 'off',\n ...props.nativeInputAttributes,\n }}\n __skipNativeAttributesWarnings={true}\n />\n </div>\n );\n});\n\nexport default ButtonDropdownFilter;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/button-dropdown/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAMnD,OAAO,EAAE,mBAAmB,EAAE,CAAC;AAE/B,QAAA,MAAM,cAAc,qGA+EnB,CAAC;AAGF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/button-dropdown/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAMnD,OAAO,EAAE,mBAAmB,EAAE,CAAC;AAE/B,QAAA,MAAM,cAAc,qGA6FnB,CAAC;AAGF,eAAe,cAAc,CAAC"}
@@ -9,9 +9,9 @@ import { applyDisplayName } from '../internal/utils/apply-display-name';
9
9
  import InternalButtonDropdown from './internal';
10
10
  import { hasCheckboxItems, hasDisabledReasonItems } from './utils/utils';
11
11
  import analyticsSelectors from './analytics-metadata/styles.css.js';
12
- const ButtonDropdown = React.forwardRef(({ items, variant = 'normal', loading = false, loadingText, disabled = false, disabledReason, expandableGroups = false, expandToViewport = false, ariaLabel, iconName, iconAlt, iconUrl, iconSvg, children, onItemClick, onItemFollow, mainAction, fullWidth, nativeMainActionAttributes, nativeTriggerAttributes, renderItem, ...props }, ref) => {
12
+ const ButtonDropdown = React.forwardRef(({ items, variant = 'normal', loading = false, loadingText, disabled = false, disabledReason, expandableGroups = false, expandToViewport = false, ariaLabel, iconName, iconAlt, iconUrl, iconSvg, children, onItemClick, onItemFollow, mainAction, fullWidth, nativeMainActionAttributes, nativeTriggerAttributes, renderItem, filteringType = 'none', filteringPlaceholder, filteringAriaLabel, filteringClearAriaLabel, filteringResultsText, noMatch, i18nStrings, ...props }, ref) => {
13
13
  const baseComponentProps = useBaseComponent('ButtonDropdown', {
14
- props: { expandToViewport, expandableGroups, variant, iconName },
14
+ props: { expandToViewport, expandableGroups, variant, iconName, filteringType },
15
15
  metadata: {
16
16
  mainAction: !!mainAction,
17
17
  checkboxItems: hasCheckboxItems(items),
@@ -26,7 +26,7 @@ const ButtonDropdown = React.forwardRef(({ items, variant = 'normal', loading =
26
26
  label: `.${analyticsSelectors['trigger-label']}`,
27
27
  properties: { variant, disabled: `${disabled}` },
28
28
  };
29
- return (React.createElement(InternalButtonDropdown, { ...baseProps, ...baseComponentProps, renderItem: renderItem, ref: ref, items: items, variant: variant, loading: loading, loadingText: loadingText, disabled: disabled, disabledReason: disabledReason, expandableGroups: expandableGroups, expandToViewport: expandToViewport, ariaLabel: ariaLabel, iconName: iconName, iconAlt: iconAlt, iconUrl: iconUrl, iconSvg: iconSvg, onItemClick: onItemClick, onItemFollow: onItemFollow, mainAction: mainAction, fullWidth: fullWidth, nativeMainActionAttributes: nativeMainActionAttributes, nativeTriggerAttributes: nativeTriggerAttributes, ...getAnalyticsMetadataAttribute({
29
+ return (React.createElement(InternalButtonDropdown, { ...baseProps, ...baseComponentProps, renderItem: renderItem, ref: ref, items: items, variant: variant, loading: loading, loadingText: loadingText, disabled: disabled, disabledReason: disabledReason, expandableGroups: expandableGroups, expandToViewport: expandToViewport, ariaLabel: ariaLabel, iconName: iconName, iconAlt: iconAlt, iconUrl: iconUrl, iconSvg: iconSvg, onItemClick: onItemClick, onItemFollow: onItemFollow, mainAction: mainAction, fullWidth: fullWidth, nativeMainActionAttributes: nativeMainActionAttributes, nativeTriggerAttributes: nativeTriggerAttributes, filteringType: filteringType, filteringPlaceholder: filteringPlaceholder, filteringAriaLabel: filteringAriaLabel, filteringClearAriaLabel: filteringClearAriaLabel, filteringResultsText: filteringResultsText, noMatch: noMatch, i18nStrings: i18nStrings, ...getAnalyticsMetadataAttribute({
30
30
  component: analyticsComponentMetadata,
31
31
  }) }, children));
32
32
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/button-dropdown/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAEjH,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAGxE,OAAO,sBAAsB,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAEzE,OAAO,kBAAkB,MAAM,oCAAoC,CAAC;AAIpE,MAAM,cAAc,GAAG,KAAK,CAAC,UAAU,CACrC,CACE,EACE,KAAK,EACL,OAAO,GAAG,QAAQ,EAClB,OAAO,GAAG,KAAK,EACf,WAAW,EACX,QAAQ,GAAG,KAAK,EAChB,cAAc,EACd,gBAAgB,GAAG,KAAK,EACxB,gBAAgB,GAAG,KAAK,EACxB,SAAS,EACT,QAAQ,EACR,OAAO,EACP,OAAO,EACP,OAAO,EACP,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,UAAU,EACV,SAAS,EACT,0BAA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B,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,SAAS,EACpB,0BAA0B,EAAE,0BAA0B,EACtD,uBAAuB,EAAE,uBAAuB,KAC5C,6BAA6B,CAAC;YAChC,SAAS,EAAE,0BAA0B;SACtC,CAAC,IAED,QAAQ,CACc,CAC1B,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAgB,CAAC,cAAc,EAAE,gBAAgB,CAAC,CAAC;AACnD,eAAe,cAAc,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n'use client';\nimport React from 'react';\n\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport { getBaseProps } from '../internal/base-component';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { GeneratedAnalyticsMetadataButtonDropdownComponent } from './analytics-metadata/interfaces';\nimport { ButtonDropdownProps } from './interfaces';\nimport InternalButtonDropdown from './internal';\nimport { hasCheckboxItems, hasDisabledReasonItems } from './utils/utils';\n\nimport analyticsSelectors from './analytics-metadata/styles.css.js';\n\nexport { ButtonDropdownProps };\n\nconst ButtonDropdown = React.forwardRef(\n (\n {\n items,\n variant = 'normal',\n loading = false,\n loadingText,\n disabled = false,\n disabledReason,\n expandableGroups = false,\n expandToViewport = false,\n ariaLabel,\n iconName,\n iconAlt,\n iconUrl,\n iconSvg,\n children,\n onItemClick,\n onItemFollow,\n mainAction,\n fullWidth,\n nativeMainActionAttributes,\n nativeTriggerAttributes,\n renderItem,\n ...props\n }: ButtonDropdownProps,\n ref: React.Ref<ButtonDropdownProps.Ref>\n ) => {\n const baseComponentProps = useBaseComponent('ButtonDropdown', {\n props: { expandToViewport, expandableGroups, variant, iconName },\n metadata: {\n mainAction: !!mainAction,\n checkboxItems: hasCheckboxItems(items),\n hasCustomIcon: Boolean(iconUrl || iconSvg || iconName),\n hasDisabledReason: Boolean(disabledReason),\n hasDisabledReasons: hasDisabledReasonItems(items),\n },\n });\n const baseProps = getBaseProps(props);\n\n const analyticsComponentMetadata: GeneratedAnalyticsMetadataButtonDropdownComponent = {\n name: 'awsui.ButtonDropdown',\n label: `.${analyticsSelectors['trigger-label']}`,\n properties: { variant, disabled: `${disabled}` },\n };\n\n return (\n <InternalButtonDropdown\n {...baseProps}\n {...baseComponentProps}\n renderItem={renderItem}\n ref={ref}\n items={items}\n variant={variant}\n loading={loading}\n loadingText={loadingText}\n disabled={disabled}\n disabledReason={disabledReason}\n expandableGroups={expandableGroups}\n expandToViewport={expandToViewport}\n ariaLabel={ariaLabel}\n iconName={iconName}\n iconAlt={iconAlt}\n iconUrl={iconUrl}\n iconSvg={iconSvg}\n onItemClick={onItemClick}\n onItemFollow={onItemFollow}\n mainAction={mainAction}\n fullWidth={fullWidth}\n nativeMainActionAttributes={nativeMainActionAttributes}\n nativeTriggerAttributes={nativeTriggerAttributes}\n {...getAnalyticsMetadataAttribute({\n component: analyticsComponentMetadata,\n })}\n >\n {children}\n </InternalButtonDropdown>\n );\n }\n);\n\napplyDisplayName(ButtonDropdown, 'ButtonDropdown');\nexport default ButtonDropdown;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/button-dropdown/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAEjH,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAGxE,OAAO,sBAAsB,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAEzE,OAAO,kBAAkB,MAAM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AAC,sBAAsB,OACjB,SAAS,KACT,kBAAkB,EACtB,UAAU,EAAE,UAAU,EACtB,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,cAAc,EAC9B,gBAAgB,EAAE,gBAAgB,EAClC,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,SAAS,EACpB,0BAA0B,EAAE,0BAA0B,EACtD,uBAAuB,EAAE,uBAAuB,EAChD,aAAa,EAAE,aAAa,EAC5B,oBAAoB,EAAE,oBAAoB,EAC1C,kBAAkB,EAAE,kBAAkB,EACtC,uBAAuB,EAAE,uBAAuB,EAChD,oBAAoB,EAAE,oBAAoB,EAC1C,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,WAAW,KACpB,6BAA6B,CAAC;YAChC,SAAS,EAAE,0BAA0B;SACtC,CAAC,IAED,QAAQ,CACc,CAC1B,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAgB,CAAC,cAAc,EAAE,gBAAgB,CAAC,CAAC;AACnD,eAAe,cAAc,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n'use client';\nimport React from 'react';\n\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport { getBaseProps } from '../internal/base-component';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { GeneratedAnalyticsMetadataButtonDropdownComponent } from './analytics-metadata/interfaces';\nimport { ButtonDropdownProps } from './interfaces';\nimport InternalButtonDropdown from './internal';\nimport { hasCheckboxItems, hasDisabledReasonItems } from './utils/utils';\n\nimport analyticsSelectors from './analytics-metadata/styles.css.js';\n\nexport { ButtonDropdownProps };\n\nconst ButtonDropdown = React.forwardRef(\n (\n {\n items,\n variant = 'normal',\n loading = false,\n loadingText,\n disabled = false,\n disabledReason,\n expandableGroups = false,\n expandToViewport = false,\n ariaLabel,\n iconName,\n iconAlt,\n iconUrl,\n iconSvg,\n children,\n onItemClick,\n onItemFollow,\n mainAction,\n fullWidth,\n nativeMainActionAttributes,\n nativeTriggerAttributes,\n renderItem,\n filteringType = 'none',\n filteringPlaceholder,\n filteringAriaLabel,\n filteringClearAriaLabel,\n filteringResultsText,\n noMatch,\n i18nStrings,\n ...props\n }: ButtonDropdownProps,\n ref: React.Ref<ButtonDropdownProps.Ref>\n ) => {\n const baseComponentProps = useBaseComponent('ButtonDropdown', {\n props: { expandToViewport, expandableGroups, variant, iconName, filteringType },\n metadata: {\n mainAction: !!mainAction,\n checkboxItems: hasCheckboxItems(items),\n hasCustomIcon: Boolean(iconUrl || iconSvg || iconName),\n hasDisabledReason: Boolean(disabledReason),\n hasDisabledReasons: hasDisabledReasonItems(items),\n },\n });\n const baseProps = getBaseProps(props);\n\n const analyticsComponentMetadata: GeneratedAnalyticsMetadataButtonDropdownComponent = {\n name: 'awsui.ButtonDropdown',\n label: `.${analyticsSelectors['trigger-label']}`,\n properties: { variant, disabled: `${disabled}` },\n };\n\n return (\n <InternalButtonDropdown\n {...baseProps}\n {...baseComponentProps}\n renderItem={renderItem}\n ref={ref}\n items={items}\n variant={variant}\n loading={loading}\n loadingText={loadingText}\n disabled={disabled}\n disabledReason={disabledReason}\n expandableGroups={expandableGroups}\n expandToViewport={expandToViewport}\n ariaLabel={ariaLabel}\n iconName={iconName}\n iconAlt={iconAlt}\n iconUrl={iconUrl}\n iconSvg={iconSvg}\n onItemClick={onItemClick}\n onItemFollow={onItemFollow}\n mainAction={mainAction}\n fullWidth={fullWidth}\n nativeMainActionAttributes={nativeMainActionAttributes}\n nativeTriggerAttributes={nativeTriggerAttributes}\n filteringType={filteringType}\n filteringPlaceholder={filteringPlaceholder}\n filteringAriaLabel={filteringAriaLabel}\n filteringClearAriaLabel={filteringClearAriaLabel}\n filteringResultsText={filteringResultsText}\n noMatch={noMatch}\n i18nStrings={i18nStrings}\n {...getAnalyticsMetadataAttribute({\n component: analyticsComponentMetadata,\n })}\n >\n {children}\n </InternalButtonDropdown>\n );\n }\n);\n\napplyDisplayName(ButtonDropdown, 'ButtonDropdown');\nexport default ButtonDropdown;\n"]}
@@ -70,6 +70,7 @@ export interface ButtonDropdownProps extends BaseComponentProps, ExpandToViewpor
70
70
  * - `highlighted` (boolean) - Whether the item is currently highlighted.
71
71
  * - `disabled` (boolean) - Whether the item is disabled.
72
72
  * - `parent` (GroupRenderItem | null) - The parent group item, if any.
73
+ * - `filterText` (string) - The current value of the filtering input, when filtering is enabled.
73
74
  *
74
75
  * ### checkbox
75
76
  *
@@ -80,6 +81,7 @@ export interface ButtonDropdownProps extends BaseComponentProps, ExpandToViewpor
80
81
  * - `highlighted` (boolean) - Whether the item is currently highlighted.
81
82
  * - `checked` (boolean) - Controls the state of the checkbox item.
82
83
  * - `parent` (GroupRenderItem | null) - The parent group item, if any.
84
+ * - `filterText` (string) - The current value of the filtering input, when filtering is enabled.
83
85
  *
84
86
  * ### group
85
87
  *
@@ -90,6 +92,7 @@ export interface ButtonDropdownProps extends BaseComponentProps, ExpandToViewpor
90
92
  * - `highlighted` (boolean) - Whether the item is currently highlighted.
91
93
  * - `expanded` (boolean) - Whether the group is expanded.
92
94
  * - `expandDirection` ('vertical' | 'horizontal') - The direction in which the group expands.
95
+ * - `filterText` (string) - The current value of the filtering input, when filtering is enabled.
93
96
  *
94
97
  * When providing a custom `renderItem` implementation, it fully replaces the default visual rendering and content for that item.
95
98
  * The component still manages focus, keyboard interactions, and selection state, but it no longer applies its default item layout or typography.
@@ -184,6 +187,39 @@ export interface ButtonDropdownProps extends BaseComponentProps, ExpandToViewpor
184
187
  * Sets the button width to be 100% of the parent container width. Button content is centered.
185
188
  */
186
189
  fullWidth?: boolean;
190
+ /**
191
+ * Enables filtering of the dropdown items.
192
+ *
193
+ * When set to `auto`, a search input is rendered inside the dropdown and the items are filtered as the user
194
+ * types. Items are matched client-side using a case-insensitive substring match against their `text`,
195
+ * `secondaryText`, and `labelTag`.
196
+ */
197
+ filteringType?: ButtonDropdownProps.FilteringType;
198
+ /**
199
+ * Specifies the placeholder to display in the filtering input. Only relevant when filtering is enabled.
200
+ */
201
+ filteringPlaceholder?: string;
202
+ /**
203
+ * Adds an `aria-label` to the filtering input. Only relevant when filtering is enabled.
204
+ */
205
+ filteringAriaLabel?: string;
206
+ /**
207
+ * Adds an `aria-label` to the clear button inside the filtering input. Only relevant when filtering is enabled.
208
+ * @i18n
209
+ */
210
+ filteringClearAriaLabel?: string;
211
+ /**
212
+ * Specifies the text to display with the number of matches at the bottom of the dropdown menu while filtering.
213
+ */
214
+ filteringResultsText?: (matchesCount: number, totalCount: number) => string;
215
+ /**
216
+ * Displayed when filtering is enabled and there are no matches for the filtering input.
217
+ */
218
+ noMatch?: React.ReactNode;
219
+ /**
220
+ * An object containing all the necessary localized strings required by the component.
221
+ */
222
+ i18nStrings?: ButtonDropdownProps.I18nStrings;
187
223
  /**
188
224
  * Attributes to add to the native `button` element.
189
225
  * Some attributes will be automatically combined with internal attribute values:
@@ -216,6 +252,10 @@ export interface ButtonDropdownProps extends BaseComponentProps, ExpandToViewpor
216
252
  export declare namespace ButtonDropdownProps {
217
253
  type Variant = 'normal' | 'primary' | 'icon' | 'inline-icon';
218
254
  type ItemType = 'action' | 'group';
255
+ type FilteringType = 'auto' | 'none';
256
+ interface I18nStrings {
257
+ filteringItemAriaDescription?: string;
258
+ }
219
259
  interface ActionRenderItem {
220
260
  type: 'action';
221
261
  index: number;
@@ -245,6 +285,7 @@ export declare namespace ButtonDropdownProps {
245
285
  type RenderItem = ActionRenderItem | CheckboxRenderItem | GroupRenderItem;
246
286
  type ItemRenderer = (props: {
247
287
  item: ButtonDropdownProps.RenderItem;
288
+ filterText?: string;
248
289
  }) => ReactNode | null;
249
290
  interface MainAction {
250
291
  text?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/button-dropdown/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAC/E;;GAEG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE9D,MAAM,WAAW,mBAAoB,SAAQ,kBAAkB,EAAE,gBAAgB;IAC/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6CG;IACH,KAAK,EAAE,aAAa,CAAC,mBAAmB,CAAC,WAAW,CAAC,CAAC;IAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuCG;IACH,UAAU,CAAC,EAAE,mBAAmB,CAAC,YAAY,CAAC;IAE9C;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,mBA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C,KAAK,EAAE,mBAAmB,CAAC,SAAS,KAAK,OAAO,CAAC;IAC9D,aAAa,EAAE,CAAC,IAAI,EAAE,mBAAmB,CAAC,WAAW,KAAK,IAAI,CAAC;CAChE;AAED,MAAM,MAAM,WAAW,GAAG,CAAC,IAAI,EAAE,mBAAmB,CAAC,SAAS,EAAE,KAAK,EAAE,KAAK,CAAC,cAAc,KAAK,IAAI,CAAC;AACrG,MAAM,MAAM,YAAY,GAAG,CACzB,IAAI,EAAE,mBAAmB,CAAC,IAAI,GAAG,mBAAmB,CAAC,YAAY,EACjE,KAAK,EAAE,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC,aAAa,KAC1C,IAAI,CAAC;AAEV,MAAM,WAAW,QAAS,SAAQ,mBAAmB,CAAC,IAAI;IACxD,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IACnC,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,QAAQ,EAAE,OAAO,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;CACvB"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/button-dropdown/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { ReactNode } from 'react';\n\nimport { ButtonProps } from '../button/interfaces';\nimport { ExpandToViewport } from '../dropdown/interfaces';\nimport { IconProps } from '../icon/interfaces';\nimport { BaseComponentProps } from '../types/base-component';\nimport { BaseNavigationDetail, CancelableEventHandler } from '../types/events';\n/**\n * @awsuiSystem core\n */\nimport { NativeAttributes } from '../types/native-attributes';\n\nexport interface ButtonDropdownProps extends BaseComponentProps, ExpandToViewport {\n /**\n * Array of objects with a number of supported types.\n *\n * The following properties are supported across all types:\n *\n * - `type` (string) - The type of the item. Can be `action`, `group`, `checkbox`. Defaults to `action` if `items` undefined and `group` otherwise.\n * - `id` (string) - allows to identify the item that the user clicked on. Mandatory for individual items, optional for categories.\n * - `text` (string) - description shown in the menu for this item. Mandatory for individual items, optional for categories.\n * - `lang` (string) - (Optional) The language of the item, provided as a BCP 47 language tag.\n * - `disabled` (boolean) - whether the item is disabled. Disabled items are not clickable, but they can be highlighted with the keyboard to make them accessible.\n * - `disabledReason` (string) - (Optional) Displays text near the `text` property when item is disabled. Use to provide additional context.\n * - `description` (string) - additional data that will be passed to a `data-description` attribute. **Deprecated**, has no effect.\n * - `ariaLabel` (string) - (Optional) - ARIA label of the item element.\n * - `dataAttributes` (Record<string, string>) - (Optional) Custom data attributes for the item element. Attribute names are automatically prefixed with \"data-\". The \"testid\" key is reserved.\n *\n * ### action\n *\n * - `href` (string) - (Optional) Defines the target URL of the menu item, turning it into a link.\n * - `download` (boolean | string) - (Optional) Indicates that the link should be downloaded when clicked. Only works when `href` is also provided. If set to `true`, the browser will use the filename from the URL. If set to a string, that string will be used as the suggested filename.\n * - `external` (boolean) - Marks a menu item as external by adding an icon after the menu item text. The link will open in a new tab when clicked. Note that this only works when `href` is also provided.\n * - `externalIconAriaLabel` (string) - Adds an `aria-label` to the external icon.\n * - `iconName` (string) - (Optional) Specifies the name of the icon, used with the [icon component](/components/icon/).\n * - `iconAlt` (string) - (Optional) Specifies alternate text for the icon when using `iconUrl`.\n * - `iconUrl` (string) - (Optional) Specifies the URL of a custom icon.\n * - `iconSvg` (ReactNode) - (Optional) Custom SVG icon. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n * - `secondaryText` (string) - (Optional) Further information about the action that appears below the label.\n * - `labelTag` (string) - (Optional) - A label tag that provides additional guidance, shown next to the label.\n *\n * ### checkbox\n *\n * When `type` is set to \"checkbox\", the values set to `href`, `external` and `externalIconAriaLabel` will be ignored.\n *\n * - `checked` (boolean) - Controls the state of the checkbox item.\n * - `iconName` (string) - (Optional) Specifies the name of the icon, used with the [icon component](/components/icon/).\n * - `iconAlt` (string) - (Optional) Specifies alternate text for the icon when using `iconUrl`.\n * - `iconUrl` (string) - (Optional) Specifies the URL of a custom icon.\n * - `iconSvg` (ReactNode) - (Optional) Custom SVG icon. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n * - `secondaryText` (string) - (Optional) Further information about the action that appears below the label.\n * - `labelTag` (string) - (Optional) - A label tag that provides additional guidance, shown next to the label.\n *\n * ### group\n *\n * - `items` (ReadonlyArray<Item>) - an array of item objects. Items will be rendered as nested menu items but only for the first nesting level, multi-nesting is not supported.\n * An item which belongs to nested group has the following properties: `id`, `text`, `disabled`, and `description`.\n *\n */\n items: ReadonlyArray<ButtonDropdownProps.ItemOrGroup>;\n\n /**\n * Specifies a render function to render custom options in the dropdown menu.\n *\n * The item inside the props has a different shape depending on its type:\n *\n *\n * ### action\n *\n * - `type` ('action') - The item type.\n * - `index` (number) - The item's position relative to its parent.\n * - `option` (Item) - The original item configuration.\n * - `highlighted` (boolean) - Whether the item is currently highlighted.\n * - `disabled` (boolean) - Whether the item is disabled.\n * - `parent` (GroupRenderItem | null) - The parent group item, if any.\n *\n * ### checkbox\n *\n * - `type` ('checkbox') - The item type.\n * - `index` (number) - The item's position relative to its parent.\n * - `option` (CheckboxItem) - The original item configuration.\n * - `disabled` (boolean) - Whether the item is disabled.\n * - `highlighted` (boolean) - Whether the item is currently highlighted.\n * - `checked` (boolean) - Controls the state of the checkbox item.\n * - `parent` (GroupRenderItem | null) - The parent group item, if any.\n *\n * ### group\n *\n * - `type` ('group') - The item type.\n * - `index` (number) - The item's position in the list.\n * - `option` (ItemGroup) - The original item configuration.\n * - `disabled` (boolean) - Whether the item is disabled.\n * - `highlighted` (boolean) - Whether the item is currently highlighted.\n * - `expanded` (boolean) - Whether the group is expanded.\n * - `expandDirection` ('vertical' | 'horizontal') - The direction in which the group expands.\n *\n * When providing a custom `renderItem` implementation, it fully replaces the default visual rendering and content for that item.\n * The component still manages focus, keyboard interactions, and selection state, but it no longer applies its default item layout or typography.\n *\n * When returning `null`, the default styling will be applied.\n */\n renderItem?: ButtonDropdownProps.ItemRenderer;\n\n /**\n * Determines whether the button dropdown is disabled. Users cannot interact with the control if it's disabled.\n */\n disabled?: boolean;\n /**\n * Provides a reason why the button dropdown is disabled (only when `disabled` is `true`).\n * If provided, the disabled button becomes focusable.\n */\n disabledReason?: string;\n /**\n * Renders the button as being in a loading state. It takes precedence over the `disabled` if both are set to `true`.\n * It prevents clicks.\n */\n loading?: boolean;\n /**\n * Specifies the text that screen reader announces when the button dropdown is in a loading state.\n */\n loadingText?: string;\n /** Determines the general styling of the button dropdown.\n * * `primary` for primary buttons\n * * `normal` for secondary buttons\n * * `icon` for icon buttons\n * * `inline-icon` for icon buttons with no outer padding\n */\n variant?: ButtonDropdownProps.Variant;\n /**\n * Specifies the name of the icon used in the button dropdown trigger, used with the [icon component](/components/icon/).\n * Defaults to `ellipsis`. Applies to the `icon` and `inline-icon` variants only.\n */\n iconName?: IconProps.Name;\n /**\n * Specifies alternate text for a custom icon, for use with `iconUrl`. Applies to the `icon` and `inline-icon` variants only.\n */\n iconAlt?: string;\n /**\n * Specifies the URL of a custom icon. Applies to the `icon` and `inline-icon` variants only.\n *\n * If you set both `iconUrl` and `iconSvg`, `iconSvg` will take precedence.\n */\n iconUrl?: string;\n /**\n * Custom SVG icon. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n * Applies to the `icon` and `inline-icon` variants only.\n *\n * If you set both `iconUrl` and `iconSvg`, `iconSvg` will take precedence.\n */\n iconSvg?: React.ReactNode;\n /**\n * Controls expandability of the item groups.\n */\n expandableGroups?: boolean;\n /**\n * Adds `aria-label` to the button dropdown trigger.\n * Use this to provide an accessible name for buttons that don't have visible text.\n */\n ariaLabel?: string;\n /**\n * Text displayed in the button dropdown trigger.\n * @displayname text\n */\n children?: React.ReactNode;\n /**\n * Called when the user clicks on an item, and the item is not disabled. The event detail object contains the id of the clicked item.\n */\n onItemClick?: CancelableEventHandler<ButtonDropdownProps.ItemClickDetails>;\n /**\n * Called when the user clicks on an item with the left mouse button without pressing\n * modifier keys (that is, CTRL, ALT, SHIFT, META), and the item has an `href` set.\n */\n onItemFollow?: CancelableEventHandler<ButtonDropdownProps.ItemClickDetails>;\n /**\n * A standalone action that is shown prior to the dropdown trigger.\n * Use it with \"primary\" and \"normal\" variant only.\n *\n * Main action properties:\n * * `text` (string) - Specifies the text shown in the main action.\n * * `external` (boolean) - Marks the main action as external by adding an icon after the text. The link will open in a new tab when clicked. Note that this only works when `href` is also provided.\n * * `externalIconAriaLabel` (string) - Adds an ARIA label to the external icon.\n *\n * The main action also supports the following properties of the [button](/components/button/?tabId=api) component:\n * `ariaLabel`, `disabled`, `loading`, `loadingText`, `href`, `target`, `rel`, `download`, `iconAlt`, `iconName`, `iconUrl`, `iconSvg`, `onClick`, `onFollow`.\n */\n mainAction?: ButtonDropdownProps.MainAction;\n\n /**\n * Sets the button width to be 100% of the parent container width. Button content is centered.\n */\n fullWidth?: boolean;\n\n /**\n * Attributes to add to the native `button` element.\n * Some attributes will be automatically combined with internal attribute values:\n * - `className` will be appended.\n * - Event handlers will be chained, unless the default is prevented.\n *\n * We do not support using this attribute to apply custom styling.\n *\n * @awsuiSystem core\n */\n nativeTriggerAttributes?: NativeAttributes<React.ButtonHTMLAttributes<HTMLButtonElement>>;\n\n /**\n * Attributes to add to the native element of the `mainAction`.\n *\n * Specify either `button` for a standard main action, or `anchor` if `html` is set.\n *\n * Some attributes will be automatically combined with internal attribute values:\n * - `className` will be appended.\n * - Event handlers will be chained, unless the default is prevented.\n *\n * We do not support using this attribute to apply custom styling.\n *\n * @awsuiSystem core\n */\n nativeMainActionAttributes?: {\n button?: NativeAttributes<React.ButtonHTMLAttributes<HTMLButtonElement>>;\n anchor?: NativeAttributes<React.AnchorHTMLAttributes<HTMLAnchorElement>>;\n };\n}\n\nexport namespace ButtonDropdownProps {\n export type Variant = 'normal' | 'primary' | 'icon' | 'inline-icon';\n export type ItemType = 'action' | 'group';\n\n export interface ActionRenderItem {\n type: 'action';\n index: number;\n option: Item;\n highlighted: boolean;\n disabled: boolean;\n parent: GroupRenderItem | null;\n }\n export interface CheckboxRenderItem {\n type: 'checkbox';\n index: number;\n option: CheckboxItem;\n disabled: boolean;\n highlighted: boolean;\n checked: boolean;\n parent: GroupRenderItem | null;\n }\n export interface GroupRenderItem {\n type: 'group';\n index: number;\n option: ItemGroup;\n disabled: boolean;\n highlighted: boolean;\n expanded: boolean;\n expandDirection: 'vertical' | 'horizontal';\n }\n\n export type RenderItem = ActionRenderItem | CheckboxRenderItem | GroupRenderItem;\n export type ItemRenderer = (props: { item: ButtonDropdownProps.RenderItem }) => ReactNode | null;\n\n export interface MainAction {\n text?: string;\n ariaLabel?: string;\n onClick?: CancelableEventHandler<ButtonProps.ClickDetail>;\n onFollow?: CancelableEventHandler<ButtonProps.FollowDetail>;\n disabled?: boolean;\n disabledReason?: string;\n loading?: boolean;\n loadingText?: string;\n href?: string;\n target?: string;\n rel?: string;\n download?: boolean | string;\n external?: boolean;\n externalIconAriaLabel?: string;\n iconAlt?: string;\n iconName?: IconProps.Name;\n iconUrl?: string;\n iconSvg?: React.ReactNode;\n }\n\n export interface Item {\n itemType?: ItemType;\n id: string;\n text: string;\n secondaryText?: string;\n ariaLabel?: string;\n lang?: string;\n disabled?: boolean;\n disabledReason?: string;\n /**\n * @deprecated Has no effect.\n */\n description?: string;\n href?: string;\n download?: boolean | string;\n external?: boolean;\n externalIconAriaLabel?: string;\n iconAlt?: string;\n iconName?: IconProps.Name;\n iconUrl?: string;\n iconSvg?: React.ReactNode;\n labelTag?: string;\n dataAttributes?: Record<string, string>;\n }\n\n export interface CheckboxItem\n extends Omit<ButtonDropdownProps.Item, 'href' | 'download' | 'external' | 'externalIconAriaLabel' | 'itemType'> {\n itemType: 'checkbox';\n checked: boolean;\n }\n\n export interface ItemGroup extends Omit<Item, 'id' | 'text' | 'itemType' | 'secondaryText' | 'labelTag'> {\n itemType?: 'group';\n id?: string;\n text?: string;\n items: Items;\n }\n\n export type ItemOrGroup = Item | CheckboxItem | ItemGroup;\n\n export type Items = ReadonlyArray<ItemOrGroup>;\n\n export interface ItemClickDetails extends BaseNavigationDetail {\n id: string;\n checked?: boolean;\n }\n\n export interface Ref {\n /**\n * Focuses the underlying native button. If a main action is defined this will focus that button.\n */\n focus(options?: FocusOptions): void;\n /**\n * Focuses the underlying native button for the dropdown.\n */\n focusDropdownTrigger(options?: FocusOptions): void;\n }\n}\n\nexport interface ButtonDropdownSettings {\n // this means whether action is required to make group expand\n hasExpandableGroups: boolean;\n // on smaller screens expandable groups are integrated into parent dropdown\n // this changes keyboard navigation, highlight and activation behavior for parent dropdown\n isInRestrictedView?: boolean;\n}\n\nexport interface HighlightProps {\n targetItem: ButtonDropdownProps.ItemOrGroup | null;\n isHighlighted: (item: ButtonDropdownProps.ItemOrGroup) => boolean;\n isKeyboardHighlight: (item: ButtonDropdownProps.ItemOrGroup) => boolean;\n isExpanded: (group: ButtonDropdownProps.ItemGroup) => boolean;\n highlightItem: (item: ButtonDropdownProps.ItemOrGroup) => void;\n}\n\nexport type GroupToggle = (item: ButtonDropdownProps.ItemGroup, event: React.SyntheticEvent) => void;\nexport type ItemActivate = (\n item: ButtonDropdownProps.Item | ButtonDropdownProps.CheckboxItem,\n event: React.MouseEvent | React.KeyboardEvent\n) => void;\n\nexport interface LinkItem extends ButtonDropdownProps.Item {\n href: string;\n}\n\nexport interface CustomTriggerProps {\n triggerRef: React.Ref<HTMLElement>;\n testUtilsClass: string;\n ariaLabel: string | undefined;\n disabled: boolean;\n disabledReason?: string;\n isOpen: boolean;\n onClick: () => void;\n ariaExpanded: boolean;\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/button-dropdown/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { ReactNode } from 'react';\n\nimport { ButtonProps } from '../button/interfaces';\nimport { ExpandToViewport } from '../dropdown/interfaces';\nimport { IconProps } from '../icon/interfaces';\nimport { BaseComponentProps } from '../types/base-component';\nimport { BaseNavigationDetail, CancelableEventHandler } from '../types/events';\n/**\n * @awsuiSystem core\n */\nimport { NativeAttributes } from '../types/native-attributes';\n\nexport interface ButtonDropdownProps extends BaseComponentProps, ExpandToViewport {\n /**\n * Array of objects with a number of supported types.\n *\n * The following properties are supported across all types:\n *\n * - `type` (string) - The type of the item. Can be `action`, `group`, `checkbox`. Defaults to `action` if `items` undefined and `group` otherwise.\n * - `id` (string) - allows to identify the item that the user clicked on. Mandatory for individual items, optional for categories.\n * - `text` (string) - description shown in the menu for this item. Mandatory for individual items, optional for categories.\n * - `lang` (string) - (Optional) The language of the item, provided as a BCP 47 language tag.\n * - `disabled` (boolean) - whether the item is disabled. Disabled items are not clickable, but they can be highlighted with the keyboard to make them accessible.\n * - `disabledReason` (string) - (Optional) Displays text near the `text` property when item is disabled. Use to provide additional context.\n * - `description` (string) - additional data that will be passed to a `data-description` attribute. **Deprecated**, has no effect.\n * - `ariaLabel` (string) - (Optional) - ARIA label of the item element.\n * - `dataAttributes` (Record<string, string>) - (Optional) Custom data attributes for the item element. Attribute names are automatically prefixed with \"data-\". The \"testid\" key is reserved.\n *\n * ### action\n *\n * - `href` (string) - (Optional) Defines the target URL of the menu item, turning it into a link.\n * - `download` (boolean | string) - (Optional) Indicates that the link should be downloaded when clicked. Only works when `href` is also provided. If set to `true`, the browser will use the filename from the URL. If set to a string, that string will be used as the suggested filename.\n * - `external` (boolean) - Marks a menu item as external by adding an icon after the menu item text. The link will open in a new tab when clicked. Note that this only works when `href` is also provided.\n * - `externalIconAriaLabel` (string) - Adds an `aria-label` to the external icon.\n * - `iconName` (string) - (Optional) Specifies the name of the icon, used with the [icon component](/components/icon/).\n * - `iconAlt` (string) - (Optional) Specifies alternate text for the icon when using `iconUrl`.\n * - `iconUrl` (string) - (Optional) Specifies the URL of a custom icon.\n * - `iconSvg` (ReactNode) - (Optional) Custom SVG icon. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n * - `secondaryText` (string) - (Optional) Further information about the action that appears below the label.\n * - `labelTag` (string) - (Optional) - A label tag that provides additional guidance, shown next to the label.\n *\n * ### checkbox\n *\n * When `type` is set to \"checkbox\", the values set to `href`, `external` and `externalIconAriaLabel` will be ignored.\n *\n * - `checked` (boolean) - Controls the state of the checkbox item.\n * - `iconName` (string) - (Optional) Specifies the name of the icon, used with the [icon component](/components/icon/).\n * - `iconAlt` (string) - (Optional) Specifies alternate text for the icon when using `iconUrl`.\n * - `iconUrl` (string) - (Optional) Specifies the URL of a custom icon.\n * - `iconSvg` (ReactNode) - (Optional) Custom SVG icon. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n * - `secondaryText` (string) - (Optional) Further information about the action that appears below the label.\n * - `labelTag` (string) - (Optional) - A label tag that provides additional guidance, shown next to the label.\n *\n * ### group\n *\n * - `items` (ReadonlyArray<Item>) - an array of item objects. Items will be rendered as nested menu items but only for the first nesting level, multi-nesting is not supported.\n * An item which belongs to nested group has the following properties: `id`, `text`, `disabled`, and `description`.\n *\n */\n items: ReadonlyArray<ButtonDropdownProps.ItemOrGroup>;\n\n /**\n * Specifies a render function to render custom options in the dropdown menu.\n *\n * The item inside the props has a different shape depending on its type:\n *\n *\n * ### action\n *\n * - `type` ('action') - The item type.\n * - `index` (number) - The item's position relative to its parent.\n * - `option` (Item) - The original item configuration.\n * - `highlighted` (boolean) - Whether the item is currently highlighted.\n * - `disabled` (boolean) - Whether the item is disabled.\n * - `parent` (GroupRenderItem | null) - The parent group item, if any.\n * - `filterText` (string) - The current value of the filtering input, when filtering is enabled.\n *\n * ### checkbox\n *\n * - `type` ('checkbox') - The item type.\n * - `index` (number) - The item's position relative to its parent.\n * - `option` (CheckboxItem) - The original item configuration.\n * - `disabled` (boolean) - Whether the item is disabled.\n * - `highlighted` (boolean) - Whether the item is currently highlighted.\n * - `checked` (boolean) - Controls the state of the checkbox item.\n * - `parent` (GroupRenderItem | null) - The parent group item, if any.\n * - `filterText` (string) - The current value of the filtering input, when filtering is enabled.\n *\n * ### group\n *\n * - `type` ('group') - The item type.\n * - `index` (number) - The item's position in the list.\n * - `option` (ItemGroup) - The original item configuration.\n * - `disabled` (boolean) - Whether the item is disabled.\n * - `highlighted` (boolean) - Whether the item is currently highlighted.\n * - `expanded` (boolean) - Whether the group is expanded.\n * - `expandDirection` ('vertical' | 'horizontal') - The direction in which the group expands.\n * - `filterText` (string) - The current value of the filtering input, when filtering is enabled.\n *\n * When providing a custom `renderItem` implementation, it fully replaces the default visual rendering and content for that item.\n * The component still manages focus, keyboard interactions, and selection state, but it no longer applies its default item layout or typography.\n *\n * When returning `null`, the default styling will be applied.\n */\n renderItem?: ButtonDropdownProps.ItemRenderer;\n\n /**\n * Determines whether the button dropdown is disabled. Users cannot interact with the control if it's disabled.\n */\n disabled?: boolean;\n /**\n * Provides a reason why the button dropdown is disabled (only when `disabled` is `true`).\n * If provided, the disabled button becomes focusable.\n */\n disabledReason?: string;\n /**\n * Renders the button as being in a loading state. It takes precedence over the `disabled` if both are set to `true`.\n * It prevents clicks.\n */\n loading?: boolean;\n /**\n * Specifies the text that screen reader announces when the button dropdown is in a loading state.\n */\n loadingText?: string;\n /** Determines the general styling of the button dropdown.\n * * `primary` for primary buttons\n * * `normal` for secondary buttons\n * * `icon` for icon buttons\n * * `inline-icon` for icon buttons with no outer padding\n */\n variant?: ButtonDropdownProps.Variant;\n /**\n * Specifies the name of the icon used in the button dropdown trigger, used with the [icon component](/components/icon/).\n * Defaults to `ellipsis`. Applies to the `icon` and `inline-icon` variants only.\n */\n iconName?: IconProps.Name;\n /**\n * Specifies alternate text for a custom icon, for use with `iconUrl`. Applies to the `icon` and `inline-icon` variants only.\n */\n iconAlt?: string;\n /**\n * Specifies the URL of a custom icon. Applies to the `icon` and `inline-icon` variants only.\n *\n * If you set both `iconUrl` and `iconSvg`, `iconSvg` will take precedence.\n */\n iconUrl?: string;\n /**\n * Custom SVG icon. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n * Applies to the `icon` and `inline-icon` variants only.\n *\n * If you set both `iconUrl` and `iconSvg`, `iconSvg` will take precedence.\n */\n iconSvg?: React.ReactNode;\n /**\n * Controls expandability of the item groups.\n */\n expandableGroups?: boolean;\n /**\n * Adds `aria-label` to the button dropdown trigger.\n * Use this to provide an accessible name for buttons that don't have visible text.\n */\n ariaLabel?: string;\n /**\n * Text displayed in the button dropdown trigger.\n * @displayname text\n */\n children?: React.ReactNode;\n /**\n * Called when the user clicks on an item, and the item is not disabled. The event detail object contains the id of the clicked item.\n */\n onItemClick?: CancelableEventHandler<ButtonDropdownProps.ItemClickDetails>;\n /**\n * Called when the user clicks on an item with the left mouse button without pressing\n * modifier keys (that is, CTRL, ALT, SHIFT, META), and the item has an `href` set.\n */\n onItemFollow?: CancelableEventHandler<ButtonDropdownProps.ItemClickDetails>;\n /**\n * A standalone action that is shown prior to the dropdown trigger.\n * Use it with \"primary\" and \"normal\" variant only.\n *\n * Main action properties:\n * * `text` (string) - Specifies the text shown in the main action.\n * * `external` (boolean) - Marks the main action as external by adding an icon after the text. The link will open in a new tab when clicked. Note that this only works when `href` is also provided.\n * * `externalIconAriaLabel` (string) - Adds an ARIA label to the external icon.\n *\n * The main action also supports the following properties of the [button](/components/button/?tabId=api) component:\n * `ariaLabel`, `disabled`, `loading`, `loadingText`, `href`, `target`, `rel`, `download`, `iconAlt`, `iconName`, `iconUrl`, `iconSvg`, `onClick`, `onFollow`.\n */\n mainAction?: ButtonDropdownProps.MainAction;\n\n /**\n * Sets the button width to be 100% of the parent container width. Button content is centered.\n */\n fullWidth?: boolean;\n\n /**\n * Enables filtering of the dropdown items.\n *\n * When set to `auto`, a search input is rendered inside the dropdown and the items are filtered as the user\n * types. Items are matched client-side using a case-insensitive substring match against their `text`,\n * `secondaryText`, and `labelTag`.\n */\n filteringType?: ButtonDropdownProps.FilteringType;\n\n /**\n * Specifies the placeholder to display in the filtering input. Only relevant when filtering is enabled.\n */\n filteringPlaceholder?: string;\n\n /**\n * Adds an `aria-label` to the filtering input. Only relevant when filtering is enabled.\n */\n filteringAriaLabel?: string;\n\n /**\n * Adds an `aria-label` to the clear button inside the filtering input. Only relevant when filtering is enabled.\n * @i18n\n */\n filteringClearAriaLabel?: string;\n\n /**\n * Specifies the text to display with the number of matches at the bottom of the dropdown menu while filtering.\n */\n filteringResultsText?: (matchesCount: number, totalCount: number) => string;\n\n /**\n * Displayed when filtering is enabled and there are no matches for the filtering input.\n */\n noMatch?: React.ReactNode;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n */\n i18nStrings?: ButtonDropdownProps.I18nStrings;\n\n /**\n * Attributes to add to the native `button` element.\n * Some attributes will be automatically combined with internal attribute values:\n * - `className` will be appended.\n * - Event handlers will be chained, unless the default is prevented.\n *\n * We do not support using this attribute to apply custom styling.\n *\n * @awsuiSystem core\n */\n nativeTriggerAttributes?: NativeAttributes<React.ButtonHTMLAttributes<HTMLButtonElement>>;\n\n /**\n * Attributes to add to the native element of the `mainAction`.\n *\n * Specify either `button` for a standard main action, or `anchor` if `html` is set.\n *\n * Some attributes will be automatically combined with internal attribute values:\n * - `className` will be appended.\n * - Event handlers will be chained, unless the default is prevented.\n *\n * We do not support using this attribute to apply custom styling.\n *\n * @awsuiSystem core\n */\n nativeMainActionAttributes?: {\n button?: NativeAttributes<React.ButtonHTMLAttributes<HTMLButtonElement>>;\n anchor?: NativeAttributes<React.AnchorHTMLAttributes<HTMLAnchorElement>>;\n };\n}\n\nexport namespace ButtonDropdownProps {\n export type Variant = 'normal' | 'primary' | 'icon' | 'inline-icon';\n export type ItemType = 'action' | 'group';\n export type FilteringType = 'auto' | 'none';\n\n export interface I18nStrings {\n filteringItemAriaDescription?: string;\n }\n\n export interface ActionRenderItem {\n type: 'action';\n index: number;\n option: Item;\n highlighted: boolean;\n disabled: boolean;\n parent: GroupRenderItem | null;\n }\n export interface CheckboxRenderItem {\n type: 'checkbox';\n index: number;\n option: CheckboxItem;\n disabled: boolean;\n highlighted: boolean;\n checked: boolean;\n parent: GroupRenderItem | null;\n }\n export interface GroupRenderItem {\n type: 'group';\n index: number;\n option: ItemGroup;\n disabled: boolean;\n highlighted: boolean;\n expanded: boolean;\n expandDirection: 'vertical' | 'horizontal';\n }\n\n export type RenderItem = ActionRenderItem | CheckboxRenderItem | GroupRenderItem;\n export type ItemRenderer = (props: { item: ButtonDropdownProps.RenderItem; filterText?: string }) => ReactNode | null;\n\n export interface MainAction {\n text?: string;\n ariaLabel?: string;\n onClick?: CancelableEventHandler<ButtonProps.ClickDetail>;\n onFollow?: CancelableEventHandler<ButtonProps.FollowDetail>;\n disabled?: boolean;\n disabledReason?: string;\n loading?: boolean;\n loadingText?: string;\n href?: string;\n target?: string;\n rel?: string;\n download?: boolean | string;\n external?: boolean;\n externalIconAriaLabel?: string;\n iconAlt?: string;\n iconName?: IconProps.Name;\n iconUrl?: string;\n iconSvg?: React.ReactNode;\n }\n\n export interface Item {\n itemType?: ItemType;\n id: string;\n text: string;\n secondaryText?: string;\n ariaLabel?: string;\n lang?: string;\n disabled?: boolean;\n disabledReason?: string;\n /**\n * @deprecated Has no effect.\n */\n description?: string;\n href?: string;\n download?: boolean | string;\n external?: boolean;\n externalIconAriaLabel?: string;\n iconAlt?: string;\n iconName?: IconProps.Name;\n iconUrl?: string;\n iconSvg?: React.ReactNode;\n labelTag?: string;\n dataAttributes?: Record<string, string>;\n }\n\n export interface CheckboxItem\n extends Omit<ButtonDropdownProps.Item, 'href' | 'download' | 'external' | 'externalIconAriaLabel' | 'itemType'> {\n itemType: 'checkbox';\n checked: boolean;\n }\n\n export interface ItemGroup extends Omit<Item, 'id' | 'text' | 'itemType' | 'secondaryText' | 'labelTag'> {\n itemType?: 'group';\n id?: string;\n text?: string;\n items: Items;\n }\n\n export type ItemOrGroup = Item | CheckboxItem | ItemGroup;\n\n export type Items = ReadonlyArray<ItemOrGroup>;\n\n export interface ItemClickDetails extends BaseNavigationDetail {\n id: string;\n checked?: boolean;\n }\n\n export interface Ref {\n /**\n * Focuses the underlying native button. If a main action is defined this will focus that button.\n */\n focus(options?: FocusOptions): void;\n /**\n * Focuses the underlying native button for the dropdown.\n */\n focusDropdownTrigger(options?: FocusOptions): void;\n }\n}\n\nexport interface ButtonDropdownSettings {\n // this means whether action is required to make group expand\n hasExpandableGroups: boolean;\n // on smaller screens expandable groups are integrated into parent dropdown\n // this changes keyboard navigation, highlight and activation behavior for parent dropdown\n isInRestrictedView?: boolean;\n}\n\nexport interface HighlightProps {\n targetItem: ButtonDropdownProps.ItemOrGroup | null;\n isHighlighted: (item: ButtonDropdownProps.ItemOrGroup) => boolean;\n isKeyboardHighlight: (item: ButtonDropdownProps.ItemOrGroup) => boolean;\n isExpanded: (group: ButtonDropdownProps.ItemGroup) => boolean;\n highlightItem: (item: ButtonDropdownProps.ItemOrGroup) => void;\n}\n\nexport type GroupToggle = (item: ButtonDropdownProps.ItemGroup, event: React.SyntheticEvent) => void;\nexport type ItemActivate = (\n item: ButtonDropdownProps.Item | ButtonDropdownProps.CheckboxItem,\n event: React.MouseEvent | React.KeyboardEvent\n) => void;\n\nexport interface LinkItem extends ButtonDropdownProps.Item {\n href: string;\n}\n\nexport interface CustomTriggerProps {\n triggerRef: React.Ref<HTMLElement>;\n testUtilsClass: string;\n ariaLabel: string | undefined;\n disabled: boolean;\n disabledReason?: string;\n isOpen: boolean;\n onClick: () => void;\n ariaExpanded: boolean;\n}\n"]}
@@ -13,6 +13,10 @@ export interface CategoryProps extends HighlightProps {
13
13
  variant?: ItemListProps['variant'];
14
14
  position?: string;
15
15
  renderItem?: ButtonDropdownProps.ItemRenderer;
16
+ filteringText?: string;
17
+ filteringEnabled?: boolean;
18
+ menuId?: string;
19
+ filteringDescriptionId?: string;
16
20
  }
17
21
  export interface ItemListProps extends HighlightProps {
18
22
  items: ButtonDropdownProps.Items;
@@ -29,6 +33,10 @@ export interface ItemListProps extends HighlightProps {
29
33
  linkStyle?: boolean;
30
34
  renderItem?: ButtonDropdownProps.ItemRenderer;
31
35
  parentProps?: ButtonDropdownProps.GroupRenderItem;
36
+ filteringText?: string;
37
+ filteringEnabled?: boolean;
38
+ menuId?: string;
39
+ filteringDescriptionId?: string;
32
40
  }
33
41
  export interface ItemProps {
34
42
  index?: number;
@@ -46,6 +54,10 @@ export interface ItemProps {
46
54
  linkStyle?: boolean;
47
55
  renderItem?: ButtonDropdownProps.ItemRenderer;
48
56
  parentProps?: ButtonDropdownProps.GroupRenderItem;
57
+ filteringText?: string;
58
+ filteringEnabled?: boolean;
59
+ menuId?: string;
60
+ filteringDescriptionId?: string;
49
61
  }
50
62
  export interface InternalItem extends ButtonDropdownProps.Item {
51
63
  badge?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"internal-interfaces.d.ts","sourceRoot":"","sources":["../../../src/button-dropdown/internal-interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kCAAkC,EAAE,MAAM,kEAAkE,CAAC;AAEtH,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,WAAW,EACX,cAAc,EACd,YAAY,EACZ,QAAQ,EACT,MAAM,cAAc,CAAC;AAEtB,MAAM,WAAW,aAAc,SAAQ,cAAc;IACnD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,mBAAmB,CAAC,SAAS,CAAC;IACpC,aAAa,EAAE,WAAW,CAAC;IAC3B,cAAc,EAAE,YAAY,CAAC;IAC7B,QAAQ,EAAE,OAAO,CAAC;IAClB,cAAc,EAAE,OAAO,CAAC;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,OAAO,CA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;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,4BAA4B,CAAC,EAAE,CAAC,KAAK,EAAE,kCAAkC,KAAK,kCAAkC,CAAC;IAEjH;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
@@ -1 +1 @@
1
- {"version":3,"file":"internal-interfaces.js","sourceRoot":"","sources":["../../../src/button-dropdown/internal-interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { GeneratedAnalyticsMetadataFragment } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport {\n ButtonDropdownProps,\n CustomTriggerProps,\n GroupToggle,\n HighlightProps,\n ItemActivate,\n LinkItem,\n} from './interfaces';\n\nexport interface CategoryProps extends HighlightProps {\n index?: number;\n item: ButtonDropdownProps.ItemGroup;\n onGroupToggle: GroupToggle;\n onItemActivate: ItemActivate;\n disabled: boolean;\n lastInDropdown: boolean;\n expandToViewport?: boolean;\n variant?: ItemListProps['variant'];\n position?: string;\n renderItem?: ButtonDropdownProps.ItemRenderer;\n}\n\nexport interface ItemListProps extends HighlightProps {\n items: ButtonDropdownProps.Items;\n onGroupToggle: GroupToggle;\n onItemActivate: ItemActivate;\n categoryDisabled?: boolean;\n hasExpandableGroups?: boolean;\n hasCategoryHeader?: boolean;\n lastInDropdown: boolean;\n expandToViewport?: boolean;\n variant?: InternalButtonDropdownProps['variant'];\n position?: string;\n analyticsMetadataTransformer?: InternalButtonDropdownProps['analyticsMetadataTransformer'];\n linkStyle?: boolean;\n renderItem?: ButtonDropdownProps.ItemRenderer;\n parentProps?: ButtonDropdownProps.GroupRenderItem;\n}\n\nexport interface ItemProps {\n index?: number;\n item: ButtonDropdownProps.Item | ButtonDropdownProps.CheckboxItem | LinkItem;\n disabled: boolean;\n highlighted: boolean;\n onItemActivate: ItemActivate;\n highlightItem: (item: ButtonDropdownProps.ItemOrGroup) => void;\n showDivider: boolean;\n hasCategoryHeader: boolean;\n isKeyboardHighlighted?: boolean;\n variant?: ItemListProps['variant'];\n position?: string;\n analyticsMetadataTransformer?: InternalButtonDropdownProps['analyticsMetadataTransformer'];\n linkStyle?: boolean;\n renderItem?: ButtonDropdownProps.ItemRenderer;\n parentProps?: ButtonDropdownProps.GroupRenderItem;\n}\n\nexport interface InternalItem extends ButtonDropdownProps.Item {\n badge?: boolean;\n /**\n * Used in breadcrumb-group: indicates that this breadcrumb item is the current page\n */\n isCurrentBreadcrumb?: boolean;\n}\n\nexport interface InternalCheckboxItem extends ButtonDropdownProps.CheckboxItem {\n badge?: boolean;\n}\n\ninterface InternalItemGroup extends Omit<ButtonDropdownProps.ItemGroup, 'items'> {\n items: InternalItems;\n}\n\ntype InternalItems = ReadonlyArray<InternalItemOrGroup>;\n\nexport type InternalItemOrGroup = InternalItem | InternalCheckboxItem | InternalItemGroup;\n\nexport interface InternalButtonDropdownProps\n extends Omit<ButtonDropdownProps, 'variant' | 'items'>,\n InternalBaseComponentProps {\n customTriggerBuilder?: (props: CustomTriggerProps) => React.ReactNode;\n variant?: ButtonDropdownProps['variant'] | 'navigation';\n items: ReadonlyArray<InternalItemOrGroup>;\n\n /**\n * Optional text that is displayed as the title at the top of the dropdown.\n */\n title?: string;\n\n /**\n * Optional text that is displayed underneath the title at the top of the dropdown.\n */\n description?: string;\n\n /**\n * Only show main action button as a regular, non-split button.\n * That is needed so that button dropdown test utils wrapper can still be used.\n */\n showMainActionOnly?: boolean;\n\n /**\n * Determines that the dropdown should preferably be aligned to the center of the trigger\n * instead of dropping left or right.\n */\n preferCenter?: boolean;\n\n /**\n * Determines whether simple items should be displayed with the link styles.\n * Used in Breadcrumb group component for collapsed breadcrumbs\n */\n linkStyle?: boolean;\n\n /**\n * Determines whether the dropdown should take up the full available width.\n * Used in Breadcrumb group component for collapsed breadcrumbs\n */\n fullWidth?: boolean;\n\n analyticsMetadataTransformer?: (input: GeneratedAnalyticsMetadataFragment) => GeneratedAnalyticsMetadataFragment;\n\n /**\n * Position of the button dropdown inside a list of elements, for example a button group\n */\n position?: string;\n}\n"]}
1
+ {"version":3,"file":"internal-interfaces.js","sourceRoot":"","sources":["../../../src/button-dropdown/internal-interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { GeneratedAnalyticsMetadataFragment } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport {\n ButtonDropdownProps,\n CustomTriggerProps,\n GroupToggle,\n HighlightProps,\n ItemActivate,\n LinkItem,\n} from './interfaces';\n\nexport interface CategoryProps extends HighlightProps {\n index?: number;\n item: ButtonDropdownProps.ItemGroup;\n onGroupToggle: GroupToggle;\n onItemActivate: ItemActivate;\n disabled: boolean;\n lastInDropdown: boolean;\n expandToViewport?: boolean;\n variant?: ItemListProps['variant'];\n position?: string;\n renderItem?: ButtonDropdownProps.ItemRenderer;\n filteringText?: string;\n filteringEnabled?: boolean;\n menuId?: string;\n filteringDescriptionId?: string;\n}\n\nexport interface ItemListProps extends HighlightProps {\n items: ButtonDropdownProps.Items;\n onGroupToggle: GroupToggle;\n onItemActivate: ItemActivate;\n categoryDisabled?: boolean;\n hasExpandableGroups?: boolean;\n hasCategoryHeader?: boolean;\n lastInDropdown: boolean;\n expandToViewport?: boolean;\n variant?: InternalButtonDropdownProps['variant'];\n position?: string;\n analyticsMetadataTransformer?: InternalButtonDropdownProps['analyticsMetadataTransformer'];\n linkStyle?: boolean;\n renderItem?: ButtonDropdownProps.ItemRenderer;\n parentProps?: ButtonDropdownProps.GroupRenderItem;\n filteringText?: string;\n filteringEnabled?: boolean;\n menuId?: string;\n filteringDescriptionId?: string;\n}\n\nexport interface ItemProps {\n index?: number;\n item: ButtonDropdownProps.Item | ButtonDropdownProps.CheckboxItem | LinkItem;\n disabled: boolean;\n highlighted: boolean;\n onItemActivate: ItemActivate;\n highlightItem: (item: ButtonDropdownProps.ItemOrGroup) => void;\n showDivider: boolean;\n hasCategoryHeader: boolean;\n isKeyboardHighlighted?: boolean;\n variant?: ItemListProps['variant'];\n position?: string;\n analyticsMetadataTransformer?: InternalButtonDropdownProps['analyticsMetadataTransformer'];\n linkStyle?: boolean;\n renderItem?: ButtonDropdownProps.ItemRenderer;\n parentProps?: ButtonDropdownProps.GroupRenderItem;\n filteringText?: string;\n filteringEnabled?: boolean;\n menuId?: string;\n filteringDescriptionId?: string;\n}\n\nexport interface InternalItem extends ButtonDropdownProps.Item {\n badge?: boolean;\n /**\n * Used in breadcrumb-group: indicates that this breadcrumb item is the current page\n */\n isCurrentBreadcrumb?: boolean;\n}\n\nexport interface InternalCheckboxItem extends ButtonDropdownProps.CheckboxItem {\n badge?: boolean;\n}\n\ninterface InternalItemGroup extends Omit<ButtonDropdownProps.ItemGroup, 'items'> {\n items: InternalItems;\n}\n\ntype InternalItems = ReadonlyArray<InternalItemOrGroup>;\n\nexport type InternalItemOrGroup = InternalItem | InternalCheckboxItem | InternalItemGroup;\n\nexport interface InternalButtonDropdownProps\n extends Omit<ButtonDropdownProps, 'variant' | 'items'>,\n InternalBaseComponentProps {\n customTriggerBuilder?: (props: CustomTriggerProps) => React.ReactNode;\n variant?: ButtonDropdownProps['variant'] | 'navigation';\n items: ReadonlyArray<InternalItemOrGroup>;\n\n /**\n * Optional text that is displayed as the title at the top of the dropdown.\n */\n title?: string;\n\n /**\n * Optional text that is displayed underneath the title at the top of the dropdown.\n */\n description?: string;\n\n /**\n * Only show main action button as a regular, non-split button.\n * That is needed so that button dropdown test utils wrapper can still be used.\n */\n showMainActionOnly?: boolean;\n\n /**\n * Determines that the dropdown should preferably be aligned to the center of the trigger\n * instead of dropping left or right.\n */\n preferCenter?: boolean;\n\n /**\n * Determines whether simple items should be displayed with the link styles.\n * Used in Breadcrumb group component for collapsed breadcrumbs\n */\n linkStyle?: boolean;\n\n /**\n * Determines whether the dropdown should take up the full available width.\n * Used in Breadcrumb group component for collapsed breadcrumbs\n */\n fullWidth?: boolean;\n\n analyticsMetadataTransformer?: (input: GeneratedAnalyticsMetadataFragment) => GeneratedAnalyticsMetadataFragment;\n\n /**\n * Position of the button dropdown inside a list of elements, for example a button group\n */\n position?: string;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/button-dropdown/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAiD,MAAM,OAAO,CAAC;AAuBtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,2BAA2B,EAAgB,MAAM,uBAAuB,CAAC;AAQlF,QAAA,MAAM,sBAAsB,6GA2Z3B,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/button-dropdown/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA0D,MAAM,OAAO,CAAC;AA2B/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,2BAA2B,EAAgB,MAAM,uBAAuB,CAAC;AASlF,QAAA,MAAM,sBAAsB,6GA2e3B,CAAC;AAEF,eAAe,sBAAsB,CAAC"}