@cloudscape-design/components-themeable 3.0.1023 → 3.0.1024

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 (147) hide show
  1. package/lib/internal/manifest.json +1 -1
  2. package/lib/internal/scss/collection-preferences/content-display/content-display-option.scss +2 -14
  3. package/lib/internal/scss/internal/components/drag-handle/styles.scss +2 -6
  4. package/lib/internal/scss/internal/components/sortable-area/styles.scss +1 -0
  5. package/lib/internal/scss/internal/components/structured-item/styles.scss +46 -0
  6. package/lib/internal/scss/internal/components/structured-item/test-classes/styles.scss +11 -0
  7. package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +1 -1
  8. package/lib/internal/scss/list/styles.scss +39 -0
  9. package/lib/internal/scss/list/test-classes/styles.scss +9 -0
  10. package/lib/internal/template/collection-preferences/content-display/content-display-option.d.ts +0 -2
  11. package/lib/internal/template/collection-preferences/content-display/content-display-option.d.ts.map +1 -1
  12. package/lib/internal/template/collection-preferences/content-display/content-display-option.js +1 -4
  13. package/lib/internal/template/collection-preferences/content-display/content-display-option.js.map +1 -1
  14. package/lib/internal/template/collection-preferences/content-display/index.d.ts.map +1 -1
  15. package/lib/internal/template/collection-preferences/content-display/index.js +17 -24
  16. package/lib/internal/template/collection-preferences/content-display/index.js.map +1 -1
  17. package/lib/internal/template/collection-preferences/interfaces.d.ts +2 -7
  18. package/lib/internal/template/collection-preferences/interfaces.d.ts.map +1 -1
  19. package/lib/internal/template/collection-preferences/interfaces.js.map +1 -1
  20. package/lib/internal/template/collection-preferences/styles.css.js +36 -38
  21. package/lib/internal/template/collection-preferences/styles.scoped.css +39 -51
  22. package/lib/internal/template/collection-preferences/styles.selectors.js +36 -38
  23. package/lib/internal/template/i18n/messages/all.all.js +1 -1
  24. package/lib/internal/template/i18n/messages/all.all.json +1 -1
  25. package/lib/internal/template/i18n/messages/all.ar.js +1 -1
  26. package/lib/internal/template/i18n/messages/all.ar.json +1 -1
  27. package/lib/internal/template/i18n/messages/all.de.js +1 -1
  28. package/lib/internal/template/i18n/messages/all.de.json +1 -1
  29. package/lib/internal/template/i18n/messages/all.en-GB.js +1 -1
  30. package/lib/internal/template/i18n/messages/all.en-GB.json +1 -1
  31. package/lib/internal/template/i18n/messages/all.en.js +1 -1
  32. package/lib/internal/template/i18n/messages/all.en.json +1 -1
  33. package/lib/internal/template/i18n/messages/all.es.js +1 -1
  34. package/lib/internal/template/i18n/messages/all.es.json +1 -1
  35. package/lib/internal/template/i18n/messages/all.fr.js +1 -1
  36. package/lib/internal/template/i18n/messages/all.fr.json +1 -1
  37. package/lib/internal/template/i18n/messages/all.id.js +1 -1
  38. package/lib/internal/template/i18n/messages/all.id.json +1 -1
  39. package/lib/internal/template/i18n/messages/all.it.js +1 -1
  40. package/lib/internal/template/i18n/messages/all.it.json +1 -1
  41. package/lib/internal/template/i18n/messages/all.ja.js +1 -1
  42. package/lib/internal/template/i18n/messages/all.ja.json +1 -1
  43. package/lib/internal/template/i18n/messages/all.ko.js +1 -1
  44. package/lib/internal/template/i18n/messages/all.ko.json +1 -1
  45. package/lib/internal/template/i18n/messages/all.pt-BR.js +1 -1
  46. package/lib/internal/template/i18n/messages/all.pt-BR.json +1 -1
  47. package/lib/internal/template/i18n/messages/all.th.js +1 -1
  48. package/lib/internal/template/i18n/messages/all.th.json +1 -1
  49. package/lib/internal/template/i18n/messages/all.tr.js +1 -1
  50. package/lib/internal/template/i18n/messages/all.tr.json +1 -1
  51. package/lib/internal/template/i18n/messages/all.zh-CN.js +1 -1
  52. package/lib/internal/template/i18n/messages/all.zh-CN.json +1 -1
  53. package/lib/internal/template/i18n/messages/all.zh-TW.js +1 -1
  54. package/lib/internal/template/i18n/messages/all.zh-TW.json +1 -1
  55. package/lib/internal/template/i18n/messages-types.d.ts +20 -0
  56. package/lib/internal/template/i18n/messages-types.d.ts.map +1 -1
  57. package/lib/internal/template/i18n/messages-types.js.map +1 -1
  58. package/lib/internal/template/index.d.ts +1 -0
  59. package/lib/internal/template/index.d.ts.map +1 -1
  60. package/lib/internal/template/index.js +1 -0
  61. package/lib/internal/template/index.js.map +1 -1
  62. package/lib/internal/template/internal/base-component/styles.scoped.css +1 -1
  63. package/lib/internal/template/internal/components/drag-handle/button.d.ts.map +1 -1
  64. package/lib/internal/template/internal/components/drag-handle/button.js +2 -2
  65. package/lib/internal/template/internal/components/drag-handle/button.js.map +1 -1
  66. package/lib/internal/template/internal/components/drag-handle/index.d.ts.map +1 -1
  67. package/lib/internal/template/internal/components/drag-handle/index.js +2 -2
  68. package/lib/internal/template/internal/components/drag-handle/index.js.map +1 -1
  69. package/lib/internal/template/internal/components/drag-handle/interfaces.d.ts +1 -0
  70. package/lib/internal/template/internal/components/drag-handle/interfaces.d.ts.map +1 -1
  71. package/lib/internal/template/internal/components/drag-handle/interfaces.js.map +1 -1
  72. package/lib/internal/template/internal/components/drag-handle/styles.css.js +13 -12
  73. package/lib/internal/template/internal/components/drag-handle/styles.scoped.css +18 -21
  74. package/lib/internal/template/internal/components/drag-handle/styles.selectors.js +13 -12
  75. package/lib/internal/template/internal/components/sortable-area/index.d.ts.map +1 -1
  76. package/lib/internal/template/internal/components/sortable-area/index.js +5 -1
  77. package/lib/internal/template/internal/components/sortable-area/index.js.map +1 -1
  78. package/lib/internal/template/internal/components/sortable-area/interfaces.d.ts +1 -0
  79. package/lib/internal/template/internal/components/sortable-area/interfaces.d.ts.map +1 -1
  80. package/lib/internal/template/internal/components/sortable-area/interfaces.js.map +1 -1
  81. package/lib/internal/template/internal/components/sortable-area/styles.css.js +8 -8
  82. package/lib/internal/template/internal/components/sortable-area/styles.scoped.css +18 -17
  83. package/lib/internal/template/internal/components/sortable-area/styles.selectors.js +8 -8
  84. package/lib/internal/template/internal/components/sortable-area/use-live-announcements.d.ts +5 -0
  85. package/lib/internal/template/internal/components/sortable-area/use-live-announcements.d.ts.map +1 -1
  86. package/lib/internal/template/internal/components/sortable-area/use-live-announcements.js +8 -0
  87. package/lib/internal/template/internal/components/sortable-area/use-live-announcements.js.map +1 -1
  88. package/lib/internal/template/internal/components/structured-item/index.d.ts +5 -0
  89. package/lib/internal/template/internal/components/structured-item/index.d.ts.map +1 -0
  90. package/lib/internal/template/internal/components/structured-item/index.js +16 -0
  91. package/lib/internal/template/internal/components/structured-item/index.js.map +1 -0
  92. package/lib/internal/template/internal/components/structured-item/interfaces.d.ts +9 -0
  93. package/lib/internal/template/internal/components/structured-item/interfaces.d.ts.map +1 -0
  94. package/lib/internal/template/internal/components/structured-item/interfaces.js +4 -0
  95. package/lib/internal/template/internal/components/structured-item/interfaces.js.map +1 -0
  96. package/lib/internal/template/internal/components/structured-item/styles.css.js +11 -0
  97. package/lib/internal/template/internal/components/structured-item/styles.scoped.css +212 -0
  98. package/lib/internal/template/internal/components/structured-item/styles.selectors.js +12 -0
  99. package/lib/internal/template/internal/components/structured-item/test-classes/styles.css.js +9 -0
  100. package/lib/internal/template/internal/components/structured-item/test-classes/styles.scoped.css +10 -0
  101. package/lib/internal/template/internal/components/structured-item/test-classes/styles.selectors.js +10 -0
  102. package/lib/internal/template/internal/environment.js +2 -2
  103. package/lib/internal/template/internal/environment.json +2 -2
  104. package/lib/internal/template/list/index.d.ts +5 -0
  105. package/lib/internal/template/list/index.d.ts.map +1 -0
  106. package/lib/internal/template/list/index.js +12 -0
  107. package/lib/internal/template/list/index.js.map +1 -0
  108. package/lib/internal/template/list/interfaces.d.ts +83 -0
  109. package/lib/internal/template/list/interfaces.d.ts.map +1 -0
  110. package/lib/internal/template/list/interfaces.js +4 -0
  111. package/lib/internal/template/list/interfaces.js.map +1 -0
  112. package/lib/internal/template/list/internal.d.ts +7 -0
  113. package/lib/internal/template/list/internal.d.ts.map +1 -0
  114. package/lib/internal/template/list/internal.js +62 -0
  115. package/lib/internal/template/list/internal.js.map +1 -0
  116. package/lib/internal/template/list/styles.css.js +10 -0
  117. package/lib/internal/template/list/styles.scoped.css +202 -0
  118. package/lib/internal/template/list/styles.selectors.js +11 -0
  119. package/lib/internal/template/list/test-classes/styles.css.js +7 -0
  120. package/lib/internal/template/list/test-classes/styles.scoped.css +8 -0
  121. package/lib/internal/template/list/test-classes/styles.selectors.js +8 -0
  122. package/lib/internal/template/package.json +1 -0
  123. package/lib/internal/template/test-utils/dom/collection-preferences/content-display-preference.d.ts +2 -0
  124. package/lib/internal/template/test-utils/dom/collection-preferences/content-display-preference.js +17 -6
  125. package/lib/internal/template/test-utils/dom/collection-preferences/content-display-preference.js.map +1 -1
  126. package/lib/internal/template/test-utils/dom/index.d.ts +20 -0
  127. package/lib/internal/template/test-utils/dom/index.js +13 -2
  128. package/lib/internal/template/test-utils/dom/index.js.map +1 -1
  129. package/lib/internal/template/test-utils/dom/internal/structured-item.d.ts +8 -0
  130. package/lib/internal/template/test-utils/dom/internal/structured-item.js +23 -0
  131. package/lib/internal/template/test-utils/dom/internal/structured-item.js.map +1 -0
  132. package/lib/internal/template/test-utils/dom/list/index.d.ts +23 -0
  133. package/lib/internal/template/test-utils/dom/list/index.js +41 -0
  134. package/lib/internal/template/test-utils/dom/list/index.js.map +1 -0
  135. package/lib/internal/template/test-utils/selectors/collection-preferences/content-display-preference.d.ts +2 -0
  136. package/lib/internal/template/test-utils/selectors/collection-preferences/content-display-preference.js +13 -6
  137. package/lib/internal/template/test-utils/selectors/collection-preferences/content-display-preference.js.map +1 -1
  138. package/lib/internal/template/test-utils/selectors/index.d.ts +18 -0
  139. package/lib/internal/template/test-utils/selectors/index.js +13 -2
  140. package/lib/internal/template/test-utils/selectors/index.js.map +1 -1
  141. package/lib/internal/template/test-utils/selectors/internal/structured-item.d.ts +8 -0
  142. package/lib/internal/template/test-utils/selectors/internal/structured-item.js +23 -0
  143. package/lib/internal/template/test-utils/selectors/internal/structured-item.js.map +1 -0
  144. package/lib/internal/template/test-utils/selectors/list/index.d.ts +23 -0
  145. package/lib/internal/template/test-utils/selectors/list/index.js +41 -0
  146. package/lib/internal/template/test-utils/selectors/list/index.js.map +1 -0
  147. package/package.json +1 -1
