@cloudscape-design/components 3.0.1411 → 3.0.1412

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 (105) hide show
  1. package/action-card/internal.d.ts +10 -2
  2. package/action-card/internal.d.ts.map +1 -1
  3. package/action-card/internal.js +5 -5
  4. package/action-card/internal.js.map +1 -1
  5. package/action-card/styles.css.js +18 -17
  6. package/action-card/styles.scoped.css +274 -202
  7. package/action-card/styles.selectors.js +18 -17
  8. package/app-layout/visual-refresh-toolbar/skeleton/toolbar-container.d.ts.map +1 -1
  9. package/app-layout/visual-refresh-toolbar/skeleton/toolbar-container.js +3 -1
  10. package/app-layout/visual-refresh-toolbar/skeleton/toolbar-container.js.map +1 -1
  11. package/button-dropdown/filter.d.ts +1 -1
  12. package/internal/base-component/styles.scoped.css +1 -1
  13. package/internal/components/listbox/interfaces.d.ts +12 -0
  14. package/internal/components/listbox/interfaces.d.ts.map +1 -0
  15. package/internal/components/listbox/interfaces.js +2 -0
  16. package/internal/components/listbox/interfaces.js.map +1 -0
  17. package/internal/components/listbox/parts/get-item-props.d.ts +1 -3
  18. package/internal/components/listbox/parts/get-item-props.d.ts.map +1 -1
  19. package/internal/components/listbox/parts/get-item-props.js +1 -2
  20. package/internal/components/listbox/parts/get-item-props.js.map +1 -1
  21. package/internal/components/listbox/parts/item.d.ts +43 -0
  22. package/internal/components/listbox/parts/item.d.ts.map +1 -0
  23. package/internal/components/listbox/parts/item.js +184 -0
  24. package/internal/components/listbox/parts/item.js.map +1 -0
  25. package/internal/components/listbox/parts/plain-list.d.ts +23 -0
  26. package/internal/components/listbox/parts/plain-list.d.ts.map +1 -0
  27. package/{select → internal/components/listbox}/parts/plain-list.js +9 -10
  28. package/internal/components/listbox/parts/plain-list.js.map +1 -0
  29. package/internal/components/listbox/parts/render-options.d.ts +3 -4
  30. package/internal/components/listbox/parts/render-options.d.ts.map +1 -1
  31. package/internal/components/listbox/parts/render-options.js +3 -6
  32. package/internal/components/listbox/parts/render-options.js.map +1 -1
  33. package/internal/components/listbox/use-listbox.d.ts +95 -0
  34. package/internal/components/listbox/use-listbox.d.ts.map +1 -0
  35. package/internal/components/listbox/use-listbox.js +117 -0
  36. package/internal/components/listbox/use-listbox.js.map +1 -0
  37. package/internal/components/listbox/use-type-ahead.d.ts +18 -0
  38. package/internal/components/listbox/use-type-ahead.d.ts.map +1 -0
  39. package/{select/utils/use-native-search.js → internal/components/listbox/use-type-ahead.js} +8 -8
  40. package/internal/components/listbox/use-type-ahead.js.map +1 -0
  41. package/internal/components/listbox/utils/navigation.d.ts +27 -0
  42. package/internal/components/listbox/utils/navigation.d.ts.map +1 -0
  43. package/internal/components/listbox/utils/navigation.js +22 -0
  44. package/internal/components/listbox/utils/navigation.js.map +1 -0
  45. package/internal/components/listbox/utils/option-props.d.ts +35 -0
  46. package/internal/components/listbox/utils/option-props.d.ts.map +1 -0
  47. package/internal/components/listbox/utils/option-props.js +51 -0
  48. package/internal/components/listbox/utils/option-props.js.map +1 -0
  49. package/internal/components/options-list/utils/use-keyboard.d.ts +1 -1
  50. package/internal/components/options-list/utils/use-keyboard.d.ts.map +1 -1
  51. package/internal/components/options-list/utils/use-keyboard.js +2 -2
  52. package/internal/components/options-list/utils/use-keyboard.js.map +1 -1
  53. package/internal/environment.js +2 -2
  54. package/internal/environment.json +2 -2
  55. package/internal/manifest.json +1 -1
  56. package/item-card/internal.d.ts +11 -1
  57. package/item-card/internal.d.ts.map +1 -1
  58. package/item-card/internal.js +4 -4
  59. package/item-card/internal.js.map +1 -1
  60. package/item-card/style.d.ts.map +1 -1
  61. package/item-card/style.js +6 -1
  62. package/item-card/style.js.map +1 -1
  63. package/item-card/styles.css.js +14 -14
  64. package/item-card/styles.scoped.css +125 -63
  65. package/item-card/styles.selectors.js +14 -14
  66. package/manifest.json +2 -2
  67. package/multiselect/embedded.d.ts.map +1 -1
  68. package/multiselect/embedded.js +2 -2
  69. package/multiselect/embedded.js.map +1 -1
  70. package/multiselect/internal.d.ts.map +1 -1
  71. package/multiselect/internal.js +2 -2
  72. package/multiselect/internal.js.map +1 -1
  73. package/multiselect/use-multiselect.d.ts +2 -3
  74. package/multiselect/use-multiselect.d.ts.map +1 -1
  75. package/multiselect/use-multiselect.js +7 -18
  76. package/multiselect/use-multiselect.js.map +1 -1
  77. package/package.json +1 -1
  78. package/select/internal.d.ts.map +1 -1
  79. package/select/internal.js +9 -19
  80. package/select/internal.js.map +1 -1
  81. package/select/parts/filter.d.ts +1 -1
  82. package/select/parts/virtual-list.d.ts +3 -2
  83. package/select/parts/virtual-list.d.ts.map +1 -1
  84. package/select/parts/virtual-list.js +7 -8
  85. package/select/parts/virtual-list.js.map +1 -1
  86. package/select/utils/use-select.d.ts +18 -11
  87. package/select/utils/use-select.d.ts.map +1 -1
  88. package/select/utils/use-select.js +41 -117
  89. package/select/utils/use-select.js.map +1 -1
  90. package/styling/action-card.scss +56 -0
  91. package/styling/item-card.scss +81 -0
  92. package/select/parts/item.d.ts +0 -33
  93. package/select/parts/item.d.ts.map +0 -1
  94. package/select/parts/item.js +0 -94
  95. package/select/parts/item.js.map +0 -1
  96. package/select/parts/multiselect-item.d.ts +0 -14
  97. package/select/parts/multiselect-item.d.ts.map +0 -1
  98. package/select/parts/multiselect-item.js +0 -112
  99. package/select/parts/multiselect-item.js.map +0 -1
  100. package/select/parts/plain-list.d.ts +0 -26
  101. package/select/parts/plain-list.d.ts.map +0 -1
  102. package/select/parts/plain-list.js.map +0 -1
  103. package/select/utils/use-native-search.d.ts +0 -18
  104. package/select/utils/use-native-search.d.ts.map +0 -1
  105. package/select/utils/use-native-search.js.map +0 -1
@@ -2,22 +2,23 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "root": "awsui_root_16248_1yruf_13",
6
- "icon": "awsui_icon_16248_1yruf_45",
7
- "header-inner": "awsui_header-inner_16248_1yruf_61",
8
- "disabled": "awsui_disabled_16248_1yruf_70",
9
- "header": "awsui_header_16248_1yruf_61",
10
- "body": "awsui_body_16248_1yruf_73",
11
- "header-row": "awsui_header-row_16248_1yruf_77",
12
- "description": "awsui_description_16248_1yruf_90",
13
- "has-header": "awsui_has-header_16248_1yruf_96",
14
- "header-button": "awsui_header-button_16248_1yruf_110",
15
- "overlay-button": "awsui_overlay-button_16248_1yruf_111",
16
- "variant-embedded": "awsui_variant-embedded_16248_1yruf_130",
17
- "variant-default": "awsui_variant-default_16248_1yruf_142",
18
- "inner-card": "awsui_inner-card_16248_1yruf_243",
19
- "no-padding": "awsui_no-padding_16248_1yruf_250",
20
- "icon-vertical-align-center": "awsui_icon-vertical-align-center_16248_1yruf_261",
21
- "icon-align-end": "awsui_icon-align-end_16248_1yruf_397"
5
+ "root": "awsui_root_16248_1op0s_13",
6
+ "icon": "awsui_icon_16248_1op0s_45",
7
+ "header": "awsui_header_16248_1op0s_92",
8
+ "header-inner": "awsui_header-inner_16248_1op0s_95",
9
+ "disabled": "awsui_disabled_16248_1op0s_104",
10
+ "body": "awsui_body_16248_1op0s_107",
11
+ "header-row": "awsui_header-row_16248_1op0s_111",
12
+ "description": "awsui_description_16248_1op0s_128",
13
+ "has-header": "awsui_has-header_16248_1op0s_134",
14
+ "header-button": "awsui_header-button_16248_1op0s_148",
15
+ "overlay-button": "awsui_overlay-button_16248_1op0s_149",
16
+ "variant-embedded": "awsui_variant-embedded_16248_1op0s_168",
17
+ "variant-default": "awsui_variant-default_16248_1op0s_180",
18
+ "inner-card": "awsui_inner-card_16248_1op0s_287",
19
+ "no-padding": "awsui_no-padding_16248_1op0s_294",
20
+ "icon-vertical-align-center": "awsui_icon-vertical-align-center_16248_1op0s_305",
21
+ "has-icon": "awsui_has-icon_16248_1op0s_424",
22
+ "icon-align-end": "awsui_icon-align-end_16248_1op0s_449"
22
23
  };