@@ -0,0 +1,83 @@
1
+ import { ReactNode } from 'react';
2
+ import { SortableAreaProps } from '../internal/components/sortable-area';
3
+ import { NonCancelableEventHandler } from '../internal/events';
4
+ export interface ListProps<T = any> {
5
+ /**
6
+ * The items to display in the list.
7
+ */
8
+ items: ReadonlyArray<T>;
9
+ /**
10
+ * Render an item. The function should return an object with the following keys:
11
+ * * `id` (string) - A unique identifier for the item.
12
+ * * `content` (React.ReactNode) - The content of the item.
13
+ * * `secondaryContent` (React.ReactNode) - (Optional) Secondary content, for example item description.
14
+ * * `icon` (React.ReactNode) - (Optional) An icon, displayed at the start.
15
+ * * `action` (React.ReactNode) - (Optional) Action button(s).
16
+ * * `announcementLabel` (string) - (Optional) An announcement label for the item, used when sorting.
17
+ * By default, the `content` is used: a custom label should be provided if `content` is not a string.
18
+ */
19
+ renderItem: (item: T) => {
20
+ id: string;
21
+ content: ReactNode;
22
+ secondaryContent?: ReactNode;
23
+ icon?: ReactNode;
24
+ action?: ReactNode;
25
+ announcementLabel?: string;
26
+ };
27
+ /**
28
+ * The HTML tag to render. By default `ul` is used for standard lists and `ol` for sortable lists.
29
+ */
30
+ tagOverride?: 'ol' | 'ul';
31
+ /**
32
+ * Adds an aria-label to the list.
33
+ */
34
+ ariaLabel?: string;
35
+ /**
36
+ * Adds an aria-labelledby to the list.
37
+ */
38
+ ariaLabelledby?: string;
39
+ /**
40
+ * Adds an aria-describedby to the list.
41
+ */
42
+ ariaDescribedby?: string;
43
+ /**
44
+ * Makes the list sortable by enabling drag and drop functionality.
45
+ */
46
+ sortable?: boolean;
47
+ /**
48
+ * Disables sorting drag handles. Use this to temporarily prevent users from reordering the list.
49
+ */
50
+ sortDisabled?: boolean;
51
+ /**
52
+ * Removes padding around and inside list items.
53
+ */
54
+ disableItemPaddings?: boolean;
55
+ /**
56
+ * Removes top and bottom padding around the list. Does not apply for sortable lists.
57
+ */
58
+ disablePaddings?: boolean;
59
+ /**
60
+ * Called when items are reordered in a sortable list.
61
+ */
62
+ onSortingChange?: NonCancelableEventHandler<ListProps.SortingState<T>>;
63
+ /**
64
+ * An object containing all the localized strings required by the component.
65
+ *
66
+ * - `liveAnnouncementDndStarted` ((position: number, total: number) => string) - (Optional) Adds a message to be announced by screen readers when an item is picked for reordering.
67
+ * - `liveAnnouncementDndDiscarded` (string) - (Optional) Adds a message to be announced by screen readers when a reordering action is canceled.
68
+ * - `liveAnnouncementDndItemReordered` ((initialPosition: number, currentPosition: number, total: number) => string) - (Optional) Adds a message to be announced by screen readers when an item is being moved.
69
+ * - `liveAnnouncementDndItemCommitted` ((initialPosition: number, finalPosition: number, total: number) => string) - (Optional) Adds a message to be announced by screen readers when a reordering action is committed.
70
+ * - `dragHandleAriaDescription` (string) - (Optional) Adds an ARIA description for the drag handle.
71
+ * - `dragHandleAriaLabel` (string) - (Optional) Adds an ARIA label for the drag handle.
72
+ *
73
+ * @i18n
74
+ */
75
+ i18nStrings?: ListProps.I18nStrings;
76
+ }
77
+ export declare namespace ListProps {
78
+ interface SortingState<T> {
79
+ items: ReadonlyArray<T>;
80
+ }
81
+ type I18nStrings = SortableAreaProps.DndAreaI18nStrings;
82
+ }
83
+ //# sourceMappingURL=interfaces.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/list/interfaces.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,MAAM,WAAW,SAAS,CAAC,CAAC,GAAG,GAAG;IAChC;;OAEG;IACH,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IAExB;;;;;;;;;OASG;IACH,UAAU,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK;QACvB,EAAE,EAAE,MAAM,CAAC;QACX,OAAO,EAAE,SAAS,CAAC;QACnB,gBAAgB,CAAC,EAAE,SAAS,CAAC;QAC7B,IAAI,CAAC,EAAE,SAAS,CAAC;QACjB,MAAM,CAAC,EAAE,SAAS,CAAC;QACnB,iBAAiB,CAAC,EAAE,MAAM,CAAC;KAC5B,CAAC;IAEF;;OAEG;IACH,WAAW,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAE1B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;OAEG;IACH,eAAe,CAAC,EAAE,yBAAyB,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;IACvE;;;;;;;;;;;OAWG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC,WAAW,CAAC;CACrC;AAED,yBAAiB,SAAS,CAAC;IACzB,UAAiB,YAAY,CAAC,CAAC;QAC7B,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;KACzB;IAED,KAAY,WAAW,GAAG,iBAAiB,CAAC,kBAAkB,CAAC;CAChE"}
@@ -0,0 +1,4 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export {};
4
+ //# sourceMappingURL=interfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/list/interfaces.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { ReactNode } from 'react';\n\nimport { SortableAreaProps } from '../internal/components/sortable-area';\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport interface ListProps<T = any> {\n /**\n * The items to display in the list.\n */\n items: ReadonlyArray<T>;\n\n /**\n * Render an item. The function should return an object with the following keys:\n * * `id` (string) - A unique identifier for the item.\n * * `content` (React.ReactNode) - The content of the item.\n * * `secondaryContent` (React.ReactNode) - (Optional) Secondary content, for example item description.\n * * `icon` (React.ReactNode) - (Optional) An icon, displayed at the start.\n * * `action` (React.ReactNode) - (Optional) Action button(s).\n * * `announcementLabel` (string) - (Optional) An announcement label for the item, used when sorting.\n * By default, the `content` is used: a custom label should be provided if `content` is not a string.\n */\n renderItem: (item: T) => {\n id: string;\n content: ReactNode;\n secondaryContent?: ReactNode;\n icon?: ReactNode;\n action?: ReactNode;\n announcementLabel?: string;\n };\n\n /**\n * The HTML tag to render. By default `ul` is used for standard lists and `ol` for sortable lists.\n */\n tagOverride?: 'ol' | 'ul';\n\n /**\n * Adds an aria-label to the list.\n */\n ariaLabel?: string;\n /**\n * Adds an aria-labelledby to the list.\n */\n ariaLabelledby?: string;\n /**\n * Adds an aria-describedby to the list.\n */\n ariaDescribedby?: string;\n /**\n * Makes the list sortable by enabling drag and drop functionality.\n */\n sortable?: boolean;\n /**\n * Disables sorting drag handles. Use this to temporarily prevent users from reordering the list.\n */\n sortDisabled?: boolean;\n /**\n * Removes padding around and inside list items.\n */\n disableItemPaddings?: boolean;\n /**\n * Removes top and bottom padding around the list. Does not apply for sortable lists.\n */\n disablePaddings?: boolean;\n /**\n * Called when items are reordered in a sortable list.\n */\n onSortingChange?: NonCancelableEventHandler<ListProps.SortingState<T>>;\n /**\n * An object containing all the localized strings required by the component.\n *\n * - `liveAnnouncementDndStarted` ((position: number, total: number) => string) - (Optional) Adds a message to be announced by screen readers when an item is picked for reordering.\n * - `liveAnnouncementDndDiscarded` (string) - (Optional) Adds a message to be announced by screen readers when a reordering action is canceled.\n * - `liveAnnouncementDndItemReordered` ((initialPosition: number, currentPosition: number, total: number) => string) - (Optional) Adds a message to be announced by screen readers when an item is being moved.\n * - `liveAnnouncementDndItemCommitted` ((initialPosition: number, finalPosition: number, total: number) => string) - (Optional) Adds a message to be announced by screen readers when a reordering action is committed.\n * - `dragHandleAriaDescription` (string) - (Optional) Adds an ARIA description for the drag handle.\n * - `dragHandleAriaLabel` (string) - (Optional) Adds an ARIA label for the drag handle.\n *\n * @i18n\n */\n i18nStrings?: ListProps.I18nStrings;\n}\n\nexport namespace ListProps {\n export interface SortingState<T> {\n items: ReadonlyArray<T>;\n }\n\n export type I18nStrings = SortableAreaProps.DndAreaI18nStrings;\n}\n"]}
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import { InternalBaseComponentProps } from '../internal/hooks/use-base-component';
3
+ import { ListProps } from './interfaces';
4
+ type InternalListProps<T = any> = InternalBaseComponentProps & ListProps<T>;
5
+ export default function InternalList<T = any>({ items, renderItem, sortable, sortDisabled, tagOverride: Tag, ariaLabel, ariaLabelledby, ariaDescribedby, onSortingChange, i18nStrings, disablePaddings, disableItemPaddings, __internalRootRef, ...rest }: InternalListProps<T>): JSX.Element;
6
+ export {};
7
+ //# sourceMappingURL=internal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/list/internal.tsx"],"names":[],"mappings":";AAgBA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAKzC,KAAK,iBAAiB,CAAC,CAAC,GAAG,GAAG,IAAI,0BAA0B,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;AAS5E,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,CAAC,GAAG,GAAG,EAAE,EAC5C,KAAK,EACL,UAAU,EACV,QAAgB,EAChB,YAAoB,EACpB,WAAW,EAAE,GAA4B,EACzC,SAAS,EACT,cAAc,EACd,eAAe,EACf,eAAe,EACf,WAAW,EACX,eAAe,EACf,mBAAmB,EACnB,iBAAwB,EACxB,GAAG,IAAI,EACR,EAAE,iBAAiB,CAAC,CAAC,CAAC,eAuGtB"}
@@ -0,0 +1,62 @@
1
+ import { __rest } from "tslib";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ import React from 'react';
5
+ import clsx from 'clsx';
6
+ import { useInternalI18n } from '../i18n/context';
7
+ import { getBaseProps } from '../internal/base-component';
8
+ import InternalDragHandle from '../internal/components/drag-handle';
9
+ import SortableArea from '../internal/components/sortable-area';
10
+ import { formatDndItemCommitted, formatDndItemReordered, formatDndStarted, } from '../internal/components/sortable-area/use-live-announcements';
11
+ import InternalStructuredItem from '../internal/components/structured-item';
12
+ import { fireNonCancelableEvent } from '../internal/events';
13
+ import styles from './styles.css.js';
14
+ import testClasses from './test-classes/styles.css.js';
15
+ const extractValidStructuredItemProps = ({ content, secondaryContent, icon, actions }) => ({
16
+ content,
17
+ secondaryContent,
18
+ icon,
19
+ actions,
20
+ });
21
+ export default function InternalList(_a) {
22
+ var { items, renderItem, sortable = false, sortDisabled = false, tagOverride: Tag = sortable ? 'ol' : 'ul', ariaLabel, ariaLabelledby, ariaDescribedby, onSortingChange, i18nStrings, disablePaddings, disableItemPaddings, __internalRootRef = null } = _a, rest = __rest(_a, ["items", "renderItem", "sortable", "sortDisabled", "tagOverride", "ariaLabel", "ariaLabelledby", "ariaDescribedby", "onSortingChange", "i18nStrings", "disablePaddings", "disableItemPaddings", "__internalRootRef"]);
23
+ const baseProps = getBaseProps(rest);
24
+ const i18n = useInternalI18n('list');
25
+ let contents;
26
+ if (sortable) {
27
+ contents = (React.createElement(SortableArea, { items: items, disableReorder: sortDisabled, itemDefinition: {
28
+ id: item => renderItem(item).id,
29
+ label: item => {
30
+ var _a;
31
+ const details = renderItem(item);
32
+ return (_a = details.announcementLabel) !== null && _a !== void 0 ? _a : details.content;
33
+ },
34
+ }, onItemsChange: event => fireNonCancelableEvent(onSortingChange, { items: event.detail.items }), i18nStrings: {
35
+ liveAnnouncementDndStarted: i18n('liveAnnouncementDndStarted', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.liveAnnouncementDndStarted, formatDndStarted),
36
+ liveAnnouncementDndItemReordered: i18n('liveAnnouncementDndItemReordered', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.liveAnnouncementDndItemReordered, formatDndItemReordered),
37
+ liveAnnouncementDndItemCommitted: i18n('liveAnnouncementDndItemCommitted', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.liveAnnouncementDndItemCommitted, formatDndItemCommitted),
38
+ liveAnnouncementDndDiscarded: i18n('liveAnnouncementDndDiscarded', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.liveAnnouncementDndDiscarded),
39
+ dragHandleAriaLabel: i18n('dragHandleAriaLabel', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.dragHandleAriaLabel),
40
+ dragHandleAriaDescription: i18n('dragHandleAriaDescription', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.dragHandleAriaDescription),
41
+ }, renderItem: ({ ref, item, id, style, className, dragHandleProps, isDragGhost }) => {
42
+ const structuredItemProps = extractValidStructuredItemProps(renderItem(item));
43
+ const itemClass = clsx(styles.item, testClasses.item, disableItemPaddings && styles['disable-item-paddings'], styles['sortable-item'], className);
44
+ const content = (React.createElement(React.Fragment, null,
45
+ React.createElement(InternalDragHandle, Object.assign({}, dragHandleProps)),
46
+ React.createElement(InternalStructuredItem, Object.assign({}, structuredItemProps, { disablePaddings: disableItemPaddings }))));
47
+ if (isDragGhost) {
48
+ return React.createElement("div", { className: itemClass }, content);
49
+ }
50
+ return (React.createElement("li", { ref: ref, className: itemClass, style: style, "data-testid": id }, content));
51
+ } }));
52
+ }
53
+ else {
54
+ contents = items === null || items === void 0 ? void 0 : items.map(item => {
55
+ const _a = renderItem(item), { id } = _a, structuredItemProps = __rest(_a, ["id"]);
56
+ return (React.createElement("li", { key: id, "data-testid": id, className: clsx(styles.item, testClasses.item, disablePaddings && styles['disable-paddings'], disableItemPaddings && styles['disable-item-paddings']) },
57
+ React.createElement(InternalStructuredItem, Object.assign({}, extractValidStructuredItemProps(structuredItemProps), { disablePaddings: disableItemPaddings }))));
58
+ });
59
+ }
60
+ return (React.createElement(Tag, Object.assign({ ref: __internalRootRef }, baseProps, { className: clsx(baseProps.className, styles.root, testClasses.root), "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby }), contents));
61
+ }
62
+ //# sourceMappingURL=internal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/list/internal.tsx"],"names":[],"mappings":"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","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { ReactNode } from 'react';\nimport clsx from 'clsx';\n\nimport { useInternalI18n } from '../i18n/context';\nimport { getBaseProps } from '../internal/base-component';\nimport InternalDragHandle from '../internal/components/drag-handle';\nimport SortableArea from '../internal/components/sortable-area';\nimport {\n formatDndItemCommitted,\n formatDndItemReordered,\n formatDndStarted,\n} from '../internal/components/sortable-area/use-live-announcements';\nimport InternalStructuredItem, { StructuredItemProps } from '../internal/components/structured-item';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { ListProps } from './interfaces';\n\nimport styles from './styles.css.js';\nimport testClasses from './test-classes/styles.css.js';\n\ntype InternalListProps<T = any> = InternalBaseComponentProps & ListProps<T>;\n\nconst extractValidStructuredItemProps = ({ content, secondaryContent, icon, actions }: StructuredItemProps) => ({\n content,\n secondaryContent,\n icon,\n actions,\n});\n\nexport default function InternalList<T = any>({\n items,\n renderItem,\n sortable = false,\n sortDisabled = false,\n tagOverride: Tag = sortable ? 'ol' : 'ul',\n ariaLabel,\n ariaLabelledby,\n ariaDescribedby,\n onSortingChange,\n i18nStrings,\n disablePaddings,\n disableItemPaddings,\n __internalRootRef = null,\n ...rest\n}: InternalListProps<T>) {\n const baseProps = getBaseProps(rest);\n const i18n = useInternalI18n('list');\n\n let contents: ReactNode;\n if (sortable) {\n contents = (\n <SortableArea\n items={items}\n disableReorder={sortDisabled}\n itemDefinition={{\n id: item => renderItem(item).id,\n label: item => {\n const details = renderItem(item);\n return details.announcementLabel ?? (details.content as string);\n },\n }}\n onItemsChange={event => fireNonCancelableEvent(onSortingChange, { items: event.detail.items })}\n i18nStrings={{\n liveAnnouncementDndStarted: i18n(\n 'liveAnnouncementDndStarted',\n i18nStrings?.liveAnnouncementDndStarted,\n formatDndStarted\n ),\n liveAnnouncementDndItemReordered: i18n(\n 'liveAnnouncementDndItemReordered',\n i18nStrings?.liveAnnouncementDndItemReordered,\n formatDndItemReordered\n ),\n liveAnnouncementDndItemCommitted: i18n(\n 'liveAnnouncementDndItemCommitted',\n i18nStrings?.liveAnnouncementDndItemCommitted,\n formatDndItemCommitted\n ),\n liveAnnouncementDndDiscarded: i18n('liveAnnouncementDndDiscarded', i18nStrings?.liveAnnouncementDndDiscarded),\n dragHandleAriaLabel: i18n('dragHandleAriaLabel', i18nStrings?.dragHandleAriaLabel),\n dragHandleAriaDescription: i18n('dragHandleAriaDescription', i18nStrings?.dragHandleAriaDescription),\n }}\n renderItem={({ ref, item, id, style, className, dragHandleProps, isDragGhost }) => {\n const structuredItemProps = extractValidStructuredItemProps(renderItem(item));\n\n const itemClass = clsx(\n styles.item,\n testClasses.item,\n disableItemPaddings && styles['disable-item-paddings'],\n styles['sortable-item'],\n className\n );\n\n const content = (\n <>\n <InternalDragHandle {...dragHandleProps} />\n <InternalStructuredItem {...structuredItemProps} disablePaddings={disableItemPaddings} />\n </>\n );\n\n if (isDragGhost) {\n return <div className={itemClass}>{content}</div>;\n }\n\n return (\n <li ref={ref} className={itemClass} style={style} data-testid={id}>\n {content}\n </li>\n );\n }}\n />\n );\n } else {\n contents = items?.map(item => {\n const { id, ...structuredItemProps } = renderItem(item);\n return (\n <li\n key={id}\n data-testid={id}\n className={clsx(\n styles.item,\n testClasses.item,\n disablePaddings && styles['disable-paddings'],\n disableItemPaddings && styles['disable-item-paddings']\n )}\n >\n <InternalStructuredItem\n {...extractValidStructuredItemProps(structuredItemProps)}\n disablePaddings={disableItemPaddings}\n />\n </li>\n );\n });\n }\n\n return (\n <Tag\n ref={__internalRootRef}\n {...baseProps}\n className={clsx(baseProps.className, styles.root, testClasses.root)}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n aria-describedby={ariaDescribedby}\n >\n {contents}\n </Tag>\n );\n}\n"]}
@@ -0,0 +1,10 @@
1
+
2
+ import './styles.scoped.css';
3
+ export default {
4
+ "root": "awsui_root_1axkx_1mjlv_145",
5
+ "item": "awsui_item_1axkx_1mjlv_183",
6
+ "disable-item-paddings": "awsui_disable-item-paddings_1axkx_1mjlv_186",
7
+ "disable-paddings": "awsui_disable-paddings_1axkx_1mjlv_189",
8
+ "sortable-item": "awsui_sortable-item_1axkx_1mjlv_196"
9
+ };
10
+
@@ -0,0 +1,202 @@
1
+ /*
2
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ /*
6
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
7
+ SPDX-License-Identifier: Apache-2.0
8
+ */
9
+ /*
10
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
11
+ SPDX-License-Identifier: Apache-2.0
12
+ */
13
+ /*
14
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
15
+ SPDX-License-Identifier: Apache-2.0
16
+ */
17
+ /*
18
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
19
+ SPDX-License-Identifier: Apache-2.0
20
+ */
21
+ /*
22
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
23
+ SPDX-License-Identifier: Apache-2.0
24
+ */
25
+ /*
26
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
27
+ SPDX-License-Identifier: Apache-2.0
28
+ */
29
+ /*
30
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
31
+ SPDX-License-Identifier: Apache-2.0
32
+ */
33
+ /*
34
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
35
+ SPDX-License-Identifier: Apache-2.0
36
+ */
37
+ /*
38
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
39
+ SPDX-License-Identifier: Apache-2.0
40
+ */
41
+ /*
42
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
43
+ SPDX-License-Identifier: Apache-2.0
44
+ */
45
+ /*
46
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
47
+ SPDX-License-Identifier: Apache-2.0
48
+ */
49
+ /*
50
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
51
+ SPDX-License-Identifier: Apache-2.0
52
+ */
53
+ /*
54
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
55
+ SPDX-License-Identifier: Apache-2.0
56
+ */
57
+ /*
58
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
59
+ SPDX-License-Identifier: Apache-2.0
60
+ */
61
+ /*
62
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
63
+ SPDX-License-Identifier: Apache-2.0
64
+ */
65
+ /*
66
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
67
+ SPDX-License-Identifier: Apache-2.0
68
+ */
69
+ /*
70
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
71
+ SPDX-License-Identifier: Apache-2.0
72
+ */
73
+ /*
74
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
75
+ SPDX-License-Identifier: Apache-2.0
76
+ */
77
+ /*
78
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
79
+ SPDX-License-Identifier: Apache-2.0
80
+ */
81
+ /*
82
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
83
+ SPDX-License-Identifier: Apache-2.0
84
+ */
85
+ /*
86
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
87
+ SPDX-License-Identifier: Apache-2.0
88
+ */
89
+ /*
90
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
91
+ SPDX-License-Identifier: Apache-2.0
92
+ */
93
+ /*
94
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
95
+ SPDX-License-Identifier: Apache-2.0
96
+ */
97
+ /*
98
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
99
+ SPDX-License-Identifier: Apache-2.0
100
+ */
101
+ /*
102
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
103
+ SPDX-License-Identifier: Apache-2.0
104
+ */
105
+ /*
106
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
107
+ SPDX-License-Identifier: Apache-2.0
108
+ */
109
+ /*
110
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
111
+ SPDX-License-Identifier: Apache-2.0
112
+ */
113
+ /* stylelint-disable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
114
+ /* stylelint-enable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
115
+ /*
116
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
117
+ SPDX-License-Identifier: Apache-2.0
118
+ */
119
+ /*
120
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
121
+ SPDX-License-Identifier: Apache-2.0
122
+ */
123
+ /*
124
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
125
+ SPDX-License-Identifier: Apache-2.0
126
+ */
127
+ /*
128
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
129
+ SPDX-License-Identifier: Apache-2.0
130
+ */
131
+ /*
132
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
133
+ SPDX-License-Identifier: Apache-2.0
134
+ */
135
+ /*
136
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
137
+ SPDX-License-Identifier: Apache-2.0
138
+ */
139
+ /*
140
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
141
+ SPDX-License-Identifier: Apache-2.0
142
+ */
143
+ /* Style used for links in slots/components that are text heavy, to help links stand out among
144
+ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F73#description */
145
+ .awsui_root_1axkx_1mjlv_145:not(#\9) {
146
+ border-collapse: separate;
147
+ border-spacing: 0;
148
+ box-sizing: border-box;
149
+ caption-side: top;
150
+ cursor: auto;
151
+ direction: inherit;
152
+ empty-cells: show;
153
+ font-family: serif;
154
+ font-style: normal;
155
+ font-variant: normal;
156
+ font-stretch: normal;
157
+ hyphens: none;
158
+ letter-spacing: normal;
159
+ list-style: disc outside none;
160
+ tab-size: 8;
161
+ text-align: start;
162
+ text-indent: 0;
163
+ text-shadow: none;
164
+ text-transform: none;
165
+ visibility: visible;
166
+ white-space: normal;
167
+ word-spacing: normal;
168
+ font-size: var(--font-size-body-m-vv54cm, 14px);
169
+ line-height: var(--line-height-body-m-bedeoh, 22px);
170
+ color: var(--color-text-body-default-5qid0u, #16191f);
171
+ font-weight: 400;
172
+ font-family: var(--font-family-base-8x5ngf, "Noto Sans", "Helvetica Neue", Roboto, Arial, sans-serif);
173
+ -webkit-font-smoothing: auto;
174
+ -moz-osx-font-smoothing: auto;
175
+ list-style: none;
176
+ padding-block: 0;
177
+ padding-inline: 0;
178
+ margin-block: 0;
179
+ margin-inline: 0;
180
+ position: relative;
181
+ }
182
+
183
+ .awsui_item_1axkx_1mjlv_183:not(#\9):not(:last-child) {
184
+ border-block-end: var(--border-divider-list-width-8ggz94, 1px) solid var(--color-border-divider-secondary-4wvr5g, #eaeded);
185
+ }
186
+ .awsui_item_1axkx_1mjlv_183:not(#\9):not(.awsui_disable-item-paddings_1axkx_1mjlv_186) {
187
+ padding-block: var(--space-scaled-xs-sppte9, 8px);
188
+ }
189
+ .awsui_item_1axkx_1mjlv_183:not(#\9):first-child.awsui_disable-paddings_1axkx_1mjlv_189 {
190
+ padding-block-start: 0;
191
+ }
192
+ .awsui_item_1axkx_1mjlv_183:not(#\9):last-child.awsui_disable-paddings_1axkx_1mjlv_189 {
193
+ padding-block-end: 0;
194
+ }
195
+
196
+ .awsui_sortable-item_1axkx_1mjlv_196:not(#\9) {
197
+ display: flex;
198
+ align-items: baseline;
199
+ }
200
+ .awsui_sortable-item_1axkx_1mjlv_196:not(#\9):not(.awsui_disable-item-paddings_1axkx_1mjlv_186) {
201
+ column-gap: var(--space-xxs-jnczic, 4px);
202
+ }
@@ -0,0 +1,11 @@
1
+
2
+ // es-module interop with Babel and Typescript
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ module.exports.default = {
5
+ "root": "awsui_root_1axkx_1mjlv_145",
6
+ "item": "awsui_item_1axkx_1mjlv_183",
7
+ "disable-item-paddings": "awsui_disable-item-paddings_1axkx_1mjlv_186",
8
+ "disable-paddings": "awsui_disable-paddings_1axkx_1mjlv_189",
9
+ "sortable-item": "awsui_sortable-item_1axkx_1mjlv_196"
10
+ };
11
+
@@ -0,0 +1,7 @@
1
+
2
+ import './styles.scoped.css';
3
+ export default {
4
+ "root": "awsui_root_rckk5_b9f2m_5",
5
+ "item": "awsui_item_rckk5_b9f2m_6"
6
+ };
7
+
@@ -0,0 +1,8 @@
1
+ /*
2
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ .awsui_root_rckk5_b9f2m_5:not(#\9),
6
+ .awsui_item_rckk5_b9f2m_6:not(#\9) {
7
+ /* used in test-utils */
8
+ }
@@ -0,0 +1,8 @@
1
+
2
+ // es-module interop with Babel and Typescript
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ module.exports.default = {
5
+ "root": "awsui_root_rckk5_b9f2m_5",
6
+ "item": "awsui_item_rckk5_b9f2m_6"
7
+ };
8
+
@@ -73,6 +73,7 @@
73
73
  "./key-value-pairs": "./key-value-pairs/index.js",
74
74
  "./line-chart": "./line-chart/index.js",
75
75
  "./link": "./link/index.js",
76
+ "./list": "./list/index.js",
76
77
  "./live-region": "./live-region/index.js",
77
78
  "./mixed-line-bar-chart": "./mixed-line-bar-chart/index.js",
78
79
  "./modal": "./modal/index.js",
@@ -2,6 +2,7 @@ import { ComponentWrapper, ElementWrapper } from '@cloudscape-design/test-utils-
2
2
  import TextFilterWrapper from '../text-filter';
3
3
  import ToggleWrapper from '../toggle';
4
4
  export declare class ContentDisplayOptionWrapper extends ComponentWrapper {
5
+ private getListItem;
5
6
  /**
6
7
  * Returns the drag handle for the option item.
7
8
  */
@@ -25,6 +26,7 @@ export default class ContentDisplayPreferenceWrapper extends ComponentWrapper {
25
26
  * Returns the preference description displayed below the title.
26
27
  */
27
28
  findDescription(): ElementWrapper;
29
+ private getList;
28
30
  /**
29
31
  * Returns an option for a given index.
30
32
  *
@@ -4,29 +4,34 @@ exports.ContentDisplayOptionWrapper = void 0;
4
4
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
5
5
  // SPDX-License-Identifier: Apache-2.0
6
6
  const dom_1 = require("@cloudscape-design/test-utils-core/dom");
7
+ const list_1 = require("../list");
7
8
  const text_filter_1 = require("../text-filter");
8
9
  const toggle_1 = require("../toggle");
9
10
  const styles_selectors_js_1 = require("../../../collection-preferences/styles.selectors.js");
10
- const styles_selectors_js_2 = require("../../../internal/components/drag-handle/styles.selectors.js");
11
11
  const getClassName = (suffix) => styles_selectors_js_1.default[`content-display-${suffix}`];
12
12
  class ContentDisplayOptionWrapper extends dom_1.ComponentWrapper {
13
+ getListItem() {
14
+ return new list_1.ListItemWrapper(this.getElement());
15
+ }
13
16
  /**
14
17
  * Returns the drag handle for the option item.
15
18
  */
16
19
  findDragHandle() {
17
- return this.findByClassName(styles_selectors_js_2.default.handle);
20
+ return this.getListItem().findDragHandle();
18
21
  }
19
22
  /**
20
23
  * Returns the text label displayed in the option item.
21
24
  */
22
25
  findLabel() {
23
- return this.findByClassName(styles_selectors_js_1.default['content-display-option-label']);
26
+ return this.getListItem().findContent().findByClassName(styles_selectors_js_1.default['content-display-option-label']);
24
27
  }
25
28
  /**
26
29
  * Returns the visibility toggle for the option item.
27
30
  */
28
31
  findVisibilityToggle() {
29
- return this.findComponent(`.${styles_selectors_js_1.default['content-display-option-toggle']}`, toggle_1.default);
32
+ return this.getListItem()
33
+ .findContent()
34
+ .findComponent(`.${styles_selectors_js_1.default['content-display-option-toggle']}`, toggle_1.default);
30
35
  }
31
36
  }
32
37
  exports.ContentDisplayOptionWrapper = ContentDisplayOptionWrapper;
@@ -43,19 +48,25 @@ class ContentDisplayPreferenceWrapper extends dom_1.ComponentWrapper {
43
48
  findDescription() {
44
49
  return this.findByClassName(getClassName('description'));
45
50
  }
51
+ getList() {
52
+ return new list_1.default(this.getElement());
53
+ }
46
54
  /**
47
55
  * Returns an option for a given index.
48
56
  *
49
57
  * @param index 1-based index of the option to return.
50
58
  */
51
59
  findOptionByIndex(index) {
52
- return this.findComponent(`.${getClassName('option')}:nth-child(${index})`, ContentDisplayOptionWrapper);
60
+ const item = this.getList().findItemByIndex(index);
61
+ return item && new ContentDisplayOptionWrapper(item.getElement());
53
62
  }
54
63
  /**
55
64
  * Returns options that the user can reorder.
56
65
  */
57
66
  findOptions() {
58
- return this.findAllByClassName(getClassName('option')).map(wrapper => new ContentDisplayOptionWrapper(wrapper.getElement()));
67
+ return this.getList()
68
+ .findItems()
69
+ .map(wrapper => new ContentDisplayOptionWrapper(wrapper.getElement()));
59
70
  }
60
71
  /**
61
72
  * Returns the text filter input.
@@ -1 +1 @@
1
- {"version":3,"file":"content-display-preference.js","sourceRoot":"","sources":["../../../../../src/test-utils/dom/collection-preferences/content-display-preference.ts"],"names":[],"mappings":";;;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,gEAA0F;AAE1F,gDAA+C;AAC/C,sCAAsC;AAEtC,6FAAyE;AACzE,sGAA4F;AAE5F,MAAM,YAAY,GAAG,CAAC,MAAc,EAAU,EAAE,CAAC,6BAAM,CAAC,mBAAmB,MAAM,EAAE,CAAC,CAAC;AAErF,MAAa,2BAA4B,SAAQ,sBAAgB;IAC/D;;OAEG;IACH,cAAc;QACZ,OAAO,IAAI,CAAC,eAAe,CAAC,6BAAgB,CAAC,MAAM,CAAE,CAAC;IACxD,CAAC;IAED;;OAEG;IACH,SAAS;QACP,OAAO,IAAI,CAAC,eAAe,CAAC,6BAAM,CAAC,8BAA8B,CAAC,CAAE,CAAC;IACvE,CAAC;IAED;;OAEG;IACH,oBAAoB;QAClB,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,6BAAM,CAAC,+BAA+B,CAAC,EAAE,EAAE,gBAAa,CAAE,CAAC;IAC3F,CAAC;CACF;AArBD,kEAqBC;AAED,MAAqB,+BAAgC,SAAQ,sBAAgB;IAG3E;;OAEG;IACH,SAAS;QACP,OAAO,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,OAAO,CAAC,CAAE,CAAC;IACtD,CAAC;IAED;;OAEG;IACH,eAAe;QACb,OAAO,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,aAAa,CAAC,CAAE,CAAC;IAC5D,CAAC;IAED;;;;OAIG;IACH,iBAAiB,CAAC,KAAa;QAC7B,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,YAAY,CAAC,QAAQ,CAAC,cAAc,KAAK,GAAG,EAAE,2BAA2B,CAAC,CAAC;IAC3G,CAAC;IAED;;OAEG;IACH,WAAW;QACT,OAAO,IAAI,CAAC,kBAAkB,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CACxD,OAAO,CAAC,EAAE,CAAC,IAAI,2BAA2B,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,CACjE,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,cAAc;QACZ,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,6BAAM,CAAC,6BAA6B,CAAC,EAAE,EAAE,qBAAiB,CAAC,CAAC;IAC5F,CAAC;IAED;;OAEG;IACH,WAAW;QACT,OAAO,IAAI,CAAC,eAAe,CAAC,6BAAM,CAAC,0BAA0B,CAAC,CAAC,CAAC;IAClE,CAAC;;AA/CH,kDAgDC;AA/CQ,4CAAY,GAAG,6BAAM,CAAC,iBAAiB,CAAC,CAAC"}
1
+ {"version":3,"file":"content-display-preference.js","sourceRoot":"","sources":["../../../../../src/test-utils/dom/collection-preferences/content-display-preference.ts"],"names":[],"mappings":";;;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,gEAA0F;AAE1F,kCAAuD;AACvD,gDAA+C;AAC/C,sCAAsC;AAEtC,6FAAyE;AAEzE,MAAM,YAAY,GAAG,CAAC,MAAc,EAAU,EAAE,CAAC,6BAAM,CAAC,mBAAmB,MAAM,EAAE,CAAC,CAAC;AAErF,MAAa,2BAA4B,SAAQ,sBAAgB;IACvD,WAAW;QACjB,OAAO,IAAI,sBAAe,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;IAChD,CAAC;IACD;;OAEG;IACH,cAAc;QACZ,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC,cAAc,EAAG,CAAC;IAC9C,CAAC;IAED;;OAEG;IACH,SAAS;QACP,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC,WAAW,EAAE,CAAC,eAAe,CAAC,6BAAM,CAAC,8BAA8B,CAAC,CAAE,CAAC;IACnG,CAAC;IAED;;OAEG;IACH,oBAAoB;QAClB,OAAO,IAAI,CAAC,WAAW,EAAE;aACtB,WAAW,EAAE;aACb,aAAa,CAAC,IAAI,6BAAM,CAAC,+BAA+B,CAAC,EAAE,EAAE,gBAAa,CAAE,CAAC;IAClF,CAAC;CACF;AA1BD,kEA0BC;AAED,MAAqB,+BAAgC,SAAQ,sBAAgB;IAG3E;;OAEG;IACH,SAAS;QACP,OAAO,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,OAAO,CAAC,CAAE,CAAC;IACtD,CAAC;IAED;;OAEG;IACH,eAAe;QACb,OAAO,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,aAAa,CAAC,CAAE,CAAC;IAC5D,CAAC;IAEO,OAAO;QACb,OAAO,IAAI,cAAW,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;IAC5C,CAAC;IAED;;;;OAIG;IACH,iBAAiB,CAAC,KAAa;QAC7B,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;QACnD,OAAO,IAAI,IAAI,IAAI,2BAA2B,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;IACpE,CAAC;IAED;;OAEG;IACH,WAAW;QACT,OAAO,IAAI,CAAC,OAAO,EAAE;aAClB,SAAS,EAAE;aACX,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,2BAA2B,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IAC3E,CAAC;IAED;;OAEG;IACH,cAAc;QACZ,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,6BAAM,CAAC,6BAA6B,CAAC,EAAE,EAAE,qBAAiB,CAAC,CAAC;IAC5F,CAAC;IAED;;OAEG;IACH,WAAW;QACT,OAAO,IAAI,CAAC,eAAe,CAAC,6BAAM,CAAC,0BAA0B,CAAC,CAAC,CAAC;IAClE,CAAC;;AApDH,kDAqDC;AApDQ,4CAAY,GAAG,6BAAM,CAAC,iBAAiB,CAAC,CAAC"}
@@ -45,6 +45,7 @@ import InputWrapper from './input';
45
45
  import KeyValuePairsWrapper from './key-value-pairs';
46
46
  import LineChartWrapper from './line-chart';
47
47
  import LinkWrapper from './link';
48
+ import ListWrapper from './list';
48
49
  import LiveRegionWrapper from './live-region';
49
50
  import MixedLineBarChartWrapper from './mixed-line-bar-chart';
50
51
  import ModalWrapper from './modal';
@@ -125,6 +126,7 @@ export { InputWrapper };
125
126
  export { KeyValuePairsWrapper };
126
127
  export { LineChartWrapper };
127
128
  export { LinkWrapper };
129
+ export { ListWrapper };
128
130
  export { LiveRegionWrapper };
129
131
  export { MixedLineBarChartWrapper };
130
132
  export { ModalWrapper };
@@ -972,6 +974,24 @@ declare module '@cloudscape-design/test-utils-core/dist/dom' {
972
974
  * @returns {Array<LinkWrapper>}
973
975
  */
974
976
  findAllLinks(selector?: string): Array<LinkWrapper>;
977
+ /**
978
+ * Returns the wrapper of the first List that matches the specified CSS selector.
979
+ * If no CSS selector is specified, returns the wrapper of the first List.
980
+ * If no matching List is found, returns `null`.
981
+ *
982
+ * @param {string} [selector] CSS Selector
983
+ * @returns {ListWrapper | null}
984
+ */
985
+ findList(selector?: string): ListWrapper | null;
986
+ /**
987
+ * Returns an array of List wrapper that matches the specified CSS selector.
988
+ * If no CSS selector is specified, returns all of the Lists inside the current wrapper.
989
+ * If no matching List is found, returns an empty array.
990
+ *
991
+ * @param {string} [selector] CSS Selector
992
+ * @returns {Array<ListWrapper>}
993
+ */
994
+ findAllLists(selector?: string): Array<ListWrapper>;
975
995
  /**
976
996
  * Returns the wrapper of the first LiveRegion that matches the specified CSS selector.
977
997
  * If no CSS selector is specified, returns the wrapper of the first LiveRegion.
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MultiselectWrapper = exports.ModalWrapper = exports.MixedLineBarChartWrapper = exports.LiveRegionWrapper = exports.LinkWrapper = exports.LineChartWrapper = exports.KeyValuePairsWrapper = exports.InputWrapper = exports.IconWrapper = exports.HotspotWrapper = exports.HelpPanelWrapper = exports.HeaderWrapper = exports.GridWrapper = exports.FormFieldWrapper = exports.FormWrapper = exports.FlashbarWrapper = exports.FileUploadWrapper = exports.FileTokenGroupWrapper = exports.FileInputWrapper = exports.FileDropzoneWrapper = exports.ExpandableSectionWrapper = exports.DrawerWrapper = exports.DateRangePickerWrapper = exports.DatePickerWrapper = exports.DateInputWrapper = exports.CopyToClipboardWrapper = exports.ContentLayoutWrapper = exports.ContainerWrapper = exports.ColumnLayoutWrapper = exports.CollectionPreferencesWrapper = exports.CodeEditorWrapper = exports.CheckboxWrapper = exports.CardsWrapper = exports.CalendarWrapper = exports.ButtonGroupWrapper = exports.ButtonDropdownWrapper = exports.ButtonWrapper = exports.BreadcrumbGroupWrapper = exports.BoxWrapper = exports.BarChartWrapper = exports.BadgeWrapper = exports.AutosuggestWrapper = exports.AttributeEditorWrapper = exports.AreaChartWrapper = exports.AppLayoutToolbarWrapper = exports.AppLayoutWrapper = exports.AnnotationWrapper = exports.AnchorNavigationWrapper = exports.AlertWrapper = exports.ElementWrapper = void 0;
4
- exports.WizardWrapper = exports.TutorialPanelWrapper = exports.TopNavigationWrapper = exports.TokenGroupWrapper = exports.ToggleButtonWrapper = exports.ToggleWrapper = exports.TimeInputWrapper = exports.TilesWrapper = exports.TextareaWrapper = exports.TextFilterWrapper = exports.TextContentWrapper = exports.TagEditorWrapper = exports.TabsWrapper = exports.TableWrapper = exports.StepsWrapper = exports.StatusIndicatorWrapper = exports.SplitPanelWrapper = exports.SpinnerWrapper = exports.SpaceBetweenWrapper = exports.SliderWrapper = exports.SideNavigationWrapper = exports.SelectWrapper = exports.SegmentedControlWrapper = exports.S3ResourceSelectorWrapper = exports.RadioGroupWrapper = exports.PropertyFilterWrapper = exports.PromptInputWrapper = exports.ProgressBarWrapper = exports.PopoverWrapper = exports.PieChartWrapper = exports.PaginationWrapper = void 0;
3
+ exports.ModalWrapper = exports.MixedLineBarChartWrapper = exports.LiveRegionWrapper = exports.ListWrapper = exports.LinkWrapper = exports.LineChartWrapper = exports.KeyValuePairsWrapper = exports.InputWrapper = exports.IconWrapper = exports.HotspotWrapper = exports.HelpPanelWrapper = exports.HeaderWrapper = exports.GridWrapper = exports.FormFieldWrapper = exports.FormWrapper = exports.FlashbarWrapper = exports.FileUploadWrapper = exports.FileTokenGroupWrapper = exports.FileInputWrapper = exports.FileDropzoneWrapper = exports.ExpandableSectionWrapper = exports.DrawerWrapper = exports.DateRangePickerWrapper = exports.DatePickerWrapper = exports.DateInputWrapper = exports.CopyToClipboardWrapper = exports.ContentLayoutWrapper = exports.ContainerWrapper = exports.ColumnLayoutWrapper = exports.CollectionPreferencesWrapper = exports.CodeEditorWrapper = exports.CheckboxWrapper = exports.CardsWrapper = exports.CalendarWrapper = exports.ButtonGroupWrapper = exports.ButtonDropdownWrapper = exports.ButtonWrapper = exports.BreadcrumbGroupWrapper = exports.BoxWrapper = exports.BarChartWrapper = exports.BadgeWrapper = exports.AutosuggestWrapper = exports.AttributeEditorWrapper = exports.AreaChartWrapper = exports.AppLayoutToolbarWrapper = exports.AppLayoutWrapper = exports.AnnotationWrapper = exports.AnchorNavigationWrapper = exports.AlertWrapper = exports.ElementWrapper = void 0;
4
+ exports.WizardWrapper = exports.TutorialPanelWrapper = exports.TopNavigationWrapper = exports.TokenGroupWrapper = exports.ToggleButtonWrapper = exports.ToggleWrapper = exports.TimeInputWrapper = exports.TilesWrapper = exports.TextareaWrapper = exports.TextFilterWrapper = exports.TextContentWrapper = exports.TagEditorWrapper = exports.TabsWrapper = exports.TableWrapper = exports.StepsWrapper = exports.StatusIndicatorWrapper = exports.SplitPanelWrapper = exports.SpinnerWrapper = exports.SpaceBetweenWrapper = exports.SliderWrapper = exports.SideNavigationWrapper = exports.SelectWrapper = exports.SegmentedControlWrapper = exports.S3ResourceSelectorWrapper = exports.RadioGroupWrapper = exports.PropertyFilterWrapper = exports.PromptInputWrapper = exports.ProgressBarWrapper = exports.PopoverWrapper = exports.PieChartWrapper = exports.PaginationWrapper = exports.MultiselectWrapper = void 0;
5
5
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
6
6
  // SPDX-License-Identifier: Apache-2.0
7
7
  const dom_1 = require("@cloudscape-design/test-utils-core/dom");
@@ -97,6 +97,8 @@ const line_chart_1 = require("./line-chart");
97
97
  exports.LineChartWrapper = line_chart_1.default;
98
98
  const link_1 = require("./link");
99
99
  exports.LinkWrapper = link_1.default;
100
+ const list_1 = require("./list");
101
+ exports.ListWrapper = list_1.default;
100
102
  const live_region_1 = require("./live-region");
101
103
  exports.LiveRegionWrapper = live_region_1.default;
102
104
  const mixed_line_bar_chart_1 = require("./mixed-line-bar-chart");
@@ -572,6 +574,15 @@ dom_1.ElementWrapper.prototype.findLink = function (selector) {
572
574
  dom_1.ElementWrapper.prototype.findAllLinks = function (selector) {
573
575
  return this.findAllComponents(link_1.default, selector);
574
576
  };
577
+ dom_1.ElementWrapper.prototype.findList = function (selector) {
578
+ const rootSelector = `.${list_1.default.rootSelector}`;
579
+ // casting to 'any' is needed to avoid this issue with generics
580
+ // https://github.com/microsoft/TypeScript/issues/29132
581
+ return this.findComponent(selector ? (0, utils_1.appendSelector)(selector, rootSelector) : rootSelector, list_1.default);
582
+ };
583
+ dom_1.ElementWrapper.prototype.findAllLists = function (selector) {
584
+ return this.findAllComponents(list_1.default, selector);
585
+ };
575
586
  dom_1.ElementWrapper.prototype.findLiveRegion = function (selector) {
576
587
  const rootSelector = `.${live_region_1.default.rootSelector}`;
577
588
  // casting to 'any' is needed to avoid this issue with generics