23
24
 
@@ -1 +1 @@
1
- {"version":3,"file":"toolbar-container.d.ts","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/skeleton/toolbar-container.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAOzD,UAAU,qBAAqB;IAC7B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,wBAAgB,gBAAgB,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,EAAE,qBAAqB,eAMhF;AAED,UAAU,8BAA8B;IACtC,cAAc,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,qBAAqB,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACpD,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,yBAAyB,CAAC,EAAE,0BAA0B,CAAC,2BAA2B,CAAC,CAAC;IACpF,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,wBAAgB,yBAAyB,CAAC,EACxC,cAAc,EACd,qBAAqB,EACrB,wBAAwB,EACxB,yBAAyB,EACzB,gBAAwB,GACzB,EAAE,8BAA8B,eAiBhC;AAED,UAAU,6BAA6B;IACrC,UAAU,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC;IACnC,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,qBAAqB,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;CACrD;AAED,eAAO,MAAM,wBAAwB,mGA8BpC,CAAC"}
1
+ {"version":3,"file":"toolbar-container.d.ts","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/skeleton/toolbar-container.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAOzD,UAAU,qBAAqB;IAC7B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,wBAAgB,gBAAgB,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,EAAE,qBAAqB,eAMhF;AAED,UAAU,8BAA8B;IACtC,cAAc,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,qBAAqB,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACpD,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,yBAAyB,CAAC,EAAE,0BAA0B,CAAC,2BAA2B,CAAC,CAAC;IACpF,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,wBAAgB,yBAAyB,CAAC,EACxC,cAAc,EACd,qBAAqB,EACrB,wBAAwB,EACxB,yBAAyB,EACzB,gBAAwB,GACzB,EAAE,8BAA8B,eAiBhC;AAED,UAAU,6BAA6B;IACrC,UAAU,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC;IACnC,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,qBAAqB,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;CACrD;AAED,eAAO,MAAM,wBAAwB,mGA+BpC,CAAC"}
@@ -2,6 +2,7 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import React from 'react';
4
4
  import clsx from 'clsx';
5
+ import { isThemeActive, Theme } from '@cloudscape-design/component-toolkit/internal';
5
6
  import TriggerButton from '../toolbar/trigger-button';
6
7
  import { BreadcrumbsSlot, ToolbarSlot } from './slots';
7
8
  import testutilStyles from '../../test-classes/styles.css.js';
@@ -16,12 +17,13 @@ export function ToolbarBreadcrumbsSection({ ownBreadcrumbs, discoveredBreadcrumb
16
17
  export const ToolbarSkeletonStructure = React.forwardRef(({ ariaLabels, expandedDrawerId, hasNavigation, navigationOpen, ownBreadcrumbs, discoveredBreadcrumbs }, ref) => {
17
18
  var _a;
18
19
  const drawerExpandedMode = !!expandedDrawerId;
20
+ const isOneTheme = isThemeActive(Theme.OneTheme);
19
21
  // istanbul ignore next: not interactive during SSR
20
22
  const noop = () => { };
21
23
  return (React.createElement(ToolbarSlot, { ref: ref },
22
24
  React.createElement(ToolbarContainer, null,
23
25
  hasNavigation && (React.createElement("nav", { className: toolbarStyles['universal-toolbar-nav'] },
24
- React.createElement(TriggerButton, { ariaLabel: (_a = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.navigationToggle) !== null && _a !== void 0 ? _a : undefined, ariaExpanded: !drawerExpandedMode && navigationOpen, iconName: "menu", className: testutilStyles['navigation-toggle'], onClick: noop, selected: !drawerExpandedMode && navigationOpen }))),
26
+ React.createElement(TriggerButton, { ariaLabel: (_a = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.navigationToggle) !== null && _a !== void 0 ? _a : undefined, ariaExpanded: !drawerExpandedMode && navigationOpen, iconName: isOneTheme ? 'side-bar' : 'menu', className: testutilStyles['navigation-toggle'], onClick: noop, selected: !drawerExpandedMode && navigationOpen }))),
25
27
  React.createElement(ToolbarBreadcrumbsSection, { ownBreadcrumbs: ownBreadcrumbs, discoveredBreadcrumbs: discoveredBreadcrumbs, includeTestUtils: true }),
26
28
  React.createElement("div", { className: toolbarStyles['universal-toolbar-drawers'] }))));
27
29
  });
@@ -1 +1 @@
1
- {"version":3,"file":"toolbar-container.js","sourceRoot":"","sources":["../../../../../src/app-layout/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AAgB,CAAC;IAC9C,mDAAmD;IACnD,MAAM,IAAI,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC;IACtB,OAAO,CACL,oBAAC,WAAW,IAAC,GAAG,EAAE,GAAG;QACnB,oBAAC,gBAAgB;YACd,aAAa,IAAI,CAChB,6BAAK,SAAS,EAAE,aAAa,CAAC,uBAAuB,CAAC;gBACpD,oBAAC,aAAa,IACZ,SAAS,EAAE,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,gBAAgB,mCAAI,SAAS,EACpD,YAAY,EAAE,CAAC,kBAAkB,IAAI,cAAc,EACnD,QAAQ,EAAC,MAAM,EACf,SAAS,EAAE,cAAc,CAAC,mBAAmB,CAAC,EAC9C,OAAO,EAAE,IAAI,EACb,QAAQ,EAAE,CAAC,kBAAkB,IAAI,cAAc,GAC/C,CACE,CACP;YACD,oBAAC,yBAAyB,IACxB,cAAc,EAAE,cAAc,EAC9B,qBAAqB,EAAE,qBAAqB,EAC5C,gBAAgB,EAAE,IAAI,GACtB;YACF,6BAAK,SAAS,EAAE,aAAa,CAAC,2BAA2B,CAAC,GAAI,CAC7C,CACP,CACf,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport { AppLayoutProps } from '../../../app-layout/interfaces';\nimport { BreadcrumbGroupProps } from '../../../breadcrumb-group/interfaces';\nimport { BreadcrumbsSlotContextType } from '../contexts';\nimport TriggerButton from '../toolbar/trigger-button';\nimport { BreadcrumbsSlot, ToolbarSlot } from './slots';\n\nimport testutilStyles from '../../test-classes/styles.css.js';\nimport toolbarStyles from '../toolbar/styles.css.js';\n\ninterface ToolbarContainerProps {\n children: React.ReactNode;\n hasAiDrawer?: boolean;\n}\n\nexport function ToolbarContainer({ children, hasAiDrawer }: ToolbarContainerProps) {\n return (\n <div className={clsx(toolbarStyles['toolbar-container'], hasAiDrawer && toolbarStyles['with-ai-drawer'])}>\n {children}\n </div>\n );\n}\n\ninterface ToolbarBreadcrumbsSectionProps {\n ownBreadcrumbs: React.ReactNode;\n discoveredBreadcrumbs?: BreadcrumbGroupProps | null;\n hideBreadcrumbsInToolbar?: boolean;\n reportOwnBreadcrumbsProps?: BreadcrumbsSlotContextType['reportOwnBreadcrumbsProps'];\n includeTestUtils?: boolean;\n}\n\nexport function ToolbarBreadcrumbsSection({\n ownBreadcrumbs,\n discoveredBreadcrumbs,\n hideBreadcrumbsInToolbar,\n reportOwnBreadcrumbsProps,\n includeTestUtils = false,\n}: ToolbarBreadcrumbsSectionProps) {\n return (\n <div\n className={clsx(\n toolbarStyles['universal-toolbar-breadcrumbs'],\n hideBreadcrumbsInToolbar && toolbarStyles['external-breadcrumbs'],\n includeTestUtils && testutilStyles.breadcrumbs\n )}\n data-awsui-external-breadcrumbs={hideBreadcrumbsInToolbar || undefined}\n >\n <BreadcrumbsSlot\n ownBreadcrumbs={ownBreadcrumbs}\n discoveredBreadcrumbs={discoveredBreadcrumbs}\n reportOwnBreadcrumbsProps={reportOwnBreadcrumbsProps}\n />\n </div>\n );\n}\n\ninterface ToolbarSkeletonStructureProps {\n ariaLabels?: AppLayoutProps.Labels;\n expandedDrawerId?: string | null;\n hasNavigation?: boolean;\n navigationOpen?: boolean;\n ownBreadcrumbs: React.ReactNode;\n discoveredBreadcrumbs?: BreadcrumbGroupProps | null;\n}\n\nexport const ToolbarSkeletonStructure = React.forwardRef<HTMLElement, ToolbarSkeletonStructureProps>(\n ({ ariaLabels, expandedDrawerId, hasNavigation, navigationOpen, ownBreadcrumbs, discoveredBreadcrumbs }, ref) => {\n const drawerExpandedMode = !!expandedDrawerId;\n // istanbul ignore next: not interactive during SSR\n const noop = () => {};\n return (\n <ToolbarSlot ref={ref}>\n <ToolbarContainer>\n {hasNavigation && (\n <nav className={toolbarStyles['universal-toolbar-nav']}>\n <TriggerButton\n ariaLabel={ariaLabels?.navigationToggle ?? undefined}\n ariaExpanded={!drawerExpandedMode && navigationOpen}\n iconName=\"menu\"\n className={testutilStyles['navigation-toggle']}\n onClick={noop}\n selected={!drawerExpandedMode && navigationOpen}\n />\n </nav>\n )}\n <ToolbarBreadcrumbsSection\n ownBreadcrumbs={ownBreadcrumbs}\n discoveredBreadcrumbs={discoveredBreadcrumbs}\n includeTestUtils={true}\n />\n <div className={toolbarStyles['universal-toolbar-drawers']} />\n </ToolbarContainer>\n </ToolbarSlot>\n );\n }\n);\n"]}
1
+ {"version":3,"file":"toolbar-container.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/skeleton/toolbar-container.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,+CAA+C,CAAC;AAKrF,OAAO,aAAa,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEvD,OAAO,cAAc,MAAM,kCAAkC,CAAC;AAC9D,OAAO,aAAa,MAAM,0BAA0B,CAAC;AAOrD,MAAM,UAAU,gBAAgB,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAyB;IAC/E,OAAO,CACL,6BAAK,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,mBAAmB,CAAC,EAAE,WAAW,IAAI,aAAa,CAAC,gBAAgB,CAAC,CAAC,IACrG,QAAQ,CACL,CACP,CAAC;AACJ,CAAC;AAUD,MAAM,UAAU,yBAAyB,CAAC,EACxC,cAAc,EACd,qBAAqB,EACrB,wBAAwB,EACxB,yBAAyB,EACzB,gBAAgB,GAAG,KAAK,GACO;IAC/B,OAAO,CACL,6BACE,SAAS,EAAE,IAAI,CACb,aAAa,CAAC,+BAA+B,CAAC,EAC9C,wBAAwB,IAAI,aAAa,CAAC,sBAAs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AA2B,CAAC,GAAI,CAC7C,CACP,CACf,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport { isThemeActive, Theme } from '@cloudscape-design/component-toolkit/internal';\n\nimport { AppLayoutProps } from '../../../app-layout/interfaces';\nimport { BreadcrumbGroupProps } from '../../../breadcrumb-group/interfaces';\nimport { BreadcrumbsSlotContextType } from '../contexts';\nimport TriggerButton from '../toolbar/trigger-button';\nimport { BreadcrumbsSlot, ToolbarSlot } from './slots';\n\nimport testutilStyles from '../../test-classes/styles.css.js';\nimport toolbarStyles from '../toolbar/styles.css.js';\n\ninterface ToolbarContainerProps {\n children: React.ReactNode;\n hasAiDrawer?: boolean;\n}\n\nexport function ToolbarContainer({ children, hasAiDrawer }: ToolbarContainerProps) {\n return (\n <div className={clsx(toolbarStyles['toolbar-container'], hasAiDrawer && toolbarStyles['with-ai-drawer'])}>\n {children}\n </div>\n );\n}\n\ninterface ToolbarBreadcrumbsSectionProps {\n ownBreadcrumbs: React.ReactNode;\n discoveredBreadcrumbs?: BreadcrumbGroupProps | null;\n hideBreadcrumbsInToolbar?: boolean;\n reportOwnBreadcrumbsProps?: BreadcrumbsSlotContextType['reportOwnBreadcrumbsProps'];\n includeTestUtils?: boolean;\n}\n\nexport function ToolbarBreadcrumbsSection({\n ownBreadcrumbs,\n discoveredBreadcrumbs,\n hideBreadcrumbsInToolbar,\n reportOwnBreadcrumbsProps,\n includeTestUtils = false,\n}: ToolbarBreadcrumbsSectionProps) {\n return (\n <div\n className={clsx(\n toolbarStyles['universal-toolbar-breadcrumbs'],\n hideBreadcrumbsInToolbar && toolbarStyles['external-breadcrumbs'],\n includeTestUtils && testutilStyles.breadcrumbs\n )}\n data-awsui-external-breadcrumbs={hideBreadcrumbsInToolbar || undefined}\n >\n <BreadcrumbsSlot\n ownBreadcrumbs={ownBreadcrumbs}\n discoveredBreadcrumbs={discoveredBreadcrumbs}\n reportOwnBreadcrumbsProps={reportOwnBreadcrumbsProps}\n />\n </div>\n );\n}\n\ninterface ToolbarSkeletonStructureProps {\n ariaLabels?: AppLayoutProps.Labels;\n expandedDrawerId?: string | null;\n hasNavigation?: boolean;\n navigationOpen?: boolean;\n ownBreadcrumbs: React.ReactNode;\n discoveredBreadcrumbs?: BreadcrumbGroupProps | null;\n}\n\nexport const ToolbarSkeletonStructure = React.forwardRef<HTMLElement, ToolbarSkeletonStructureProps>(\n ({ ariaLabels, expandedDrawerId, hasNavigation, navigationOpen, ownBreadcrumbs, discoveredBreadcrumbs }, ref) => {\n const drawerExpandedMode = !!expandedDrawerId;\n const isOneTheme = isThemeActive(Theme.OneTheme);\n // istanbul ignore next: not interactive during SSR\n const noop = () => {};\n return (\n <ToolbarSlot ref={ref}>\n <ToolbarContainer>\n {hasNavigation && (\n <nav className={toolbarStyles['universal-toolbar-nav']}>\n <TriggerButton\n ariaLabel={ariaLabels?.navigationToggle ?? undefined}\n ariaExpanded={!drawerExpandedMode && navigationOpen}\n iconName={isOneTheme ? 'side-bar' : 'menu'}\n className={testutilStyles['navigation-toggle']}\n onClick={noop}\n selected={!drawerExpandedMode && navigationOpen}\n />\n </nav>\n )}\n <ToolbarBreadcrumbsSection\n ownBreadcrumbs={ownBreadcrumbs}\n discoveredBreadcrumbs={discoveredBreadcrumbs}\n includeTestUtils={true}\n />\n <div className={toolbarStyles['universal-toolbar-drawers']} />\n </ToolbarContainer>\n </ToolbarSlot>\n );\n }\n);\n"]}
@@ -3,5 +3,5 @@ import { InternalInputProps } from '../input/internal';
3
3
  export interface ButtonDropdownFilterProps extends Omit<InternalInputProps, 'type'> {
4
4
  ref?: React.Ref<HTMLInputElement>;
5
5
  }
6
- declare const ButtonDropdownFilter: React.ForwardRefExoticComponent<Pick<ButtonDropdownFilterProps, "style" | "disabled" | "className" | "id" | "name" | "onFocus" | "onBlur" | "onChange" | "onKeyDown" | "onKeyUp" | "placeholder" | "prefix" | "inputMode" | "autoFocus" | "value" | "autoComplete" | "readOnly" | "step" | "invalid" | "ariaLabel" | "ariaDescribedby" | "__internalRootRef" | "warning" | "ariaLabelledby" | "__injectAnalyticsComponentMetadata" | "__skipNativeAttributesWarnings" | "styleClassNames" | "ariaRequired" | "controlId" | "inlineLabelText" | "suffix" | "nativeInputAttributes" | "disableBrowserAutocorrect" | "spellcheck" | "clearAriaLabel" | "__startIcon" | "__onStartIconClick" | "__endIcon" | "__onEndIconClick" | "__noBorderRadius" | "__inlineContent" | "__onDelayedInput" | "__onBlurWithDetail" | "__inheritFormFieldProps" | "__fullWidth"> & React.RefAttributes<HTMLInputElement>>;
6
+ declare const ButtonDropdownFilter: React.ForwardRefExoticComponent<Pick<ButtonDropdownFilterProps, "style" | "disabled" | "className" | "id" | "name" | "onFocus" | "onBlur" | "onChange" | "onKeyDown" | "onKeyUp" | "placeholder" | "prefix" | "inputMode" | "autoFocus" | "value" | "autoComplete" | "readOnly" | "step" | "invalid" | "ariaLabel" | "ariaDescribedby" | "__internalRootRef" | "styleClassNames" | "warning" | "ariaLabelledby" | "__injectAnalyticsComponentMetadata" | "__skipNativeAttributesWarnings" | "ariaRequired" | "controlId" | "inlineLabelText" | "suffix" | "nativeInputAttributes" | "disableBrowserAutocorrect" | "spellcheck" | "clearAriaLabel" | "__startIcon" | "__onStartIconClick" | "__endIcon" | "__onEndIconClick" | "__noBorderRadius" | "__inlineContent" | "__onDelayedInput" | "__onBlurWithDetail" | "__inheritFormFieldProps" | "__fullWidth"> & React.RefAttributes<HTMLInputElement>>;
7
7
  export default ButtonDropdownFilter;
@@ -40,5 +40,5 @@
40
40
  }
41
41
  }
42
42
  :root {
43
- --awsui-version-info-f6f7a334: true;
43
+ --awsui-version-info-d25043b3: true;
44
44
  }
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { DropdownOption } from '../option/interfaces';
3
+ import { OptionsListProps } from '../options-list';
4
+ import { ItemProps } from './parts/item';
5
+ /** Props spread onto the list element (`OptionsList`). */
6
+ export type ListElementProps = Omit<OptionsListProps, 'children'> & {
7
+ ref: React.RefObject<HTMLDivElement>;
8
+ };
9
+ /** Props for the row at `index`. */
10
+ export type GetOptionProps = (option: DropdownOption, index: number) => ItemProps;
11
+ /** Ref of a list component (`PlainList`, `VirtualList`): scrolls the row at `index` into view. */
12
+ export type ScrollToIndexRef = (index: number) => void;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/listbox/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,0DAA0D;AAC1D,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC,GAAG;IAAE,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAA;CAAE,CAAC;AAE7G,oCAAoC;AACpC,MAAM,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,KAAK,SAAS,CAAC;AAElF,kGAAkG;AAClG,MAAM,MAAM,gBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=interfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../../src/internal/components/listbox/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 { DropdownOption } from '../option/interfaces';\nimport { OptionsListProps } from '../options-list';\nimport { ItemProps } from './parts/item';\n\n/** Props spread onto the list element (`OptionsList`). */\nexport type ListElementProps = Omit<OptionsListProps, 'children'> & { ref: React.RefObject<HTMLDivElement> };\n\n/** Props for the row at `index`. */\nexport type GetOptionProps = (option: DropdownOption, index: number) => ItemProps;\n\n/** Ref of a list component (`PlainList`, `VirtualList`): scrolls the row at `index` into view. */\nexport type ScrollToIndexRef = (index: number) => void;\n"]}
@@ -4,13 +4,11 @@ interface ItemProps {
4
4
  index: number;
5
5
  getOptionProps: any;
6
6
  filteringValue: string;
7
- checkboxes: boolean;
8
7
  }
9
8
  export declare const getItemProps: ({
10
9
  option,
11
10
  index,
12
11
  getOptionProps,
13
- filteringValue,
14
- checkboxes
12
+ filteringValue
15
13
  }: ItemProps) => any;
16
14
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"get-item-props.d.ts","sourceRoot":"","sources":["../../../../../../src/internal/components/listbox/parts/get-item-props.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAGzD,UAAU,SAAS;IACjB,MAAM,EAAE,cAAc,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,GAAG,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,eAAO,MAAM,YAAY,GAAI,+DAAuE,SAAS,QAW5G,CAAC"}
1
+ {"version":3,"file":"get-item-props.d.ts","sourceRoot":"","sources":["../../../../../../src/internal/components/listbox/parts/get-item-props.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAGzD,UAAU,SAAS;IACjB,MAAM,EAAE,cAAc,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,GAAG,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,YAAY,GAAI,mDAAmD,SAAS,QAUxF,CAAC"}
@@ -1,11 +1,10 @@
1
1
  import { getTestOptionIndexes } from '../../options-list/utils/test-indexes';
2
- export const getItemProps = ({ option, index, getOptionProps, filteringValue, checkboxes = false }) => {
2
+ export const getItemProps = ({ option, index, getOptionProps, filteringValue }) => {
3
3
  const optionProps = getOptionProps(option, index);
4
4
  optionProps.filteringValue = filteringValue;
5
5
  const { inGroupIndex, groupIndex, throughIndex } = getTestOptionIndexes(option) || {};
6
6
  return {
7
7
  ...optionProps,
8
- hasCheckbox: checkboxes,
9
8
  ['data-group-index']: groupIndex,
10
9
  ['data-child-index']: inGroupIndex,
11
10
  ['data-test-index']: throughIndex,
@@ -1 +1 @@
1
- {"version":3,"file":"get-item-props.js","sourceRoot":"","sources":["../../../../../../src/internal/components/listbox/parts/get-item-props.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAU7E,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,UAAU,GAAG,KAAK,EAAa,EAAE,EAAE;IAC/G,MAAM,WAAW,GAAG,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAClD,WAAW,CAAC,cAAc,GAAG,cAAc,CAAC;IAC5C,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,oBAAoB,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IACtF,OAAO;QACL,GAAG,WAAW;QACd,WAAW,EAAE,UAAU;QACvB,CAAC,kBAAkB,CAAC,EAAE,UAAU;QAChC,CAAC,kBAAkB,CAAC,EAAE,YAAY;QAClC,CAAC,iBAAiB,CAAC,EAAE,YAAY;KAClC,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { DropdownOption } from '../../option/interfaces';\nimport { getTestOptionIndexes } from '../../options-list/utils/test-indexes';\n\ninterface ItemProps {\n option: DropdownOption;\n index: number;\n getOptionProps: any;\n filteringValue: string;\n checkboxes: boolean;\n}\n\nexport const getItemProps = ({ option, index, getOptionProps, filteringValue, checkboxes = false }: ItemProps) => {\n const optionProps = getOptionProps(option, index);\n optionProps.filteringValue = filteringValue;\n const { inGroupIndex, groupIndex, throughIndex } = getTestOptionIndexes(option) || {};\n return {\n ...optionProps,\n hasCheckbox: checkboxes,\n ['data-group-index']: groupIndex,\n ['data-child-index']: inGroupIndex,\n ['data-test-index']: throughIndex,\n };\n};\n"]}
1
+ {"version":3,"file":"get-item-props.js","sourceRoot":"","sources":["../../../../../../src/internal/components/listbox/parts/get-item-props.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAS7E,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE,cAAc,EAAa,EAAE,EAAE;IAC3F,MAAM,WAAW,GAAG,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAClD,WAAW,CAAC,cAAc,GAAG,cAAc,CAAC;IAC5C,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,oBAAoB,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IACtF,OAAO;QACL,GAAG,WAAW;QACd,CAAC,kBAAkB,CAAC,EAAE,UAAU;QAChC,CAAC,kBAAkB,CAAC,EAAE,YAAY;QAClC,CAAC,iBAAiB,CAAC,EAAE,YAAY;KAClC,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { DropdownOption } from '../../option/interfaces';\nimport { getTestOptionIndexes } from '../../options-list/utils/test-indexes';\n\ninterface ItemProps {\n option: DropdownOption;\n index: number;\n getOptionProps: any;\n filteringValue: string;\n}\n\nexport const getItemProps = ({ option, index, getOptionProps, filteringValue }: ItemProps) => {\n const optionProps = getOptionProps(option, index);\n optionProps.filteringValue = filteringValue;\n const { inGroupIndex, groupIndex, throughIndex } = getTestOptionIndexes(option) || {};\n return {\n ...optionProps,\n ['data-group-index']: groupIndex,\n ['data-child-index']: inGroupIndex,\n ['data-test-index']: throughIndex,\n };\n};\n"]}
@@ -0,0 +1,43 @@
1
+ import React from 'react';
2
+ import { MultiselectProps } from '../../../../multiselect/interfaces';
3
+ import { SelectProps } from '../../../../select/interfaces.js';
4
+ import { DropdownOption } from '../../option/interfaces';
5
+ import { HighlightType } from '../../options-list/utils/use-highlight-option.js';
6
+ import { SelectionType } from '../selection/interfaces';
7
+ export interface ItemProps {
8
+ index: number;
9
+ virtualIndex?: number;
10
+ option: DropdownOption;
11
+ /**
12
+ * `single` renders a check mark on the selected option (Select).
13
+ * `multi` renders a checkbox, interactive groups and the select-all row (Multiselect).
14
+ */
15
+ selectionType?: SelectionType;
16
+ highlighted?: boolean;
17
+ selected?: boolean;
18
+ indeterminate?: boolean;
19
+ filteringValue?: string;
20
+ virtualPosition?: number;
21
+ padBottom?: boolean;
22
+ isNextSelected?: boolean;
23
+ isPreviousSelected?: boolean;
24
+ screenReaderContent?: string;
25
+ ariaPosinset?: number;
26
+ ariaSetsize?: number;
27
+ highlightType?: HighlightType['type'];
28
+ withScrollbar?: boolean;
29
+ sticky?: boolean;
30
+ renderOption?: SelectProps.SelectOptionItemRenderer | MultiselectProps.MultiselectOptionItemRenderer;
31
+ parentProps?: ItemParentProps;
32
+ }
33
+ export interface ItemParentProps {
34
+ index: number;
35
+ virtualIndex?: number;
36
+ option: DropdownOption;
37
+ disabled: boolean;
38
+ indeterminate?: boolean;
39
+ highlighted?: boolean;
40
+ selected?: boolean;
41
+ }
42
+ declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<ItemProps & React.RefAttributes<HTMLDivElement>>>;
43
+ export default _default;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"item.d.ts","sourceRoot":"","sources":["../../../../../../src/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E,MAAM,CAAC;IACtB,MAAM,EAAE,cAAc,CAAC;IACvB,QAAQ,EAAE,OAAO,CAAC;IAClB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;;AAwTD,wBAAkD"}
@@ -0,0 +1,184 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import React, { useEffect, useRef, useState } from 'react';
4
+ import clsx from 'clsx';
5
+ import { useMergeRefs } from '@cloudscape-design/component-toolkit/internal';
6
+ import InternalIcon from '../../../../icon/internal.js';
7
+ import Tooltip from '../../../../tooltip/internal.js';
8
+ import { getBaseProps } from '../../../base-component';
9
+ import useHiddenDescription from '../../../hooks/use-hidden-description';
10
+ import CheckboxIcon from '../../checkbox-icon';
11
+ import Option from '../../option';
12
+ import SelectableItem from '../../selectable-item';
13
+ import styles from '../../../../select/parts/styles.css.js';
14
+ const toSelectOptionGroupItem = (props) => {
15
+ var _a;
16
+ return {
17
+ type: 'group',
18
+ index: (_a = props.virtualIndex) !== null && _a !== void 0 ? _a : props.index,
19
+ option: props.option.option,
20
+ disabled: props.disabled,
21
+ };
22
+ };
23
+ const toSelectOptionItem = (props) => {
24
+ var _a, _b, _c, _d;
25
+ return {
26
+ type: 'item',
27
+ index: (_a = props.virtualIndex) !== null && _a !== void 0 ? _a : props.index,
28
+ option: props.option.option,
29
+ selected: props.selected,
30
+ highlighted: props.highlighted,
31
+ disabled: props.disabled,
32
+ parent: props.parentProps
33
+ ? toSelectOptionGroupItem({
34
+ index: (_b = props.parentProps) === null || _b === void 0 ? void 0 : _b.index,
35
+ virtualIndex: (_c = props.parentProps) === null || _c === void 0 ? void 0 : _c.virtualIndex,
36
+ option: (_d = props.parentProps) === null || _d === void 0 ? void 0 : _d.option,
37
+ disabled: props.disabled,
38
+ })
39
+ : null,
40
+ };
41
+ };
42
+ const toMultiselectOptionGroupItem = (props) => {
43
+ var _a, _b;
44
+ return {
45
+ type: 'group',
46
+ index: (_a = props.virtualIndex) !== null && _a !== void 0 ? _a : props.index,
47
+ option: props.option.option,
48
+ indeterminate: (_b = props.indeterminate) !== null && _b !== void 0 ? _b : false,
49
+ selected: props.selected,
50
+ highlighted: props.highlighted,
51
+ disabled: props.disabled,
52
+ };
53
+ };
54
+ const toMultiselectOptionItem = (props) => {
55
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
56
+ return {
57
+ type: 'item',
58
+ index: (_a = props.virtualIndex) !== null && _a !== void 0 ? _a : props.index,
59
+ option: props.option.option,
60
+ selected: props.selected,
61
+ highlighted: props.highlighted,
62
+ disabled: props.disabled,
63
+ parent: props.parentProps
64
+ ? toMultiselectOptionGroupItem({
65
+ index: (_b = props.parentProps) === null || _b === void 0 ? void 0 : _b.index,
66
+ virtualIndex: (_c = props.parentProps) === null || _c === void 0 ? void 0 : _c.virtualIndex,
67
+ option: (_d = props.parentProps) === null || _d === void 0 ? void 0 : _d.option,
68
+ disabled: props.disabled,
69
+ highlighted: (_f = (_e = props.parentProps) === null || _e === void 0 ? void 0 : _e.highlighted) !== null && _f !== void 0 ? _f : false,
70
+ indeterminate: (_h = (_g = props.parentProps) === null || _g === void 0 ? void 0 : _g.indeterminate) !== null && _h !== void 0 ? _h : false,
71
+ selected: (_k = (_j = props.parentProps) === null || _j === void 0 ? void 0 : _j.selected) !== null && _k !== void 0 ? _k : false,
72
+ })
73
+ : null,
74
+ };
75
+ };
76
+ const Item = ({ index, virtualIndex, option, selectionType = 'single', highlighted, selected, indeterminate, filteringValue, virtualPosition, padBottom, isNextSelected, isPreviousSelected, screenReaderContent, ariaPosinset, ariaSetsize, highlightType, withScrollbar, sticky, renderOption, parentProps, ...restProps }, ref) => {
77
+ const baseProps = getBaseProps(restProps);
78
+ const isMulti = selectionType === 'multi';
79
+ const isParent = option.type === 'parent';
80
+ const isChild = option.type === 'child';
81
+ const isSelectAll = option.type === 'select-all';
82
+ const wrappedOption = option.option;
83
+ const disabled = option.disabled || wrappedOption.disabled;
84
+ const disabledReasonSource = isMulti
85
+ ? option.disabledReason || wrappedOption.disabledReason
86
+ : wrappedOption.disabledReason;
87
+ const disabledReason = disabled && disabledReasonSource ? disabledReasonSource : '';
88
+ const isDisabledWithReason = !!disabledReason;
89
+ const internalRef = useRef(null);
90
+ const { descriptionEl, descriptionId } = useHiddenDescription(disabledReason);
91
+ const [canShowTooltip, setCanShowTooltip] = useState(true);
92
+ useEffect(() => setCanShowTooltip(true), [highlighted]);
93
+ const mergedRef = useMergeRefs(ref, internalRef);
94
+ const getSelectItemProps = (option) => {
95
+ if (option.type === 'parent') {
96
+ return toSelectOptionGroupItem({
97
+ option: option,
98
+ index: index,
99
+ virtualIndex: virtualIndex,
100
+ disabled: !!disabled,
101
+ });
102
+ }
103
+ else {
104
+ return toSelectOptionItem({
105
+ option: option,
106
+ index: index,
107
+ virtualIndex: virtualIndex,
108
+ disabled: !!disabled,
109
+ highlighted: !!highlighted,
110
+ selected: !!selected,
111
+ parentProps: parentProps,
112
+ });
113
+ }
114
+ };
115
+ const getMultiselectItemProps = (option) => {
116
+ if (option.type === 'parent') {
117
+ return toMultiselectOptionGroupItem({
118
+ option: option,
119
+ index: index,
120
+ virtualIndex: virtualIndex,
121
+ disabled: !!disabled,
122
+ highlighted: !!highlighted,
123
+ selected: !!selected,
124
+ indeterminate: indeterminate !== null && indeterminate !== void 0 ? indeterminate : false,
125
+ });
126
+ }
127
+ else if (option.type === 'select-all') {
128
+ return {
129
+ type: 'select-all',
130
+ option: option.option,
131
+ indeterminate: indeterminate !== null && indeterminate !== void 0 ? indeterminate : false,
132
+ selected: !!selected,
133
+ highlighted: !!highlighted,
134
+ };
135
+ }
136
+ else {
137
+ return toMultiselectOptionItem({
138
+ option: option,
139
+ index: index,
140
+ virtualIndex: virtualIndex,
141
+ disabled: !!disabled,
142
+ highlighted: !!highlighted,
143
+ selected: !!selected,
144
+ parentProps: parentProps,
145
+ });
146
+ }
147
+ };
148
+ const renderOptionWrapper = (option) => {
149
+ if (!renderOption) {
150
+ return null;
151
+ }
152
+ if (isMulti) {
153
+ return renderOption({
154
+ item: getMultiselectItemProps(option),
155
+ filterText: filteringValue,
156
+ });
157
+ }
158
+ return renderOption({
159
+ item: getSelectItemProps(option),
160
+ filterText: filteringValue,
161
+ });
162
+ };
163
+ const renderResult = renderOptionWrapper(option);
164
+ const optionElement = (React.createElement(Option, { customContent: renderResult, option: { ...wrappedOption, disabled }, highlightedOption: highlighted, selectedOption: selected, highlightText: filteringValue, isGroupOption: isParent }));
165
+ const disabledReasonElement = !renderResult && isDisabledWithReason && (React.createElement(React.Fragment, null,
166
+ descriptionEl,
167
+ highlighted && canShowTooltip && (React.createElement(Tooltip, { className: styles['disabled-reason-tooltip'], getTrack: () => internalRef.current, content: disabledReason, position: "right", onEscape: () => setCanShowTooltip(false) }))));
168
+ if (isMulti) {
169
+ return (React.createElement(SelectableItem, { disableContentStyling: !!renderResult, ariaSelected: isParent && indeterminate ? undefined : Boolean(selected), ariaChecked: isParent && indeterminate ? 'mixed' : Boolean(selected), selected: selected, isNextSelected: isNextSelected, isPreviousSelected: isPreviousSelected, highlighted: highlighted, disabled: disabled, isParent: isParent, isChild: isChild, isSelectAll: isSelectAll, highlightType: highlightType, ref: mergedRef, virtualPosition: virtualPosition, padBottom: padBottom, useInteractiveGroups: true, screenReaderContent: screenReaderContent, ariaPosinset: ariaPosinset, ariaSetsize: ariaSetsize, ariaDescribedby: isDisabledWithReason ? descriptionId : '', value: option.option.value, afterHeader: option.afterHeader, withScrollbar: withScrollbar, sticky: sticky, ...baseProps },
170
+ React.createElement("div", { className: styles.item },
171
+ !renderResult && (React.createElement("div", { className: styles.checkbox },
172
+ React.createElement(CheckboxIcon, { checked: selected, indeterminate: (isParent || isSelectAll) && indeterminate, disabled: disabled }))),
173
+ optionElement),
174
+ disabledReasonElement));
175
+ }
176
+ return (React.createElement(SelectableItem, { disableContentStyling: !!renderResult, ariaSelected: Boolean(selected), selected: selected, isNextSelected: isNextSelected, isPreviousSelected: isPreviousSelected, highlighted: highlighted, disabled: option.disabled, isParent: isParent, isChild: isChild, ref: mergedRef, virtualPosition: virtualPosition, padBottom: padBottom, screenReaderContent: screenReaderContent, ariaPosinset: ariaPosinset, ariaSetsize: ariaSetsize, highlightType: highlightType, ariaDescribedby: isDisabledWithReason ? descriptionId : '', value: option.option.value, withScrollbar: withScrollbar, sticky: sticky, ...baseProps },
177
+ React.createElement("div", { className: clsx(styles.item, !isParent && wrappedOption.labelTag && styles['show-label-tag']) },
178
+ optionElement,
179
+ !renderResult && !isParent && selected && (React.createElement("div", { className: styles['selected-icon'] },
180
+ React.createElement(InternalIcon, { name: "check" }))),
181
+ disabledReasonElement)));
182
+ };
183
+ export default React.memo(React.forwardRef(Item));
184
+ //# sourceMappingURL=item.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"item.js","sourceRoot":"","sources":["../../../../../../src/internal/components/listbox/parts/item.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAE7E,OAAO,YAAY,MAAM,8BAA8B,CAAC;AAGxD,OAAO,OAAO,MAAM,iCAAiC,CAAC;AAEtD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,oBAAoB,MAAM,uCAAuC,CAAC;AACzE,OAAO,YAAY,MAAM,qBAAqB,CAAC;AAC/C,OAAO,MAAM,MAAM,cAAc,CAAC;AAGlC,OAAO,cAAc,MAAM,uBAAuB,CAAC;AAGnD,OAAO,MAAM,MAAM,wCAAwC,CAAC;AA6C5D,MAAM,uBAAuB,GAAG,CAAC,KAAsB,EAAqC,EAAE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,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { useMergeRefs } from '@cloudscape-design/component-toolkit/internal';\n\nimport InternalIcon from '../../../../icon/internal.js';\nimport { MultiselectProps } from '../../../../multiselect/interfaces';\nimport { SelectProps } from '../../../../select/interfaces.js';\nimport Tooltip from '../../../../tooltip/internal.js';\nimport { OptionDefinition, OptionGroup } from '../../../../types/option';\nimport { getBaseProps } from '../../../base-component';\nimport useHiddenDescription from '../../../hooks/use-hidden-description';\nimport CheckboxIcon from '../../checkbox-icon';\nimport Option from '../../option';\nimport { DropdownOption } from '../../option/interfaces';\nimport { HighlightType } from '../../options-list/utils/use-highlight-option.js';\nimport SelectableItem from '../../selectable-item';\nimport { SelectionType } from '../selection/interfaces';\n\nimport styles from '../../../../select/parts/styles.css.js';\n\nexport interface ItemProps {\n index: number;\n virtualIndex?: number;\n option: DropdownOption;\n /**\n * `single` renders a check mark on the selected option (Select).\n * `multi` renders a checkbox, interactive groups and the select-all row (Multiselect).\n */\n selectionType?: SelectionType;\n highlighted?: boolean;\n selected?: boolean;\n indeterminate?: boolean;\n filteringValue?: string;\n virtualPosition?: number;\n padBottom?: boolean;\n isNextSelected?: boolean;\n isPreviousSelected?: boolean;\n screenReaderContent?: string;\n ariaPosinset?: number;\n ariaSetsize?: number;\n highlightType?: HighlightType['type'];\n withScrollbar?: boolean;\n sticky?: boolean;\n renderOption?: SelectProps.SelectOptionItemRenderer | MultiselectProps.MultiselectOptionItemRenderer;\n parentProps?: ItemParentProps;\n}\n\nexport interface ItemParentProps {\n index: number;\n virtualIndex?: number;\n option: DropdownOption;\n disabled: boolean;\n indeterminate?: boolean;\n highlighted?: boolean;\n selected?: boolean;\n}\n\ninterface MultiselectItemParentProps extends ItemParentProps {\n indeterminate: boolean;\n highlighted: boolean;\n selected: boolean;\n}\n\nconst toSelectOptionGroupItem = (props: ItemParentProps): SelectProps.SelectOptionGroupItem => {\n return {\n type: 'group',\n index: props.virtualIndex ?? props.index,\n option: props.option.option as OptionGroup,\n disabled: props.disabled,\n };\n};\n\nconst toSelectOptionItem = (props: {\n index: number;\n virtualIndex?: number;\n option: DropdownOption;\n disabled: boolean;\n selected: boolean;\n highlighted: boolean;\n parentProps?: ItemParentProps;\n}): SelectProps.SelectOptionItem => {\n return {\n type: 'item',\n index: props.virtualIndex ?? props.index,\n option: props.option.option as OptionDefinition,\n selected: props.selected,\n highlighted: props.highlighted,\n disabled: props.disabled,\n parent: props.parentProps\n ? toSelectOptionGroupItem({\n index: props.parentProps?.index,\n virtualIndex: props.parentProps?.virtualIndex,\n option: props.parentProps?.option,\n disabled: props.disabled,\n })\n : null,\n };\n};\n\nconst toMultiselectOptionGroupItem = (\n props: MultiselectItemParentProps\n): MultiselectProps.MultiselectOptionGroupItem => {\n return {\n type: 'group',\n index: props.virtualIndex ?? props.index,\n option: props.option.option as OptionGroup,\n indeterminate: props.indeterminate ?? false,\n selected: props.selected,\n highlighted: props.highlighted,\n disabled: props.disabled,\n };\n};\n\nconst toMultiselectOptionItem = (props: {\n index: number;\n virtualIndex?: number;\n option: DropdownOption;\n disabled: boolean;\n selected: boolean;\n highlighted: boolean;\n parentProps?: ItemParentProps;\n}): MultiselectProps.MultiselectOptionItem => {\n return {\n type: 'item',\n index: props.virtualIndex ?? props.index,\n option: props.option.option as OptionDefinition,\n selected: props.selected,\n highlighted: props.highlighted,\n disabled: props.disabled,\n parent: props.parentProps\n ? toMultiselectOptionGroupItem({\n index: props.parentProps?.index,\n virtualIndex: props.parentProps?.virtualIndex,\n option: props.parentProps?.option,\n disabled: props.disabled,\n highlighted: props.parentProps?.highlighted ?? false,\n indeterminate: props.parentProps?.indeterminate ?? false,\n selected: props.parentProps?.selected ?? false,\n })\n : null,\n };\n};\n\nconst Item = (\n {\n index,\n virtualIndex,\n option,\n selectionType = 'single',\n highlighted,\n selected,\n indeterminate,\n filteringValue,\n virtualPosition,\n padBottom,\n isNextSelected,\n isPreviousSelected,\n screenReaderContent,\n ariaPosinset,\n ariaSetsize,\n highlightType,\n withScrollbar,\n sticky,\n renderOption,\n parentProps,\n ...restProps\n }: ItemProps,\n ref: React.Ref<HTMLDivElement>\n) => {\n const baseProps = getBaseProps(restProps);\n const isMulti = selectionType === 'multi';\n const isParent = option.type === 'parent';\n const isChild = option.type === 'child';\n const isSelectAll = option.type === 'select-all';\n const wrappedOption: OptionDefinition = option.option;\n const disabled = option.disabled || wrappedOption.disabled;\n const disabledReasonSource = isMulti\n ? option.disabledReason || wrappedOption.disabledReason\n : wrappedOption.disabledReason;\n const disabledReason = disabled && disabledReasonSource ? disabledReasonSource : '';\n const isDisabledWithReason = !!disabledReason;\n const internalRef = useRef<HTMLDivElement>(null);\n const { descriptionEl, descriptionId } = useHiddenDescription(disabledReason);\n const [canShowTooltip, setCanShowTooltip] = useState(true);\n useEffect(() => setCanShowTooltip(true), [highlighted]);\n const mergedRef = useMergeRefs(ref, internalRef);\n\n const getSelectItemProps = (option: DropdownOption): SelectProps.SelectItem => {\n if (option.type === 'parent') {\n return toSelectOptionGroupItem({\n option: option,\n index: index,\n virtualIndex: virtualIndex,\n disabled: !!disabled,\n });\n } else {\n return toSelectOptionItem({\n option: option,\n index: index,\n virtualIndex: virtualIndex,\n disabled: !!disabled,\n highlighted: !!highlighted,\n selected: !!selected,\n parentProps: parentProps,\n });\n }\n };\n\n const getMultiselectItemProps = (option: DropdownOption): MultiselectProps.MultiselectItem => {\n if (option.type === 'parent') {\n return toMultiselectOptionGroupItem({\n option: option,\n index: index,\n virtualIndex: virtualIndex,\n disabled: !!disabled,\n highlighted: !!highlighted,\n selected: !!selected,\n indeterminate: indeterminate ?? false,\n });\n } else if (option.type === 'select-all') {\n return {\n type: 'select-all',\n option: option.option as OptionDefinition,\n indeterminate: indeterminate ?? false,\n selected: !!selected,\n highlighted: !!highlighted,\n };\n } else {\n return toMultiselectOptionItem({\n option: option,\n index: index,\n virtualIndex: virtualIndex,\n disabled: !!disabled,\n highlighted: !!highlighted,\n selected: !!selected,\n parentProps: parentProps,\n });\n }\n };\n\n const renderOptionWrapper = (option: DropdownOption) => {\n if (!renderOption) {\n return null;\n }\n if (isMulti) {\n return (renderOption as MultiselectProps.MultiselectOptionItemRenderer)({\n item: getMultiselectItemProps(option),\n filterText: filteringValue,\n });\n }\n return (renderOption as SelectProps.SelectOptionItemRenderer)({\n item: getSelectItemProps(option),\n filterText: filteringValue,\n });\n };\n\n const renderResult = renderOptionWrapper(option);\n\n const optionElement = (\n <Option\n customContent={renderResult}\n option={{ ...wrappedOption, disabled }}\n highlightedOption={highlighted}\n selectedOption={selected}\n highlightText={filteringValue}\n isGroupOption={isParent}\n />\n );\n\n const disabledReasonElement = !renderResult && isDisabledWithReason && (\n <>\n {descriptionEl}\n {highlighted && canShowTooltip && (\n <Tooltip\n className={styles['disabled-reason-tooltip']}\n getTrack={() => internalRef.current}\n content={disabledReason!}\n position=\"right\"\n onEscape={() => setCanShowTooltip(false)}\n />\n )}\n </>\n );\n\n if (isMulti) {\n return (\n <SelectableItem\n disableContentStyling={!!renderResult}\n ariaSelected={isParent && indeterminate ? undefined : Boolean(selected)}\n ariaChecked={isParent && indeterminate ? 'mixed' : Boolean(selected)}\n selected={selected}\n isNextSelected={isNextSelected}\n isPreviousSelected={isPreviousSelected}\n highlighted={highlighted}\n disabled={disabled}\n isParent={isParent}\n isChild={isChild}\n isSelectAll={isSelectAll}\n highlightType={highlightType}\n ref={mergedRef}\n virtualPosition={virtualPosition}\n padBottom={padBottom}\n useInteractiveGroups={true}\n screenReaderContent={screenReaderContent}\n ariaPosinset={ariaPosinset}\n ariaSetsize={ariaSetsize}\n ariaDescribedby={isDisabledWithReason ? descriptionId : ''}\n value={option.option.value}\n afterHeader={option.afterHeader}\n withScrollbar={withScrollbar}\n sticky={sticky}\n {...baseProps}\n >\n <div className={styles.item}>\n {!renderResult && (\n <div className={styles.checkbox}>\n <CheckboxIcon\n checked={selected}\n indeterminate={(isParent || isSelectAll) && indeterminate}\n disabled={disabled}\n />\n </div>\n )}\n {optionElement}\n </div>\n {disabledReasonElement}\n </SelectableItem>\n );\n }\n\n return (\n <SelectableItem\n disableContentStyling={!!renderResult}\n ariaSelected={Boolean(selected)}\n selected={selected}\n isNextSelected={isNextSelected}\n isPreviousSelected={isPreviousSelected}\n highlighted={highlighted}\n disabled={option.disabled}\n isParent={isParent}\n isChild={isChild}\n ref={mergedRef}\n virtualPosition={virtualPosition}\n padBottom={padBottom}\n screenReaderContent={screenReaderContent}\n ariaPosinset={ariaPosinset}\n ariaSetsize={ariaSetsize}\n highlightType={highlightType}\n ariaDescribedby={isDisabledWithReason ? descriptionId : ''}\n value={option.option.value}\n withScrollbar={withScrollbar}\n sticky={sticky}\n {...baseProps}\n >\n <div className={clsx(styles.item, !isParent && wrappedOption.labelTag && styles['show-label-tag'])}>\n {optionElement}\n {!renderResult && !isParent && selected && (\n <div className={styles['selected-icon']}>\n <InternalIcon name=\"check\" />\n </div>\n )}\n {disabledReasonElement}\n </div>\n </SelectableItem>\n );\n};\n\nexport default React.memo(React.forwardRef(Item));\n"]}
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import { MultiselectProps } from '../../../../multiselect/interfaces';
3
+ import { SelectProps } from '../../../../select/interfaces';
4
+ import { DropdownOption } from '../../option/interfaces';
5
+ import { HighlightType } from '../../options-list/utils/use-highlight-option';
6
+ import { GetOptionProps, ListElementProps, ScrollToIndexRef } from '../interfaces';
7
+ import { SelectionType } from '../selection/interfaces';
8
+ export interface ListProps {
9
+ listProps: ListElementProps;
10
+ getOptionProps: GetOptionProps;
11
+ filteredOptions: ReadonlyArray<DropdownOption>;
12
+ filteringValue: string;
13
+ highlightType: HighlightType;
14
+ hasDropdownStatus?: boolean;
15
+ listBottom?: React.ReactNode;
16
+ selectionType?: SelectionType;
17
+ screenReaderContent?: string;
18
+ firstOptionSticky?: boolean;
19
+ isMultiSelect?: boolean;
20
+ renderOption?: SelectProps.SelectOptionItemRenderer | MultiselectProps.MultiselectOptionItemRenderer;
21
+ }
22
+ declare const _default: React.ForwardRefExoticComponent<ListProps & React.RefAttributes<ScrollToIndexRef>>;
23
+ export default _default;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plain-list.d.ts","sourceRoot":"","sources":["../../../../../../src/internal/components/listbox/parts/plain-list.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAKjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,EAAE,aAAa,EAAE,MAAM,+CAA+C,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACnF,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAOxD,MAAM,WAAW,SAAS;IACxB,SAAS,EAAE,gBAAgB,CAAC;IAC5B,cAAc,EAAE,cAAc,CAAC;IAC/B,eAAe,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC;IAC/C,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,aAAa,CAAC;IAC7B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,YAAY,CAAC,EAAE,WAAW,CAAC,wBAAwB,GAAG,gBAAgB,CAAC,6BAA6B,CAAC;CACtG;;AAkFD,wBAAqC"}
@@ -3,12 +3,12 @@
3
3
  import React, { forwardRef, useImperativeHandle, useRef, useState } from 'react';
4
4
  import { useContainerQuery } from '@cloudscape-design/component-toolkit';
5
5
  import { useMergeRefs, useUniqueId } from '@cloudscape-design/component-toolkit/internal';
6
- import { fallbackItemHeight } from '../../internal/components/listbox/parts/common';
7
- import { renderOptions } from '../../internal/components/listbox/parts/render-options';
8
- import scrollToIndex from '../../internal/components/listbox/parts/scroll-to-index';
9
- import OptionsList from '../../internal/components/options-list';
10
- import styles from './styles.css.js';
11
- const PlainList = ({ menuProps, getOptionProps, filteredOptions, filteringValue, highlightType, checkboxes, hasDropdownStatus, listBottom, useInteractiveGroups, screenReaderContent, firstOptionSticky, isMultiSelect, renderOption, }, ref) => {
6
+ import OptionsList from '../../options-list';
7
+ import { fallbackItemHeight } from './common';
8
+ import { renderOptions } from './render-options';
9
+ import scrollToIndex from './scroll-to-index';
10
+ import styles from '../../../../select/parts/styles.css.js';
11
+ const PlainList = ({ listProps, getOptionProps, filteredOptions, filteringValue, highlightType, hasDropdownStatus, listBottom, selectionType, screenReaderContent, firstOptionSticky, isMultiSelect, renderOption, }, ref) => {
12
12
  const idPrefix = useUniqueId('select-list-');
13
13
  const stickyOptionRef = useRef(null);
14
14
  const [stickyOptionBlockSize, setStickyOptionBlockSize] = useState(firstOptionSticky ? fallbackItemHeight : 0);
@@ -22,7 +22,7 @@ const PlainList = ({ menuProps, getOptionProps, filteredOptions, filteringValue,
22
22
  }
23
23
  return { inner: rect.contentBoxWidth, outer: rect.borderBoxWidth };
24
24
  });
25
- const menuRef = menuProps.ref;
25
+ const menuRef = listProps.ref;
26
26
  const mergedRef = useMergeRefs(menuMeasureRef, menuRef);
27
27
  useImperativeHandle(ref, () => (index) => {
28
28
  const isSticky = firstOptionSticky && index === 0;
@@ -31,7 +31,7 @@ const PlainList = ({ menuProps, getOptionProps, filteredOptions, filteringValue,
31
31
  }
32
32
  }, [firstOptionSticky, highlightType.moveFocus, menuRef]);
33
33
  const withScrollbar = !!width && width.inner < width.outer;
34
- return (React.createElement(OptionsList, { ...menuProps, ref: mergedRef, stickyItemBlockSize: stickyOptionBlockSize, isMultiSelect: isMultiSelect },
34
+ return (React.createElement(OptionsList, { ...listProps, ref: mergedRef, stickyItemBlockSize: stickyOptionBlockSize, isMultiSelect: isMultiSelect },
35
35
  renderOptions({
36
36
  renderOption,
37
37
  options: filteredOptions,
@@ -39,9 +39,8 @@ const PlainList = ({ menuProps, getOptionProps, filteredOptions, filteringValue,
39
39
  filteringValue,
40
40
  idPrefix,
41
41
  highlightType,
42
- checkboxes,
43
42
  hasDropdownStatus,
44
- useInteractiveGroups,
43
+ selectionType,
45
44
  screenReaderContent,
46
45
  firstOptionSticky,
47
46
  stickyOptionRef,
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plain-list.js","sourceRoot":"","sources":["../../../../../../src/internal/components/listbox/parts/plain-list.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAK1F,OAAO,WAAW,MAAM,oBAAoB,CAAC;AAI7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,aAAa,MAAM,mBAAmB,CAAC;AAE9C,OAAO,MAAM,MAAM,wCAAwC,CAAC;AAiB5D,MAAM,SAAS,GAAG,CAChB,EACE,SAAS,EACT,cAAc,EACd,eAAe,EACf,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,UAAU,EACV,aAAa,EACb,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,EACb,YAAY,GACF,EACZ,GAAgC,EAChC,EAAE;IACF,MAAM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IAE3D,OAAO,CACL,oBAAC,WAAW,OACN,SAAS,EACb,GAAG,EAAE,SAAS,EACd,mBAAmB,EAAE,qBAAqB,EAC1C,aAAa,EAAE,aAAa;QAE3B,aAAa,CAAC;YACb,YAAY;YACZ,OAAO,EAAE,eAAe;YACxB,cAAc;YACd,cAAc;YACd,QAAQ;YACR,aAAa;YACb,iBAAiB;YACjB,aAAa;YACb,mBAAmB;YACnB,iBAAiB;YACjB,eAAe;YACf,aAAa;SACd,CAAC;QACD,UAAU,CAAC,CAAC,CAAC,CACZ,6BAAK,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAE,MAAM,CAAC,aAAa,CAAC,IAChD,UAAU,CACP,CACP,CAAC,CAAC,CAAC,IAAI,CACI,CACf,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC,SAAS,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { forwardRef, useImperativeHandle, useRef, useState } from 'react';\n\nimport { useContainerQuery } from '@cloudscape-design/component-toolkit';\nimport { useMergeRefs, useUniqueId } from '@cloudscape-design/component-toolkit/internal';\n\nimport { MultiselectProps } from '../../../../multiselect/interfaces';\nimport { SelectProps } from '../../../../select/interfaces';\nimport { DropdownOption } from '../../option/interfaces';\nimport OptionsList from '../../options-list';\nimport { HighlightType } from '../../options-list/utils/use-highlight-option';\nimport { GetOptionProps, ListElementProps, ScrollToIndexRef } from '../interfaces';\nimport { SelectionType } from '../selection/interfaces';\nimport { fallbackItemHeight } from './common';\nimport { renderOptions } from './render-options';\nimport scrollToIndex from './scroll-to-index';\n\nimport styles from '../../../../select/parts/styles.css.js';\n\nexport interface ListProps {\n listProps: ListElementProps;\n getOptionProps: GetOptionProps;\n filteredOptions: ReadonlyArray<DropdownOption>;\n filteringValue: string;\n highlightType: HighlightType;\n hasDropdownStatus?: boolean;\n listBottom?: React.ReactNode;\n selectionType?: SelectionType;\n screenReaderContent?: string;\n firstOptionSticky?: boolean;\n isMultiSelect?: boolean;\n renderOption?: SelectProps.SelectOptionItemRenderer | MultiselectProps.MultiselectOptionItemRenderer;\n}\n\nconst PlainList = (\n {\n listProps,\n getOptionProps,\n filteredOptions,\n filteringValue,\n highlightType,\n hasDropdownStatus,\n listBottom,\n selectionType,\n screenReaderContent,\n firstOptionSticky,\n isMultiSelect,\n renderOption,\n }: ListProps,\n ref: React.Ref<ScrollToIndexRef>\n) => {\n const idPrefix = useUniqueId('select-list-');\n const stickyOptionRef = useRef<HTMLDivElement>(null);\n const [stickyOptionBlockSize, setStickyOptionBlockSize] = useState(firstOptionSticky ? fallbackItemHeight : 0);\n\n const [width, menuMeasureRef] = useContainerQuery(rect => {\n if (stickyOptionRef.current) {\n // Cannot use container query on the sticky option individually because it is not rendered until the dropdown is open.\n // Not expecting the sticky option to change size without the dropdown also changing size.\n\n // The effects of using the sticky option block size to set the menu scroll padding are covered by integration tests.\n // istanbul ignore next\n setStickyOptionBlockSize(stickyOptionRef.current.clientHeight);\n }\n return { inner: rect.contentBoxWidth, outer: rect.borderBoxWidth };\n });\n\n const menuRef = listProps.ref;\n\n const mergedRef = useMergeRefs(menuMeasureRef, menuRef);\n\n useImperativeHandle(\n ref,\n () => (index: number) => {\n const isSticky = firstOptionSticky && index === 0;\n if (highlightType.moveFocus && menuRef.current && !isSticky) {\n scrollToIndex({ index, menuEl: menuRef.current });\n }\n },\n [firstOptionSticky, highlightType.moveFocus, menuRef]\n );\n\n const withScrollbar = !!width && width.inner < width.outer;\n\n return (\n <OptionsList\n {...listProps}\n ref={mergedRef}\n stickyItemBlockSize={stickyOptionBlockSize}\n isMultiSelect={isMultiSelect}\n >\n {renderOptions({\n renderOption,\n options: filteredOptions,\n getOptionProps,\n filteringValue,\n idPrefix,\n highlightType,\n hasDropdownStatus,\n selectionType,\n screenReaderContent,\n firstOptionSticky,\n stickyOptionRef,\n withScrollbar,\n })}\n {listBottom ? (\n <div role=\"option\" className={styles['list-bottom']}>\n {listBottom}\n </div>\n ) : null}\n </OptionsList>\n );\n};\n\nexport default forwardRef(PlainList);\n"]}
@@ -4,16 +4,16 @@ import { SelectProps } from '../../../../select/interfaces';
4
4
  import { VirtualItem } from '../../../vendor/react-virtual';
5
5
  import { DropdownOption } from '../../option/interfaces';
6
6
  import { HighlightType } from '../../options-list/utils/use-highlight-option';
7
+ import { SelectionType } from '../selection/interfaces';
7
8
  interface RenderOptionProps {
8
9
  options: ReadonlyArray<DropdownOption>;
9
10
  getOptionProps: any;
10
11
  filteringValue: string;
11
12
  highlightType: HighlightType;
12
13
  idPrefix: string;
13
- checkboxes?: boolean;
14
14
  hasDropdownStatus?: boolean;
15
15
  virtualItems?: VirtualItem[];
16
- useInteractiveGroups?: boolean;
16
+ selectionType?: SelectionType;
17
17
  screenReaderContent?: string;
18
18
  ariaSetsize?: number;
19
19
  withScrollbar: boolean;
@@ -27,10 +27,9 @@ export declare const renderOptions: ({
27
27
  filteringValue,
28
28
  highlightType,
29
29
  idPrefix,
30
- checkboxes,
31
30
  hasDropdownStatus,
32
31
  virtualItems,
33
- useInteractiveGroups,
32
+ selectionType,
34
33
  screenReaderContent,
35
34
  ariaSetsize,
36
35
  withScrollbar,