@cloudscape-design/components-themeable 3.0.881 → 3.0.883

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 (164) hide show
  1. package/lib/internal/manifest.json +1 -1
  2. package/lib/internal/scss/date-range-picker/styles.scss +0 -2
  3. package/lib/internal/scss/internal/components/drag-handle/styles.scss +9 -1
  4. package/lib/internal/scss/internal/components/dropdown/styles.scss +0 -1
  5. package/lib/internal/scss/internal/components/options-list/styles.scss +1 -0
  6. package/lib/internal/scss/internal/components/panel-resize-handle/styles.scss +42 -3
  7. package/lib/internal/template/app-layout/drawer/resizable-drawer.d.ts.map +1 -1
  8. package/lib/internal/template/app-layout/drawer/resizable-drawer.js +2 -3
  9. package/lib/internal/template/app-layout/drawer/resizable-drawer.js.map +1 -1
  10. package/lib/internal/template/app-layout/utils/use-focus-control.d.ts +1 -2
  11. package/lib/internal/template/app-layout/utils/use-focus-control.d.ts.map +1 -1
  12. package/lib/internal/template/app-layout/utils/use-focus-control.js +0 -2
  13. package/lib/internal/template/app-layout/utils/use-focus-control.js.map +1 -1
  14. package/lib/internal/template/app-layout/utils/use-resize.d.ts.map +1 -1
  15. package/lib/internal/template/app-layout/utils/use-resize.js +2 -3
  16. package/lib/internal/template/app-layout/utils/use-resize.js.map +1 -1
  17. package/lib/internal/template/app-layout/utils/use-split-panel-focus-control.d.ts +1 -2
  18. package/lib/internal/template/app-layout/utils/use-split-panel-focus-control.d.ts.map +1 -1
  19. package/lib/internal/template/app-layout/utils/use-split-panel-focus-control.js +0 -1
  20. package/lib/internal/template/app-layout/utils/use-split-panel-focus-control.js.map +1 -1
  21. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-drawer.d.ts.map +1 -1
  22. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-drawer.js +2 -3
  23. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-drawer.js.map +1 -1
  24. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/local-drawer.d.ts.map +1 -1
  25. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/local-drawer.js +2 -3
  26. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/local-drawer.js.map +1 -1
  27. package/lib/internal/template/button-group/index.d.ts.map +1 -1
  28. package/lib/internal/template/button-group/index.js +22 -1
  29. package/lib/internal/template/button-group/index.js.map +1 -1
  30. package/lib/internal/template/button-group/interfaces.d.ts +2 -1
  31. package/lib/internal/template/button-group/interfaces.d.ts.map +1 -1
  32. package/lib/internal/template/button-group/interfaces.js.map +1 -1
  33. package/lib/internal/template/collection-preferences/content-display/index.d.ts.map +1 -1
  34. package/lib/internal/template/collection-preferences/content-display/index.js +8 -5
  35. package/lib/internal/template/collection-preferences/content-display/index.js.map +1 -1
  36. package/lib/internal/template/date-picker/index.d.ts.map +1 -1
  37. package/lib/internal/template/date-picker/index.js +1 -5
  38. package/lib/internal/template/date-picker/index.js.map +1 -1
  39. package/lib/internal/template/date-range-picker/styles.css.js +38 -38
  40. package/lib/internal/template/date-range-picker/styles.scoped.css +47 -51
  41. package/lib/internal/template/date-range-picker/styles.selectors.js +38 -38
  42. package/lib/internal/template/flashbar/internal/analytics.d.ts.map +1 -1
  43. package/lib/internal/template/flashbar/internal/analytics.js +1 -3
  44. package/lib/internal/template/flashbar/internal/analytics.js.map +1 -1
  45. package/lib/internal/template/internal/components/drag-handle/index.d.ts +2 -2
  46. package/lib/internal/template/internal/components/drag-handle/index.d.ts.map +1 -1
  47. package/lib/internal/template/internal/components/drag-handle/index.js +7 -3
  48. package/lib/internal/template/internal/components/drag-handle/index.js.map +1 -1
  49. package/lib/internal/template/internal/components/drag-handle/interfaces.d.ts +1 -1
  50. package/lib/internal/template/internal/components/drag-handle/interfaces.d.ts.map +1 -1
  51. package/lib/internal/template/internal/components/drag-handle/interfaces.js.map +1 -1
  52. package/lib/internal/template/internal/components/dropdown/styles.css.js +20 -20
  53. package/lib/internal/template/internal/components/dropdown/styles.scoped.css +37 -39
  54. package/lib/internal/template/internal/components/dropdown/styles.selectors.js +20 -20
  55. package/lib/internal/template/internal/components/options-list/styles.css.js +3 -3
  56. package/lib/internal/template/internal/components/options-list/styles.scoped.css +5 -3
  57. package/lib/internal/template/internal/components/options-list/styles.selectors.js +3 -3
  58. package/lib/internal/template/internal/components/panel-resize-handle/icon.d.ts +5 -0
  59. package/lib/internal/template/internal/components/panel-resize-handle/icon.d.ts.map +1 -0
  60. package/lib/internal/template/internal/components/panel-resize-handle/icon.js +9 -0
  61. package/lib/internal/template/internal/components/panel-resize-handle/icon.js.map +1 -0
  62. package/lib/internal/template/internal/components/panel-resize-handle/index.d.ts +2 -4
  63. package/lib/internal/template/internal/components/panel-resize-handle/index.d.ts.map +1 -1
  64. package/lib/internal/template/internal/components/panel-resize-handle/index.js +5 -8
  65. package/lib/internal/template/internal/components/panel-resize-handle/index.js.map +1 -1
  66. package/lib/internal/template/internal/components/panel-resize-handle/styles.css.js +5 -2
  67. package/lib/internal/template/internal/components/panel-resize-handle/styles.scoped.css +191 -3
  68. package/lib/internal/template/internal/components/panel-resize-handle/styles.selectors.js +5 -2
  69. package/lib/internal/template/internal/components/sortable-area/index.d.ts +6 -0
  70. package/lib/internal/template/internal/components/sortable-area/index.d.ts.map +1 -0
  71. package/lib/internal/template/internal/components/{dnd-area → sortable-area}/index.js +34 -25
  72. package/lib/internal/template/internal/components/sortable-area/index.js.map +1 -0
  73. package/lib/internal/template/internal/components/sortable-area/interfaces.d.ts +42 -0
  74. package/lib/internal/template/internal/components/sortable-area/interfaces.d.ts.map +1 -0
  75. package/lib/internal/template/internal/components/sortable-area/interfaces.js.map +1 -0
  76. package/lib/internal/template/internal/components/sortable-area/keyboard-sensor/defaults.d.ts.map +1 -0
  77. package/lib/internal/template/internal/components/sortable-area/keyboard-sensor/defaults.js.map +1 -0
  78. package/lib/internal/template/internal/components/sortable-area/keyboard-sensor/index.d.ts.map +1 -0
  79. package/lib/internal/template/internal/components/sortable-area/keyboard-sensor/index.js.map +1 -0
  80. package/lib/internal/template/internal/components/sortable-area/keyboard-sensor/utilities/events.d.ts.map +1 -0
  81. package/lib/internal/template/internal/components/sortable-area/keyboard-sensor/utilities/events.js.map +1 -0
  82. package/lib/internal/template/internal/components/sortable-area/keyboard-sensor/utilities/listeners.d.ts.map +1 -0
  83. package/lib/internal/template/internal/components/sortable-area/keyboard-sensor/utilities/listeners.js.map +1 -0
  84. package/lib/internal/template/internal/components/sortable-area/keyboard-sensor/utilities/scroll.d.ts.map +1 -0
  85. package/lib/internal/template/internal/components/sortable-area/keyboard-sensor/utilities/scroll.js.map +1 -0
  86. package/lib/internal/template/internal/components/sortable-area/styles.css.js +13 -0
  87. package/lib/internal/template/internal/components/{dnd-area → sortable-area}/styles.scoped.css +17 -17
  88. package/lib/internal/template/internal/components/sortable-area/styles.selectors.js +14 -0
  89. package/lib/internal/template/internal/components/{dnd-area → sortable-area}/use-drag-and-drop-reorder.d.ts +4 -3
  90. package/lib/internal/template/internal/components/sortable-area/use-drag-and-drop-reorder.d.ts.map +1 -0
  91. package/lib/internal/template/internal/components/{dnd-area → sortable-area}/use-drag-and-drop-reorder.js +4 -4
  92. package/lib/internal/template/internal/components/sortable-area/use-drag-and-drop-reorder.js.map +1 -0
  93. package/lib/internal/template/internal/components/sortable-area/use-live-announcements.d.ts +13 -0
  94. package/lib/internal/template/internal/components/sortable-area/use-live-announcements.d.ts.map +1 -0
  95. package/lib/internal/template/internal/components/{dnd-area → sortable-area}/use-live-announcements.js +6 -6
  96. package/lib/internal/template/internal/components/sortable-area/use-live-announcements.js.map +1 -0
  97. package/lib/internal/template/internal/environment.js +1 -1
  98. package/lib/internal/template/internal/environment.json +1 -1
  99. package/lib/internal/template/internal/metrics.d.ts +3 -0
  100. package/lib/internal/template/internal/metrics.d.ts.map +1 -0
  101. package/lib/internal/template/internal/metrics.js +6 -0
  102. package/lib/internal/template/internal/metrics.js.map +1 -0
  103. package/lib/internal/template/internal/plugins/api.d.ts.map +1 -1
  104. package/lib/internal/template/internal/plugins/api.js +4 -0
  105. package/lib/internal/template/internal/plugins/api.js.map +1 -1
  106. package/lib/internal/template/internal/plugins/controllers/alert-flash-content.d.ts.map +1 -1
  107. package/lib/internal/template/internal/plugins/controllers/alert-flash-content.js +2 -1
  108. package/lib/internal/template/internal/plugins/controllers/alert-flash-content.js.map +1 -1
  109. package/lib/internal/template/internal/plugins/controllers/drawers.d.ts.map +1 -1
  110. package/lib/internal/template/internal/plugins/controllers/drawers.js +7 -3
  111. package/lib/internal/template/internal/plugins/controllers/drawers.js.map +1 -1
  112. package/lib/internal/template/internal/plugins/helpers/metrics.d.ts +3 -0
  113. package/lib/internal/template/internal/plugins/helpers/metrics.d.ts.map +1 -0
  114. package/lib/internal/template/internal/plugins/helpers/metrics.js +15 -0
  115. package/lib/internal/template/internal/plugins/helpers/metrics.js.map +1 -0
  116. package/lib/internal/template/internal/plugins/helpers/use-discovered-content.d.ts.map +1 -1
  117. package/lib/internal/template/internal/plugins/helpers/use-discovered-content.js +2 -1
  118. package/lib/internal/template/internal/plugins/helpers/use-discovered-content.js.map +1 -1
  119. package/lib/internal/template/split-panel/implementation.d.ts.map +1 -1
  120. package/lib/internal/template/split-panel/implementation.js +6 -7
  121. package/lib/internal/template/split-panel/implementation.js.map +1 -1
  122. package/lib/internal/template/table/table-role/utils.d.ts.map +1 -1
  123. package/lib/internal/template/table/table-role/utils.js +4 -5
  124. package/lib/internal/template/table/table-role/utils.js.map +1 -1
  125. package/package.json +1 -1
  126. package/lib/internal/template/app-layout/visual-refresh-toolbar/exports.d.ts +0 -6
  127. package/lib/internal/template/app-layout/visual-refresh-toolbar/exports.d.ts.map +0 -1
  128. package/lib/internal/template/app-layout/visual-refresh-toolbar/exports.js +0 -8
  129. package/lib/internal/template/app-layout/visual-refresh-toolbar/exports.js.map +0 -1
  130. package/lib/internal/template/internal/components/dnd-area/index.d.ts +0 -4
  131. package/lib/internal/template/internal/components/dnd-area/index.d.ts.map +0 -1
  132. package/lib/internal/template/internal/components/dnd-area/index.js.map +0 -1
  133. package/lib/internal/template/internal/components/dnd-area/interfaces.d.ts +0 -39
  134. package/lib/internal/template/internal/components/dnd-area/interfaces.d.ts.map +0 -1
  135. package/lib/internal/template/internal/components/dnd-area/interfaces.js.map +0 -1
  136. package/lib/internal/template/internal/components/dnd-area/keyboard-sensor/defaults.d.ts.map +0 -1
  137. package/lib/internal/template/internal/components/dnd-area/keyboard-sensor/defaults.js.map +0 -1
  138. package/lib/internal/template/internal/components/dnd-area/keyboard-sensor/index.d.ts.map +0 -1
  139. package/lib/internal/template/internal/components/dnd-area/keyboard-sensor/index.js.map +0 -1
  140. package/lib/internal/template/internal/components/dnd-area/keyboard-sensor/utilities/events.d.ts.map +0 -1
  141. package/lib/internal/template/internal/components/dnd-area/keyboard-sensor/utilities/events.js.map +0 -1
  142. package/lib/internal/template/internal/components/dnd-area/keyboard-sensor/utilities/listeners.d.ts.map +0 -1
  143. package/lib/internal/template/internal/components/dnd-area/keyboard-sensor/utilities/listeners.js.map +0 -1
  144. package/lib/internal/template/internal/components/dnd-area/keyboard-sensor/utilities/scroll.d.ts.map +0 -1
  145. package/lib/internal/template/internal/components/dnd-area/keyboard-sensor/utilities/scroll.js.map +0 -1
  146. package/lib/internal/template/internal/components/dnd-area/styles.css.js +0 -13
  147. package/lib/internal/template/internal/components/dnd-area/styles.selectors.js +0 -14
  148. package/lib/internal/template/internal/components/dnd-area/use-drag-and-drop-reorder.d.ts.map +0 -1
  149. package/lib/internal/template/internal/components/dnd-area/use-drag-and-drop-reorder.js.map +0 -1
  150. package/lib/internal/template/internal/components/dnd-area/use-live-announcements.d.ts +0 -12
  151. package/lib/internal/template/internal/components/dnd-area/use-live-announcements.d.ts.map +0 -1
  152. package/lib/internal/template/internal/components/dnd-area/use-live-announcements.js.map +0 -1
  153. /package/lib/internal/scss/internal/components/{dnd-area → sortable-area}/styles.scss +0 -0
  154. /package/lib/internal/template/internal/components/{dnd-area → sortable-area}/interfaces.js +0 -0
  155. /package/lib/internal/template/internal/components/{dnd-area → sortable-area}/keyboard-sensor/defaults.d.ts +0 -0
  156. /package/lib/internal/template/internal/components/{dnd-area → sortable-area}/keyboard-sensor/defaults.js +0 -0
  157. /package/lib/internal/template/internal/components/{dnd-area → sortable-area}/keyboard-sensor/index.d.ts +0 -0
  158. /package/lib/internal/template/internal/components/{dnd-area → sortable-area}/keyboard-sensor/index.js +0 -0
  159. /package/lib/internal/template/internal/components/{dnd-area → sortable-area}/keyboard-sensor/utilities/events.d.ts +0 -0
  160. /package/lib/internal/template/internal/components/{dnd-area → sortable-area}/keyboard-sensor/utilities/events.js +0 -0
  161. /package/lib/internal/template/internal/components/{dnd-area → sortable-area}/keyboard-sensor/utilities/listeners.d.ts +0 -0
  162. /package/lib/internal/template/internal/components/{dnd-area → sortable-area}/keyboard-sensor/utilities/listeners.js +0 -0
  163. /package/lib/internal/template/internal/components/{dnd-area → sortable-area}/keyboard-sensor/utilities/scroll.d.ts +0 -0
  164. /package/lib/internal/template/internal/components/{dnd-area → sortable-area}/keyboard-sensor/utilities/scroll.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/button-group/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEpE,OAAO,mBAAmB,MAAM,YAAY,CAAC;AAI7C,MAAM,WAAW,GAAG,KAAK,CAAC,UAAU,CAClC,CAAC,EAAgE,EAAE,GAAoC,EAAE,EAAE;QAA1G,EAAE,OAAO,EAAE,wBAAwB,OAA6B,EAAxB,IAAI,cAA5C,uCAA8C,CAAF;IAC3C,MAAM,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IACrC,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,aAAa,EAAE;QACzD,KAAK,EAAE;YACL,OAAO;YACP,wBAAwB;SACzB;KACF,CAAC,CAAC;IAEH,MAAM,aAAa,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAC7C,OAAO,CACL,oBAAC,mBAAmB,oBACd,SAAS,EACT,kBAAkB,EAClB,aAAa,IACjB,GAAG,EAAE,GAAG,EACR,OAAO,EAAE,OAAO,EAChB,wBAAwB,EAAE,wBAAwB,IAClD,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAgB,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;AAC7C,eAAe,WAAW,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { getBaseProps } from '../internal/base-component';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { getExternalProps } from '../internal/utils/external-props';\nimport { ButtonGroupProps } from './interfaces';\nimport InternalButtonGroup from './internal';\n\nexport { ButtonGroupProps };\n\nconst ButtonGroup = React.forwardRef(\n ({ variant, dropdownExpandToViewport, ...rest }: ButtonGroupProps, ref: React.Ref<ButtonGroupProps.Ref>) => {\n const baseProps = getBaseProps(rest);\n const baseComponentProps = useBaseComponent('ButtonGroup', {\n props: {\n variant,\n dropdownExpandToViewport,\n },\n });\n\n const externalProps = getExternalProps(rest);\n return (\n <InternalButtonGroup\n {...baseProps}\n {...baseComponentProps}\n {...externalProps}\n ref={ref}\n variant={variant}\n dropdownExpandToViewport={dropdownExpandToViewport}\n />\n );\n }\n);\n\napplyDisplayName(ButtonGroup, 'ButtonGroup');\nexport default ButtonGroup;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/button-group/index.tsx"],"names":[],"mappings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,WAAoD,EAAE;IAC3E,MAAM,QAAQ,GAAG,EAAE,aAAa,EAAE,CAAC,EAAE,oBAAoB,EAAE,CAAC,EAAE,iBAAiB,EAAE,CAAC,EAAE,eAAe,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;IAEnH,SAAS,KAAK,CAAC,KAA8C;QAC3D,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;YACxB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAEzB,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,EAAE;gBACzB,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;aACnB;SACF;IACH,CAAC;IACD,KAAK,CAAC,QAAQ,CAAC,CAAC;IAEhB,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,gBAAgB,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;AAC7C,eAAe,WAAW,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { getBaseProps } from '../internal/base-component';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { getExternalProps } from '../internal/utils/external-props';\nimport { ButtonGroupProps } from './interfaces';\nimport InternalButtonGroup from './internal';\n\nexport { ButtonGroupProps };\n\nconst ButtonGroup = React.forwardRef(\n ({ variant, dropdownExpandToViewport = false, ...rest }: ButtonGroupProps, ref: React.Ref<ButtonGroupProps.Ref>) => {\n const baseProps = getBaseProps(rest);\n const itemCounts = getItemCounts(rest.items);\n const baseComponentProps = useBaseComponent('ButtonGroup', {\n props: {\n variant,\n dropdownExpandToViewport,\n },\n metadata: {\n iconButtonsCount: itemCounts['icon-button'],\n iconToggleButtonsCount: itemCounts['icon-toggle-button'],\n iconFileInputsCount: itemCounts['icon-file-input'],\n menuDropdownsCount: itemCounts['menu-dropdown'],\n groupsCount: itemCounts.group,\n },\n });\n\n const externalProps = getExternalProps(rest);\n return (\n <InternalButtonGroup\n {...baseProps}\n {...baseComponentProps}\n {...externalProps}\n ref={ref}\n variant={variant}\n dropdownExpandToViewport={dropdownExpandToViewport}\n />\n );\n }\n);\n\nfunction getItemCounts(allItems: readonly ButtonGroupProps.ItemOrGroup[] = []) {\n const counters = { 'icon-button': 0, 'icon-toggle-button': 0, 'icon-file-input': 0, 'menu-dropdown': 0, group: 0 };\n\n function count(items: readonly ButtonGroupProps.ItemOrGroup[]) {\n for (const item of items) {\n counters[item.type] += 1;\n\n if (item.type === 'group') {\n count(item.items);\n }\n }\n }\n count(allItems);\n\n return counters;\n}\n\napplyDisplayName(ButtonGroup, 'ButtonGroup');\nexport default ButtonGroup;\n"]}
@@ -4,6 +4,7 @@ import { IconProps } from '../icon/interfaces';
4
4
  import { BaseComponentProps } from '../internal/base-component';
5
5
  import { NonCancelableEventHandler } from '../internal/events';
6
6
  import { InternalBaseComponentProps } from '../internal/hooks/use-base-component';
7
+ import { SomeRequired } from '../internal/types';
7
8
  export interface ButtonGroupProps extends BaseComponentProps {
8
9
  /**
9
10
  * Adds `aria-label` to the button group toolbar element.
@@ -93,7 +94,7 @@ export interface ButtonGroupProps extends BaseComponentProps {
93
94
  */
94
95
  onFilesChange?: NonCancelableEventHandler<ButtonGroupProps.FilesChangeDetails>;
95
96
  }
96
- export interface InternalButtonGroupProps extends ButtonGroupProps, InternalBaseComponentProps {
97
+ export interface InternalButtonGroupProps extends SomeRequired<ButtonGroupProps, 'dropdownExpandToViewport'>, InternalBaseComponentProps {
97
98
  }
98
99
  export declare namespace ButtonGroupProps {
99
100
  type Variant = 'icon';
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/button-group/interfaces.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;A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
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/button-group/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 { ButtonDropdownProps } from '../button-dropdown/interfaces';\nimport { IconProps } from '../icon/interfaces';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\n\nexport interface ButtonGroupProps extends BaseComponentProps {\n /**\n * Adds `aria-label` to the button group toolbar element.\n * Use this to provide a unique accessible name for each button group on the page.\n */\n ariaLabel?: string;\n /**\n * Determines the general styling of the button dropdown.\n * * `icon` for icon buttons.\n */\n variant: ButtonGroupProps.Variant;\n /**\n * Use this property to determine dropdown placement strategy for all menu dropdown items.\n *\n * By default, the dropdown height is constrained to fit inside the height of its next scrollable container element.\n * Enabling this property will allow the dropdown to extend beyond that container by using fixed positioning and\n * [React Portals](https://reactjs.org/docs/portals.html).\n *\n * Set this property if the dropdown would otherwise be constrained by a scrollable container,\n * for example inside table and split view layouts.\n *\n * We recommend you use discretion, and don't enable this property unless necessary\n * because fixed positioning results in a slight, visible lag when scrolling complex pages.\n */\n dropdownExpandToViewport?: boolean;\n /**\n * Array of objects with a number of supported types.\n *\n * ### icon-button\n *\n * * `id` (string) - The unique identifier of the button, used as detail in `onItemClick` handler and to focus the button using `ref.focus(id)`.\n * * `text` (string) - The name shown as a tooltip for this button.\n * * `disabled` (optional, boolean) - The disabled state indication for this button.\n * * `loading` (optional, boolean) - The loading state indication for this button.\n * * `loadingText` (optional, string) - The loading text announced to screen readers.\n * * `iconName` (optional, string) - Specifies the name of the icon, used with the [icon component](/components/icon/).\n * * `iconAlt` (optional, string) - Specifies alternate text for the icon when using `iconUrl`.\n * * `iconUrl` (optional, string) - Specifies the URL of a custom icon.\n * * `iconSvg` (optional, ReactNode) - Custom SVG icon. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n * * `popoverFeedback` (optional, ReactNode) - Text that appears when the user clicks the button. Use to provide feedback to the user.\n *\n * ### icon-toggle-button\n *\n * * `id` (string) - The unique identifier of the button, used as detail in `onItemClick` handler and to focus the button using `ref.focus(id)`.\n * * `pressed` (boolean) - The toggle button pressed state.\n * * `text` (string) - The name shown as a tooltip for this button.\n * * `disabled` (optional, boolean) - The disabled state indication for this button.\n * * `loading` (optional, boolean) - The loading state indication for this button.\n * * `loadingText` (optional, string) - The loading text announced to screen readers.\n * * `iconName` (optional, string) - Specifies the name of the icon, used with the [icon component](/components/icon/).\n * * `iconUrl` (optional, string) - Specifies the URL of a custom icon.\n * * `iconSvg` (optional, ReactNode) - Custom SVG icon. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n * * `pressedIconName` (optional, string) - Specifies the name of the icon in pressed state, used with the [icon component](/components/icon/).\n * * `pressedIconUrl` (optional, string) - Specifies the URL of a custom icon in pressed state.\n * * `pressedIconSvg` (optional, ReactNode) - Custom SVG icon in pressed state. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n * * `popoverFeedback` (optional, ReactNode) - Text that appears when the user clicks the button. Use to provide feedback to the user.\n * * `pressedPopoverFeedback` (optional, ReactNode) - Text that appears when the user clicks the button in pressed state. Defaults to `popoverFeedback`.\n *\n * * ### file-input\n *\n * * `id` (string) - The unique identifier of the button, used as detail in `onFilesChange`.\n * * `text` (string) - The name of the menu button shown as a tooltip.\n * * `accept` (optional, string) - Specifies the native file input `accept` attribute to describe the allow-list of file types.\n * * `multiple` (optional, string) - Specifies the native file input `multiple` attribute to allow users entering more than one file.\n *\n * ### menu-dropdown\n *\n * * `id` (string) - The unique identifier of the button, used as detail in `onItemClick`.\n * * `text` (string) - The name of the menu button shown as a tooltip.\n * * `disabled` (optional, boolean) - The disabled state indication for the menu button.\n * * `loading` (optional, boolean) - The loading state indication for the menu button.\n * * `loadingText` (optional, string) - The loading text announced to screen readers.\n * * `items` (ButtonDropdownProps.ItemOrGroup[]) - The array of dropdown items that belong to this menu.\n *\n * ### group\n *\n * * `text` (string) - The name of the group rendered as ARIA label for this group.\n * * `items` ((ButtonGroupProps.IconButton | ButtonGroupProps.MenuDropdown)[]) - The array of items that belong to this group.\n */\n items: ReadonlyArray<ButtonGroupProps.ItemOrGroup>;\n /**\n * Called when the user clicks on an item, and the item is not disabled. The event detail object contains the id of the clicked item.\n */\n onItemClick?: NonCancelableEventHandler<ButtonGroupProps.ItemClickDetails>;\n /**\n * Called when the user uploads files. The event detail object contains the id and files from the file input item.\n */\n onFilesChange?: NonCancelableEventHandler<ButtonGroupProps.FilesChangeDetails>;\n}\n\nexport interface InternalButtonGroupProps extends ButtonGroupProps, InternalBaseComponentProps {}\n\nexport namespace ButtonGroupProps {\n export type Variant = 'icon';\n\n export type ItemOrGroup = Item | Group;\n export type Item = IconButton | IconToggleButton | IconFileInput | MenuDropdown;\n\n export interface IconButton {\n type: 'icon-button';\n id: string;\n text: string;\n disabled?: boolean;\n loading?: boolean;\n loadingText?: string;\n iconName?: IconProps.Name;\n iconAlt?: string;\n iconUrl?: string;\n iconSvg?: React.ReactNode;\n popoverFeedback?: React.ReactNode;\n }\n\n export interface IconToggleButton {\n type: 'icon-toggle-button';\n id: string;\n text: string;\n pressed: boolean;\n disabled?: boolean;\n loading?: boolean;\n loadingText?: string;\n iconName?: IconProps.Name;\n iconUrl?: string;\n iconSvg?: React.ReactNode;\n pressedIconName?: IconProps.Name;\n pressedIconUrl?: string;\n pressedIconSvg?: React.ReactNode;\n popoverFeedback?: React.ReactNode;\n pressedPopoverFeedback?: React.ReactNode;\n }\n\n export interface IconFileInput {\n type: 'icon-file-input';\n id: string;\n text: string;\n accept?: string;\n multiple?: boolean;\n }\n\n export interface MenuDropdown {\n type: 'menu-dropdown';\n id: string;\n text: string;\n disabled?: boolean;\n loading?: boolean;\n loadingText?: string;\n items: ReadonlyArray<ButtonDropdownProps.ItemOrGroup>;\n }\n\n export interface Group {\n type: 'group';\n text: string;\n items: ReadonlyArray<ButtonGroupProps.Item>;\n }\n\n export interface ItemClickDetails {\n id: string;\n pressed?: boolean;\n checked?: boolean;\n }\n\n export interface FilesChangeDetails {\n id: string;\n files: File[];\n }\n\n export interface Ref {\n /**\n * Focuses button group item by id.\n */\n focus(itemId: string): void;\n }\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/button-group/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 { ButtonDropdownProps } from '../button-dropdown/interfaces';\nimport { IconProps } from '../icon/interfaces';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { SomeRequired } from '../internal/types';\n\nexport interface ButtonGroupProps extends BaseComponentProps {\n /**\n * Adds `aria-label` to the button group toolbar element.\n * Use this to provide a unique accessible name for each button group on the page.\n */\n ariaLabel?: string;\n /**\n * Determines the general styling of the button dropdown.\n * * `icon` for icon buttons.\n */\n variant: ButtonGroupProps.Variant;\n /**\n * Use this property to determine dropdown placement strategy for all menu dropdown items.\n *\n * By default, the dropdown height is constrained to fit inside the height of its next scrollable container element.\n * Enabling this property will allow the dropdown to extend beyond that container by using fixed positioning and\n * [React Portals](https://reactjs.org/docs/portals.html).\n *\n * Set this property if the dropdown would otherwise be constrained by a scrollable container,\n * for example inside table and split view layouts.\n *\n * We recommend you use discretion, and don't enable this property unless necessary\n * because fixed positioning results in a slight, visible lag when scrolling complex pages.\n */\n dropdownExpandToViewport?: boolean;\n /**\n * Array of objects with a number of supported types.\n *\n * ### icon-button\n *\n * * `id` (string) - The unique identifier of the button, used as detail in `onItemClick` handler and to focus the button using `ref.focus(id)`.\n * * `text` (string) - The name shown as a tooltip for this button.\n * * `disabled` (optional, boolean) - The disabled state indication for this button.\n * * `loading` (optional, boolean) - The loading state indication for this button.\n * * `loadingText` (optional, string) - The loading text announced to screen readers.\n * * `iconName` (optional, string) - Specifies the name of the icon, used with the [icon component](/components/icon/).\n * * `iconAlt` (optional, string) - Specifies alternate text for the icon when using `iconUrl`.\n * * `iconUrl` (optional, string) - Specifies the URL of a custom icon.\n * * `iconSvg` (optional, ReactNode) - Custom SVG icon. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n * * `popoverFeedback` (optional, ReactNode) - Text that appears when the user clicks the button. Use to provide feedback to the user.\n *\n * ### icon-toggle-button\n *\n * * `id` (string) - The unique identifier of the button, used as detail in `onItemClick` handler and to focus the button using `ref.focus(id)`.\n * * `pressed` (boolean) - The toggle button pressed state.\n * * `text` (string) - The name shown as a tooltip for this button.\n * * `disabled` (optional, boolean) - The disabled state indication for this button.\n * * `loading` (optional, boolean) - The loading state indication for this button.\n * * `loadingText` (optional, string) - The loading text announced to screen readers.\n * * `iconName` (optional, string) - Specifies the name of the icon, used with the [icon component](/components/icon/).\n * * `iconUrl` (optional, string) - Specifies the URL of a custom icon.\n * * `iconSvg` (optional, ReactNode) - Custom SVG icon. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n * * `pressedIconName` (optional, string) - Specifies the name of the icon in pressed state, used with the [icon component](/components/icon/).\n * * `pressedIconUrl` (optional, string) - Specifies the URL of a custom icon in pressed state.\n * * `pressedIconSvg` (optional, ReactNode) - Custom SVG icon in pressed state. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n * * `popoverFeedback` (optional, ReactNode) - Text that appears when the user clicks the button. Use to provide feedback to the user.\n * * `pressedPopoverFeedback` (optional, ReactNode) - Text that appears when the user clicks the button in pressed state. Defaults to `popoverFeedback`.\n *\n * * ### file-input\n *\n * * `id` (string) - The unique identifier of the button, used as detail in `onFilesChange`.\n * * `text` (string) - The name of the menu button shown as a tooltip.\n * * `accept` (optional, string) - Specifies the native file input `accept` attribute to describe the allow-list of file types.\n * * `multiple` (optional, string) - Specifies the native file input `multiple` attribute to allow users entering more than one file.\n *\n * ### menu-dropdown\n *\n * * `id` (string) - The unique identifier of the button, used as detail in `onItemClick`.\n * * `text` (string) - The name of the menu button shown as a tooltip.\n * * `disabled` (optional, boolean) - The disabled state indication for the menu button.\n * * `loading` (optional, boolean) - The loading state indication for the menu button.\n * * `loadingText` (optional, string) - The loading text announced to screen readers.\n * * `items` (ButtonDropdownProps.ItemOrGroup[]) - The array of dropdown items that belong to this menu.\n *\n * ### group\n *\n * * `text` (string) - The name of the group rendered as ARIA label for this group.\n * * `items` ((ButtonGroupProps.IconButton | ButtonGroupProps.MenuDropdown)[]) - The array of items that belong to this group.\n */\n items: ReadonlyArray<ButtonGroupProps.ItemOrGroup>;\n /**\n * Called when the user clicks on an item, and the item is not disabled. The event detail object contains the id of the clicked item.\n */\n onItemClick?: NonCancelableEventHandler<ButtonGroupProps.ItemClickDetails>;\n /**\n * Called when the user uploads files. The event detail object contains the id and files from the file input item.\n */\n onFilesChange?: NonCancelableEventHandler<ButtonGroupProps.FilesChangeDetails>;\n}\n\nexport interface InternalButtonGroupProps\n extends SomeRequired<ButtonGroupProps, 'dropdownExpandToViewport'>,\n InternalBaseComponentProps {}\n\nexport namespace ButtonGroupProps {\n export type Variant = 'icon';\n\n export type ItemOrGroup = Item | Group;\n export type Item = IconButton | IconToggleButton | IconFileInput | MenuDropdown;\n\n export interface IconButton {\n type: 'icon-button';\n id: string;\n text: string;\n disabled?: boolean;\n loading?: boolean;\n loadingText?: string;\n iconName?: IconProps.Name;\n iconAlt?: string;\n iconUrl?: string;\n iconSvg?: React.ReactNode;\n popoverFeedback?: React.ReactNode;\n }\n\n export interface IconToggleButton {\n type: 'icon-toggle-button';\n id: string;\n text: string;\n pressed: boolean;\n disabled?: boolean;\n loading?: boolean;\n loadingText?: string;\n iconName?: IconProps.Name;\n iconUrl?: string;\n iconSvg?: React.ReactNode;\n pressedIconName?: IconProps.Name;\n pressedIconUrl?: string;\n pressedIconSvg?: React.ReactNode;\n popoverFeedback?: React.ReactNode;\n pressedPopoverFeedback?: React.ReactNode;\n }\n\n export interface IconFileInput {\n type: 'icon-file-input';\n id: string;\n text: string;\n accept?: string;\n multiple?: boolean;\n }\n\n export interface MenuDropdown {\n type: 'menu-dropdown';\n id: string;\n text: string;\n disabled?: boolean;\n loading?: boolean;\n loadingText?: string;\n items: ReadonlyArray<ButtonDropdownProps.ItemOrGroup>;\n }\n\n export interface Group {\n type: 'group';\n text: string;\n items: ReadonlyArray<ButtonGroupProps.Item>;\n }\n\n export interface ItemClickDetails {\n id: string;\n pressed?: boolean;\n checked?: boolean;\n }\n\n export interface FilesChangeDetails {\n id: string;\n files: File[];\n }\n\n export interface Ref {\n /**\n * Focuses button group item by id.\n */\n focus(itemId: string): void;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/collection-preferences/content-display/index.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAU3D,UAAU,6BAA8B,SAAQ,0BAA0B,CAAC,wBAAwB;IACjG,QAAQ,EAAE,CAAC,KAAK,EAAE,aAAa,CAAC,0BAA0B,CAAC,kBAAkB,CAAC,KAAK,IAAI,CAAC;IACxF,KAAK,CAAC,EAAE,aAAa,CAAC,0BAA0B,CAAC,kBAAkB,CAAC,CAAC;CACtE;AAED,MAAM,CAAC,OAAO,UAAU,wBAAwB,CAAC,EAC/C,KAAK,EACL,WAAW,EACX,OAAO,EACP,KAGG,EACH,QAAQ,EACR,0BAA0B,EAC1B,gCAAgC,EAChC,gCAAgC,EAChC,4BAA4B,EAC5B,yBAAyB,EACzB,mBAAmB,EACnB,qBAA6B,EAC7B,WAAW,GACZ,EAAE,6BAA6B,eAiJ/B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/collection-preferences/content-display/index.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAU3D,UAAU,6BAA8B,SAAQ,0BAA0B,CAAC,wBAAwB;IACjG,QAAQ,EAAE,CAAC,KAAK,EAAE,aAAa,CAAC,0BAA0B,CAAC,kBAAkB,CAAC,KAAK,IAAI,CAAC;IACxF,KAAK,CAAC,EAAE,aAAa,CAAC,0BAA0B,CAAC,kBAAkB,CAAC,CAAC;CACtE;AAED,MAAM,CAAC,OAAO,UAAU,wBAAwB,CAAC,EAC/C,KAAK,EACL,WAAW,EACX,OAAO,EACP,KAGG,EACH,QAAQ,EACR,0BAA0B,EAC1B,gCAAgC,EAChC,gCAAgC,EAChC,4BAA4B,EAC5B,yBAAyB,EACzB,mBAAmB,EACnB,qBAA6B,EAC7B,WAAW,GACZ,EAAE,6BAA6B,eA8I/B"}
@@ -5,7 +5,7 @@ import clsx from 'clsx';
5
5
  import InternalBox from '../../box/internal';
6
6
  import InternalButton from '../../button/internal';
7
7
  import { useInternalI18n } from '../../i18n/context';
8
- import { DndArea } from '../../internal/components/dnd-area';
8
+ import SortableArea from '../../internal/components/sortable-area';
9
9
  import { useUniqueId } from '../../internal/hooks/use-unique-id';
10
10
  import InternalSpaceBetween from '../../space-between/internal';
11
11
  import InternalTextFilter from '../../text-filter/internal';
@@ -46,10 +46,13 @@ export default function ContentDisplayPreference({ title, description, options,
46
46
  React.createElement(InternalBox, { margin: { top: 'm' } }, i18n('contentDisplayPreference.i18nStrings.columnFilteringNoMatchText', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.columnFilteringNoMatchText)),
47
47
  React.createElement(InternalButton, { onClick: () => setColumnFilteringText('') }, i18n('contentDisplayPreference.i18nStrings.columnFilteringClearFilterText', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.columnFilteringClearFilterText))))),
48
48
  React.createElement("ul", { className: getClassName('option-list'), "aria-describedby": descriptionId, "aria-labelledby": titleId, role: "list" },
49
- React.createElement(DndArea, { items: sortedAndFilteredOptions.map(data => ({ id: data.id, label: data.label, data })), onItemsChange: items => onChange(items.map(({ id, data }) => ({ id, visible: data.visible }))), disableReorder: columnFilteringText.trim().length > 0, renderItem: ({ ref, item, isSorting, isActive, style, className, dragHandleProps }) => {
50
- className = clsx(className, getOptionClassName(), isSorting && styles.sorting);
51
- const content = (React.createElement(ContentDisplayOption, { ref: ref, option: item.data, onToggle: onToggle, dragHandleProps: dragHandleProps }));
52
- return isActive ? (content) : (React.createElement("li", { className: className, style: style }, content));
49
+ React.createElement(SortableArea, { items: sortedAndFilteredOptions, itemDefinition: { id: item => item.id, label: item => item.label }, onItemsChange: ({ detail }) => onChange(detail.items), disableReorder: columnFilteringText.trim().length > 0, renderItem: ({ ref, item, style, className, dragHandleProps, isDragGhost }) => {
50
+ className = clsx(className, getOptionClassName());
51
+ const content = (React.createElement(ContentDisplayOption, { ref: ref, option: item, onToggle: onToggle, dragHandleProps: dragHandleProps }));
52
+ if (isDragGhost) {
53
+ return content;
54
+ }
55
+ return (React.createElement("li", { className: className, style: style }, content));
53
56
  }, i18nStrings: {
54
57
  liveAnnouncementDndStarted: i18n('contentDisplayPreference.liveAnnouncementDndStarted', liveAnnouncementDndStarted, format => (position, total) => format({ position, total })),
55
58
  liveAnnouncementDndItemReordered: i18n('contentDisplayPreference.liveAnnouncementDndItemReordered', liveAnnouncementDndItemReordered, format => (initialPosition, currentPosition, total) => format({ currentPosition, total, isInitialPosition: `${initialPosition === currentPosition}` })),
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/collection-preferences/content-display/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,WAAW,MAAM,oBAAoB,CAAC;AAC7C,OAAO,cAAc,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAA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MAAM,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAC3D;oBACD,gCAAgC,EAAE,IAAI,CACpC,2DAA2D,EAC3D,gCAAgC,EAChC,MAAM,CAAC,EAAE,CAAC,CAAC,eAAe,EAAE,eAAe,EAAE,KAAK,EAAE,EAAE,CACpD,MAAM,CAAC,EAAE,eAAe,EAAE,KAAK,EAAE,iBAAiB,EAAE,GAAG,eAAe,KAAK,eAAe,EAAE,EAAE,CAAC,CAClG;oBACD,gCAAgC,EAAE,IAAI,CACpC,2DAA2D,EAC3D,gCAAgC,EAChC,MAAM,CAAC,EAAE,CAAC,CAAC,eAAe,EAAE,aAAa,EAAE,KAAK,EAAE,EAAE,CAClD,MAAM,CAAC;wBACL,eAAe;wBACf,aAAa;wBACb,KAAK;wBACL,iBAAiB,EAAE,GAAG,eAAe,KAAK,aAAa,EAAE;qBAC1D,CAAC,CACL;oBACD,4BAA4B,EAAE,IAAI,CAChC,uDAAuD,EACvD,4BAA4B,CAC7B;oBACD,mBAAmB,EAAE,IAAI,CAAC,8CAA8C,EAAE,mBAAmB,CAAC;oBAC9F,yBAAyB,EAAE,IAAI,CAC7B,oDAAoD,EACpD,yBAAyB,CAC1B;iBACF,GACD,CACC,CACD,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useMemo, useState } from 'react';\nimport clsx from 'clsx';\n\nimport InternalBox from '../../box/internal';\nimport InternalButton from '../../button/internal';\nimport { useInternalI18n } from '../../i18n/context';\nimport { DndArea } from '../../internal/components/dnd-area';\nimport { useUniqueId } from '../../internal/hooks/use-unique-id';\nimport InternalSpaceBetween from '../../space-between/internal';\nimport InternalTextFilter from '../../text-filter/internal';\nimport { getAnalyticsInnerContextAttribute } from '../analytics-metadata/utils';\nimport { CollectionPreferencesProps } from '../interfaces';\nimport ContentDisplayOption, { getClassName as getOptionClassName } from './content-display-option';\nimport { getFilteredOptions, getSortedOptions, OptionWithVisibility } from './utils';\n\nimport styles from '../styles.css.js';\n\nconst componentPrefix = 'content-display';\n\nconst getClassName = (suffix: string) => styles[`${componentPrefix}-${suffix}`];\n\ninterface ContentDisplayPreferenceProps extends CollectionPreferencesProps.ContentDisplayPreference {\n onChange: (value: ReadonlyArray<CollectionPreferencesProps.ContentDisplayItem>) => void;\n value?: ReadonlyArray<CollectionPreferencesProps.ContentDisplayItem>;\n}\n\nexport default function ContentDisplayPreference({\n title,\n description,\n options,\n value = options.map(({ id }) => ({\n id,\n visible: true,\n })),\n onChange,\n liveAnnouncementDndStarted,\n liveAnnouncementDndItemReordered,\n liveAnnouncementDndItemCommitted,\n liveAnnouncementDndDiscarded,\n dragHandleAriaDescription,\n dragHandleAriaLabel,\n enableColumnFiltering = false,\n i18nStrings,\n}: ContentDisplayPreferenceProps) {\n const idPrefix = useUniqueId(componentPrefix);\n const i18n = useInternalI18n('collection-preferences');\n const [columnFilteringText, setColumnFilteringText] = useState('');\n\n const titleId = `${idPrefix}-title`;\n const descriptionId = `${idPrefix}-description`;\n\n const [sortedOptions, sortedAndFilteredOptions] = useMemo(() => {\n const sorted = getSortedOptions({ options, contentDisplay: value });\n const filtered = getFilteredOptions(sorted, columnFilteringText);\n return [sorted, filtered];\n }, [columnFilteringText, options, value]);\n\n const onToggle = (option: OptionWithVisibility) => {\n // We use sortedOptions as base and not value because there might be options that\n // are not in the value yet, so they're added as non-visible after the known ones.\n onChange(sortedOptions.map(({ id, visible }) => ({ id, visible: id === option.id ? !option.visible : visible })));\n };\n\n return (\n <div className={styles[componentPrefix]} {...getAnalyticsInnerContextAttribute('contentDisplay')}>\n <h3 className={getClassName('title')} id={titleId}>\n {i18n('contentDisplayPreference.title', title)}\n </h3>\n <p className={getClassName('description')} id={descriptionId}>\n {i18n('contentDisplayPreference.description', description)}\n </p>\n\n {/* Filter input */}\n {enableColumnFiltering && (\n <div className={getClassName('text-filter')}>\n <InternalTextFilter\n filteringText={columnFilteringText}\n filteringPlaceholder={i18n(\n 'contentDisplayPreference.i18nStrings.columnFilteringPlaceholder',\n i18nStrings?.columnFilteringPlaceholder\n )}\n filteringAriaLabel={i18n(\n 'contentDisplayPreference.i18nStrings.columnFilteringAriaLabel',\n i18nStrings?.columnFilteringAriaLabel\n )}\n filteringClearAriaLabel={i18n(\n 'contentDisplayPreference.i18nStrings.columnFilteringClearFilterText',\n i18nStrings?.columnFilteringClearFilterText\n )}\n onChange={({ detail }) => setColumnFilteringText(detail.filteringText)}\n countText={i18n(\n 'contentDisplayPreference.i18nStrings.columnFilteringCountText',\n i18nStrings?.columnFilteringCountText\n ? i18nStrings?.columnFilteringCountText(sortedAndFilteredOptions.length)\n : undefined,\n format => format({ count: sortedAndFilteredOptions.length })\n )}\n />\n </div>\n )}\n\n {/* No match */}\n {sortedAndFilteredOptions.length === 0 && (\n <div className={getClassName('no-match')}>\n <InternalSpaceBetween size=\"s\" alignItems=\"center\">\n <InternalBox margin={{ top: 'm' }}>\n {i18n(\n 'contentDisplayPreference.i18nStrings.columnFilteringNoMatchText',\n i18nStrings?.columnFilteringNoMatchText\n )}\n </InternalBox>\n <InternalButton onClick={() => setColumnFilteringText('')}>\n {i18n(\n 'contentDisplayPreference.i18nStrings.columnFilteringClearFilterText',\n i18nStrings?.columnFilteringClearFilterText\n )}\n </InternalButton>\n </InternalSpaceBetween>\n </div>\n )}\n\n {/* Use explicit list role to work around Safari not announcing lists as such when list-style is set to none.\n See https://bugs.webkit.org/show_bug.cgi?id=170179 */}\n <ul\n className={getClassName('option-list')}\n aria-describedby={descriptionId}\n aria-labelledby={titleId}\n role=\"list\"\n >\n <DndArea\n items={sortedAndFilteredOptions.map(data => ({ id: data.id, label: data.label, data }))}\n onItemsChange={items => onChange(items.map(({ id, data }) => ({ id, visible: data.visible })))}\n disableReorder={columnFilteringText.trim().length > 0}\n renderItem={({ ref, item, isSorting, isActive, style, className, dragHandleProps }) => {\n className = clsx(className, getOptionClassName(), isSorting && styles.sorting);\n const content = (\n <ContentDisplayOption\n ref={ref}\n option={item.data}\n onToggle={onToggle}\n dragHandleProps={dragHandleProps}\n />\n );\n return isActive ? (\n content\n ) : (\n <li className={className} style={style}>\n {content}\n </li>\n );\n }}\n i18nStrings={{\n liveAnnouncementDndStarted: i18n(\n 'contentDisplayPreference.liveAnnouncementDndStarted',\n liveAnnouncementDndStarted,\n format => (position, total) => format({ position, total })\n ),\n liveAnnouncementDndItemReordered: i18n(\n 'contentDisplayPreference.liveAnnouncementDndItemReordered',\n liveAnnouncementDndItemReordered,\n format => (initialPosition, currentPosition, total) =>\n format({ currentPosition, total, isInitialPosition: `${initialPosition === currentPosition}` })\n ),\n liveAnnouncementDndItemCommitted: i18n(\n 'contentDisplayPreference.liveAnnouncementDndItemCommitted',\n liveAnnouncementDndItemCommitted,\n format => (initialPosition, finalPosition, total) =>\n format({\n initialPosition,\n finalPosition,\n total,\n isInitialPosition: `${initialPosition === finalPosition}`,\n })\n ),\n liveAnnouncementDndDiscarded: i18n(\n 'contentDisplayPreference.liveAnnouncementDndDiscarded',\n liveAnnouncementDndDiscarded\n ),\n dragHandleAriaLabel: i18n('contentDisplayPreference.dragHandleAriaLabel', dragHandleAriaLabel),\n dragHandleAriaDescription: i18n(\n 'contentDisplayPreference.dragHandleAriaDescription',\n dragHandleAriaDescription\n ),\n }}\n />\n </ul>\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/collection-preferences/content-display/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,WAAW,MAAM,oBAAoB,CAAC;AAC7C,OAAO,cAAc,MAAM,uBAAuB,CAAC;AACnD,OAAO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CAAC,EAAE,CAAC,CAAC,eAAe,EAAE,eAAe,EAAE,KAAK,EAAE,EAAE,CACpD,MAAM,CAAC,EAAE,eAAe,EAAE,KAAK,EAAE,iBAAiB,EAAE,GAAG,eAAe,KAAK,eAAe,EAAE,EAAE,CAAC,CAClG;oBACD,gCAAgC,EAAE,IAAI,CACpC,2DAA2D,EAC3D,gCAAgC,EAChC,MAAM,CAAC,EAAE,CAAC,CAAC,eAAe,EAAE,aAAa,EAAE,KAAK,EAAE,EAAE,CAClD,MAAM,CAAC;wBACL,eAAe;wBACf,aAAa;wBACb,KAAK;wBACL,iBAAiB,EAAE,GAAG,eAAe,KAAK,aAAa,EAAE;qBAC1D,CAAC,CACL;oBACD,4BAA4B,EAAE,IAAI,CAChC,uDAAuD,EACvD,4BAA4B,CAC7B;oBACD,mBAAmB,EAAE,IAAI,CAAC,8CAA8C,EAAE,mBAAmB,CAAC;oBAC9F,yBAAyB,EAAE,IAAI,CAC7B,oDAAoD,EACpD,yBAAyB,CAC1B;iBACF,GACD,CACC,CACD,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useMemo, useState } from 'react';\nimport clsx from 'clsx';\n\nimport InternalBox from '../../box/internal';\nimport InternalButton from '../../button/internal';\nimport { useInternalI18n } from '../../i18n/context';\nimport SortableArea from '../../internal/components/sortable-area';\nimport { useUniqueId } from '../../internal/hooks/use-unique-id';\nimport InternalSpaceBetween from '../../space-between/internal';\nimport InternalTextFilter from '../../text-filter/internal';\nimport { getAnalyticsInnerContextAttribute } from '../analytics-metadata/utils';\nimport { CollectionPreferencesProps } from '../interfaces';\nimport ContentDisplayOption, { getClassName as getOptionClassName } from './content-display-option';\nimport { getFilteredOptions, getSortedOptions, OptionWithVisibility } from './utils';\n\nimport styles from '../styles.css.js';\n\nconst componentPrefix = 'content-display';\n\nconst getClassName = (suffix: string) => styles[`${componentPrefix}-${suffix}`];\n\ninterface ContentDisplayPreferenceProps extends CollectionPreferencesProps.ContentDisplayPreference {\n onChange: (value: ReadonlyArray<CollectionPreferencesProps.ContentDisplayItem>) => void;\n value?: ReadonlyArray<CollectionPreferencesProps.ContentDisplayItem>;\n}\n\nexport default function ContentDisplayPreference({\n title,\n description,\n options,\n value = options.map(({ id }) => ({\n id,\n visible: true,\n })),\n onChange,\n liveAnnouncementDndStarted,\n liveAnnouncementDndItemReordered,\n liveAnnouncementDndItemCommitted,\n liveAnnouncementDndDiscarded,\n dragHandleAriaDescription,\n dragHandleAriaLabel,\n enableColumnFiltering = false,\n i18nStrings,\n}: ContentDisplayPreferenceProps) {\n const idPrefix = useUniqueId(componentPrefix);\n const i18n = useInternalI18n('collection-preferences');\n const [columnFilteringText, setColumnFilteringText] = useState('');\n\n const titleId = `${idPrefix}-title`;\n const descriptionId = `${idPrefix}-description`;\n\n const [sortedOptions, sortedAndFilteredOptions] = useMemo(() => {\n const sorted = getSortedOptions({ options, contentDisplay: value });\n const filtered = getFilteredOptions(sorted, columnFilteringText);\n return [sorted, filtered];\n }, [columnFilteringText, options, value]);\n\n const onToggle = (option: OptionWithVisibility) => {\n // We use sortedOptions as base and not value because there might be options that\n // are not in the value yet, so they're added as non-visible after the known ones.\n onChange(sortedOptions.map(({ id, visible }) => ({ id, visible: id === option.id ? !option.visible : visible })));\n };\n\n return (\n <div className={styles[componentPrefix]} {...getAnalyticsInnerContextAttribute('contentDisplay')}>\n <h3 className={getClassName('title')} id={titleId}>\n {i18n('contentDisplayPreference.title', title)}\n </h3>\n <p className={getClassName('description')} id={descriptionId}>\n {i18n('contentDisplayPreference.description', description)}\n </p>\n\n {/* Filter input */}\n {enableColumnFiltering && (\n <div className={getClassName('text-filter')}>\n <InternalTextFilter\n filteringText={columnFilteringText}\n filteringPlaceholder={i18n(\n 'contentDisplayPreference.i18nStrings.columnFilteringPlaceholder',\n i18nStrings?.columnFilteringPlaceholder\n )}\n filteringAriaLabel={i18n(\n 'contentDisplayPreference.i18nStrings.columnFilteringAriaLabel',\n i18nStrings?.columnFilteringAriaLabel\n )}\n filteringClearAriaLabel={i18n(\n 'contentDisplayPreference.i18nStrings.columnFilteringClearFilterText',\n i18nStrings?.columnFilteringClearFilterText\n )}\n onChange={({ detail }) => setColumnFilteringText(detail.filteringText)}\n countText={i18n(\n 'contentDisplayPreference.i18nStrings.columnFilteringCountText',\n i18nStrings?.columnFilteringCountText\n ? i18nStrings?.columnFilteringCountText(sortedAndFilteredOptions.length)\n : undefined,\n format => format({ count: sortedAndFilteredOptions.length })\n )}\n />\n </div>\n )}\n\n {/* No match */}\n {sortedAndFilteredOptions.length === 0 && (\n <div className={getClassName('no-match')}>\n <InternalSpaceBetween size=\"s\" alignItems=\"center\">\n <InternalBox margin={{ top: 'm' }}>\n {i18n(\n 'contentDisplayPreference.i18nStrings.columnFilteringNoMatchText',\n i18nStrings?.columnFilteringNoMatchText\n )}\n </InternalBox>\n <InternalButton onClick={() => setColumnFilteringText('')}>\n {i18n(\n 'contentDisplayPreference.i18nStrings.columnFilteringClearFilterText',\n i18nStrings?.columnFilteringClearFilterText\n )}\n </InternalButton>\n </InternalSpaceBetween>\n </div>\n )}\n\n {/* Use explicit list role to work around Safari not announcing lists as such when list-style is set to none.\n See https://bugs.webkit.org/show_bug.cgi?id=170179 */}\n <ul\n className={getClassName('option-list')}\n aria-describedby={descriptionId}\n aria-labelledby={titleId}\n role=\"list\"\n >\n <SortableArea\n items={sortedAndFilteredOptions}\n itemDefinition={{ id: item => item.id, label: item => item.label }}\n onItemsChange={({ detail }) => onChange(detail.items)}\n disableReorder={columnFilteringText.trim().length > 0}\n renderItem={({ ref, item, style, className, dragHandleProps, isDragGhost }) => {\n className = clsx(className, getOptionClassName());\n const content = (\n <ContentDisplayOption ref={ref} option={item} onToggle={onToggle} dragHandleProps={dragHandleProps} />\n );\n if (isDragGhost) {\n return content;\n }\n return (\n <li className={className} style={style}>\n {content}\n </li>\n );\n }}\n i18nStrings={{\n liveAnnouncementDndStarted: i18n(\n 'contentDisplayPreference.liveAnnouncementDndStarted',\n liveAnnouncementDndStarted,\n format => (position, total) => format({ position, total })\n ),\n liveAnnouncementDndItemReordered: i18n(\n 'contentDisplayPreference.liveAnnouncementDndItemReordered',\n liveAnnouncementDndItemReordered,\n format => (initialPosition, currentPosition, total) =>\n format({ currentPosition, total, isInitialPosition: `${initialPosition === currentPosition}` })\n ),\n liveAnnouncementDndItemCommitted: i18n(\n 'contentDisplayPreference.liveAnnouncementDndItemCommitted',\n liveAnnouncementDndItemCommitted,\n format => (initialPosition, finalPosition, total) =>\n format({\n initialPosition,\n finalPosition,\n total,\n isInitialPosition: `${initialPosition === finalPosition}`,\n })\n ),\n liveAnnouncementDndDiscarded: i18n(\n 'contentDisplayPreference.liveAnnouncementDndDiscarded',\n liveAnnouncementDndDiscarded\n ),\n dragHandleAriaLabel: i18n('contentDisplayPreference.dragHandleAriaLabel', dragHandleAriaLabel),\n dragHandleAriaDescription: i18n(\n 'contentDisplayPreference.dragHandleAriaDescription',\n dragHandleAriaDescription\n ),\n }}\n />\n </ul>\n </div>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/date-picker/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA6C,MAAM,OAAO,CAAC;AAyBlE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAK/C,OAAO,EAAE,eAAe,EAAE,CAAC;AAE3B,QAAA,MAAM,UAAU,6FAiMf,CAAC;AAGF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/date-picker/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA6C,MAAM,OAAO,CAAC;AAyBlE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAK/C,OAAO,EAAE,eAAe,EAAE,CAAC;AAE3B,QAAA,MAAM,UAAU,6FA2Lf,CAAC;AAGF,eAAe,UAAU,CAAC"}
@@ -82,11 +82,7 @@ const DatePicker = React.forwardRef((_a, ref) => {
82
82
  React.createElement("div", null,
83
83
  React.createElement(InternalButton, { iconName: "calendar", className: styles['open-calendar-button'], onClick: onButtonClickHandler, ref: buttonRef, ariaLabel: buttonAriaLabel, disabled: disabled || readOnly, formAction: "none" }))));
84
84
  baseProps.className = clsx(baseProps.className, styles.root, styles['date-picker-container']);
85
- const handleMouseDown = (event) => {
86
- // prevent currently focused element from losing it
87
- event.preventDefault();
88
- };
89
- return (React.createElement("div", Object.assign({}, baseProps, { ref: mergedRef, onKeyDown: !disabled && !readOnly ? onWrapperKeyDownHandler : undefined }), disabled || readOnly ? (trigger) : (React.createElement(Dropdown, { stretchWidth: true, stretchHeight: true, open: isDropDownOpen, onDropdownClose: onDropdownCloseHandler, onMouseDown: handleMouseDown, trigger: trigger, expandToViewport: expandToViewport, scrollable: false, dropdownId: dropdownId }, isDropDownOpen && (React.createElement(FocusLock, { className: styles['focus-lock'], autoFocus: true },
85
+ return (React.createElement("div", Object.assign({}, baseProps, { ref: mergedRef, onKeyDown: !disabled && !readOnly ? onWrapperKeyDownHandler : undefined }), disabled || readOnly ? (trigger) : (React.createElement(Dropdown, { stretchWidth: true, stretchHeight: true, open: isDropDownOpen, onDropdownClose: onDropdownCloseHandler, trigger: trigger, expandToViewport: expandToViewport, scrollable: false, dropdownId: dropdownId }, isDropDownOpen && (React.createElement(FocusLock, { className: styles['focus-lock'], autoFocus: true },
90
86
  React.createElement("div", { tabIndex: 0, className: styles.calendar, role: "dialog" },
91
87
  React.createElement(InternalCalendar, { value: value, onChange: e => {
92
88
  var _a;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/date-picker/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAO,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAClE,OAAO,IAAI,MAAM,MA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CAAC,EACD,MAAM,EAAE,gBAAgB,EACxB,WAAW,EAAE,WAAW,EACxB,eAAe,EAAE,qBAAqB,EACtC,SAAS,EAAE,SAAS,EACpB,cAAc,EAAE,cAAc,EAC9B,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,aAAa,EAC5B,kBAAkB,EAAE,kBAAkB,EACtC,WAAW,kCACN,WAAW,KACd,cAAc,EAAE,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,cAAc,mCAAI,cAAc,EAC7D,kBAAkB,EAAE,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,kBAAkB,mCAAI,kBAAkB,EACzE,sBAAsB,EAAE,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,sBAAsB,mCAAI,sBAAsB,MAEvF;YACF,oBAAC,kBAAkB,IAAC,EAAE,EAAE,qBAAqB,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAC,MAAM,IACxE,gBAAgB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,gBAAgB,EAAE,CAAC,CACzD,CACjB,CACI,CACb,CACQ,CACZ,CACG,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAgB,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;AAC3C,eAAe,UAAU,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { Ref, useCallback, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { ButtonProps } from '../button/interfaces';\nimport { InternalButton } from '../button/internal';\nimport InternalCalendar from '../calendar/internal';\nimport { useFormFieldContext } from '../contexts/form-field.js';\nimport InternalDateInput from '../date-input/internal';\nimport { useLocale } from '../i18n/context.js';\nimport { InputProps } from '../input/interfaces';\nimport { getBaseProps } from '../internal/base-component';\nimport Dropdown from '../internal/components/dropdown';\nimport FocusLock from '../internal/components/focus-lock';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport checkControlled from '../internal/hooks/check-controlled';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { useFocusTracker } from '../internal/hooks/use-focus-tracker.js';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { KeyCode } from '../internal/keycode';\nimport { applyDisplayName } from '../internal/utils/apply-display-name.js';\nimport { parseDate } from '../internal/utils/date-time';\nimport { normalizeLocale } from '../internal/utils/locale';\nimport InternalLiveRegion from '../live-region/internal';\nimport { DatePickerProps } from './interfaces';\nimport { getBaseDateLabel, getSelectedDateLabel, isValidFullDate } from './utils';\n\nimport styles from './styles.css.js';\n\nexport { DatePickerProps };\n\nconst DatePicker = React.forwardRef(\n (\n {\n locale = '',\n startOfWeek,\n isDateEnabled,\n dateDisabledReason,\n nextMonthAriaLabel,\n previousMonthAriaLabel,\n todayAriaLabel,\n i18nStrings,\n placeholder = '',\n value = '',\n readOnly = false,\n disabled = false,\n onBlur,\n autoFocus = false,\n onChange,\n onFocus,\n name,\n ariaLabel,\n ariaRequired,\n controlId,\n invalid,\n warning,\n openCalendarAriaLabel,\n expandToViewport,\n granularity = 'day',\n ...restProps\n }: DatePickerProps,\n ref: Ref<DatePickerProps.Ref>\n ) => {\n const { __internalRootRef } = useBaseComponent('DatePicker', {\n props: { autoFocus, expandToViewport, granularity, readOnly },\n metadata: { hasDisabledReasons: Boolean(dateDisabledReason) },\n });\n checkControlled('DatePicker', 'value', value, 'onChange', onChange);\n\n const contextLocale = useLocale();\n const normalizedLocale = normalizeLocale('DatePicker', locale || contextLocale);\n\n const baseProps = getBaseProps(restProps);\n const [isDropDownOpen, setIsDropDownOpen] = useState<boolean>(false);\n const { ariaLabelledby, ariaDescribedby } = useFormFieldContext(restProps);\n\n const internalInputRef = useRef<HTMLInputElement>(null);\n const buttonRef = useRef<ButtonProps.Ref>(null);\n useForwardFocus(ref, internalInputRef);\n\n const rootRef = useRef<HTMLDivElement>(null);\n const dropdownId = useUniqueId('calender');\n const calendarDescriptionId = useUniqueId('calendar-description-');\n const mergedRef = useMergeRefs(rootRef, __internalRootRef);\n\n useFocusTracker({ rootRef, onBlur, onFocus });\n\n const onDropdownCloseHandler = useCallback(() => setIsDropDownOpen(false), [setIsDropDownOpen]);\n\n const onButtonClickHandler = () => {\n if (!isDropDownOpen) {\n setIsDropDownOpen(true);\n }\n };\n\n const onWrapperKeyDownHandler = (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.keyCode === KeyCode.escape && isDropDownOpen) {\n event.stopPropagation();\n buttonRef.current?.focus();\n setIsDropDownOpen(false);\n }\n };\n\n const onInputChangeHandler: InputProps['onChange'] = event => {\n fireNonCancelableEvent(onChange, { value: event.detail.value });\n };\n\n const onInputBlurHandler: InputProps['onBlur'] = () => {\n if (!isDropDownOpen) {\n setIsDropDownOpen(false);\n }\n };\n\n // Set displayed date to value if defined or to current date otherwise.\n const parsedValue = value && value.length >= 4 ? parseDate(value) : null;\n const baseDate = parsedValue || new Date();\n\n const hasFullValue = isValidFullDate({ date: value, granularity });\n\n const buttonAriaLabel =\n openCalendarAriaLabel &&\n openCalendarAriaLabel(\n hasFullValue && parsedValue\n ? getSelectedDateLabel({ date: parsedValue, granularity, locale: normalizedLocale })\n : null\n );\n\n const trigger = (\n <div className={styles['date-picker-trigger']}>\n <div className={styles['date-picker-input']}>\n <InternalDateInput\n name={name}\n invalid={invalid}\n warning={warning}\n controlId={controlId}\n ariaLabelledby={ariaLabelledby}\n ariaDescribedby={ariaDescribedby}\n ariaLabel={ariaLabel}\n ariaRequired={ariaRequired}\n value={value}\n disabled={disabled}\n readOnly={readOnly}\n onChange={onInputChangeHandler}\n onBlur={onInputBlurHandler}\n placeholder={placeholder}\n ref={internalInputRef}\n autoFocus={autoFocus}\n onFocus={onDropdownCloseHandler}\n granularity={granularity}\n />\n </div>\n <div>\n <InternalButton\n iconName=\"calendar\"\n className={styles['open-calendar-button']}\n onClick={onButtonClickHandler}\n ref={buttonRef}\n ariaLabel={buttonAriaLabel}\n disabled={disabled || readOnly}\n formAction=\"none\"\n />\n </div>\n </div>\n );\n\n baseProps.className = clsx(baseProps.className, styles.root, styles['date-picker-container']);\n\n const handleMouseDown = (event: React.MouseEvent) => {\n // prevent currently focused element from losing it\n event.preventDefault();\n };\n\n return (\n <div {...baseProps} ref={mergedRef} onKeyDown={!disabled && !readOnly ? onWrapperKeyDownHandler : undefined}>\n {disabled || readOnly ? (\n trigger\n ) : (\n <Dropdown\n stretchWidth={true}\n stretchHeight={true}\n open={isDropDownOpen}\n onDropdownClose={onDropdownCloseHandler}\n onMouseDown={handleMouseDown}\n trigger={trigger}\n expandToViewport={expandToViewport}\n scrollable={false}\n dropdownId={dropdownId}\n >\n {isDropDownOpen && (\n <FocusLock className={styles['focus-lock']} autoFocus={true}>\n <div tabIndex={0} className={styles.calendar} role=\"dialog\">\n <InternalCalendar\n value={value}\n onChange={e => {\n fireNonCancelableEvent(onChange, e.detail);\n buttonRef?.current?.focus();\n setIsDropDownOpen(false);\n }}\n locale={normalizedLocale}\n startOfWeek={startOfWeek}\n ariaDescribedby={calendarDescriptionId}\n ariaLabel={ariaLabel}\n ariaLabelledby={ariaLabelledby}\n granularity={granularity}\n isDateEnabled={isDateEnabled}\n dateDisabledReason={dateDisabledReason}\n i18nStrings={{\n ...i18nStrings,\n todayAriaLabel: i18nStrings?.todayAriaLabel ?? todayAriaLabel,\n nextMonthAriaLabel: i18nStrings?.nextMonthAriaLabel ?? nextMonthAriaLabel,\n previousMonthAriaLabel: i18nStrings?.previousMonthAriaLabel ?? previousMonthAriaLabel,\n }}\n />\n <InternalLiveRegion id={calendarDescriptionId} hidden={true} tagName=\"span\">\n {getBaseDateLabel({ date: baseDate, granularity, locale: normalizedLocale })}\n </InternalLiveRegion>\n </div>\n </FocusLock>\n )}\n </Dropdown>\n )}\n </div>\n );\n }\n);\n\napplyDisplayName(DatePicker,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BAAT,SAAS,CAAE,OAAO,0CAAE,KAAK,EAAE,CAAC;oBAC5B,iBAAiB,CAAC,KAAK,CAAC,CAAC;gBAC3B,CAAC,EACD,MAAM,EAAE,gBAAgB,EACxB,WAAW,EAAE,WAAW,EACxB,eAAe,EAAE,qBAAqB,EACtC,SAAS,EAAE,SAAS,EACpB,cAAc,EAAE,cAAc,EAC9B,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,aAAa,EAC5B,kBAAkB,EAAE,kBAAkB,EACtC,WAAW,kCACN,WAAW,KACd,cAAc,EAAE,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,cAAc,mCAAI,cAAc,EAC7D,kBAAkB,EAAE,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,kBAAkB,mCAAI,kBAAkB,EACzE,sBAAsB,EAAE,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,sBAAsB,mCAAI,sBAAsB,MAEvF;YACF,oBAAC,kBAAkB,IAAC,EAAE,EAAE,qBAAqB,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAC,MAAM,IACxE,gBAAgB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,gBAAgB,EAAE,CAAC,CACzD,CACjB,CACI,CACb,CACQ,CACZ,CACG,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAgB,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;AAC3C,eAAe,UAAU,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { Ref, useCallback, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { ButtonProps } from '../button/interfaces';\nimport { InternalButton } from '../button/internal';\nimport InternalCalendar from '../calendar/internal';\nimport { useFormFieldContext } from '../contexts/form-field.js';\nimport InternalDateInput from '../date-input/internal';\nimport { useLocale } from '../i18n/context.js';\nimport { InputProps } from '../input/interfaces';\nimport { getBaseProps } from '../internal/base-component';\nimport Dropdown from '../internal/components/dropdown';\nimport FocusLock from '../internal/components/focus-lock';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport checkControlled from '../internal/hooks/check-controlled';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { useFocusTracker } from '../internal/hooks/use-focus-tracker.js';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { KeyCode } from '../internal/keycode';\nimport { applyDisplayName } from '../internal/utils/apply-display-name.js';\nimport { parseDate } from '../internal/utils/date-time';\nimport { normalizeLocale } from '../internal/utils/locale';\nimport InternalLiveRegion from '../live-region/internal';\nimport { DatePickerProps } from './interfaces';\nimport { getBaseDateLabel, getSelectedDateLabel, isValidFullDate } from './utils';\n\nimport styles from './styles.css.js';\n\nexport { DatePickerProps };\n\nconst DatePicker = React.forwardRef(\n (\n {\n locale = '',\n startOfWeek,\n isDateEnabled,\n dateDisabledReason,\n nextMonthAriaLabel,\n previousMonthAriaLabel,\n todayAriaLabel,\n i18nStrings,\n placeholder = '',\n value = '',\n readOnly = false,\n disabled = false,\n onBlur,\n autoFocus = false,\n onChange,\n onFocus,\n name,\n ariaLabel,\n ariaRequired,\n controlId,\n invalid,\n warning,\n openCalendarAriaLabel,\n expandToViewport,\n granularity = 'day',\n ...restProps\n }: DatePickerProps,\n ref: Ref<DatePickerProps.Ref>\n ) => {\n const { __internalRootRef } = useBaseComponent('DatePicker', {\n props: { autoFocus, expandToViewport, granularity, readOnly },\n metadata: { hasDisabledReasons: Boolean(dateDisabledReason) },\n });\n checkControlled('DatePicker', 'value', value, 'onChange', onChange);\n\n const contextLocale = useLocale();\n const normalizedLocale = normalizeLocale('DatePicker', locale || contextLocale);\n\n const baseProps = getBaseProps(restProps);\n const [isDropDownOpen, setIsDropDownOpen] = useState<boolean>(false);\n const { ariaLabelledby, ariaDescribedby } = useFormFieldContext(restProps);\n\n const internalInputRef = useRef<HTMLInputElement>(null);\n const buttonRef = useRef<ButtonProps.Ref>(null);\n useForwardFocus(ref, internalInputRef);\n\n const rootRef = useRef<HTMLDivElement>(null);\n const dropdownId = useUniqueId('calender');\n const calendarDescriptionId = useUniqueId('calendar-description-');\n const mergedRef = useMergeRefs(rootRef, __internalRootRef);\n\n useFocusTracker({ rootRef, onBlur, onFocus });\n\n const onDropdownCloseHandler = useCallback(() => setIsDropDownOpen(false), [setIsDropDownOpen]);\n\n const onButtonClickHandler = () => {\n if (!isDropDownOpen) {\n setIsDropDownOpen(true);\n }\n };\n\n const onWrapperKeyDownHandler = (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.keyCode === KeyCode.escape && isDropDownOpen) {\n event.stopPropagation();\n buttonRef.current?.focus();\n setIsDropDownOpen(false);\n }\n };\n\n const onInputChangeHandler: InputProps['onChange'] = event => {\n fireNonCancelableEvent(onChange, { value: event.detail.value });\n };\n\n const onInputBlurHandler: InputProps['onBlur'] = () => {\n if (!isDropDownOpen) {\n setIsDropDownOpen(false);\n }\n };\n\n // Set displayed date to value if defined or to current date otherwise.\n const parsedValue = value && value.length >= 4 ? parseDate(value) : null;\n const baseDate = parsedValue || new Date();\n\n const hasFullValue = isValidFullDate({ date: value, granularity });\n\n const buttonAriaLabel =\n openCalendarAriaLabel &&\n openCalendarAriaLabel(\n hasFullValue && parsedValue\n ? getSelectedDateLabel({ date: parsedValue, granularity, locale: normalizedLocale })\n : null\n );\n\n const trigger = (\n <div className={styles['date-picker-trigger']}>\n <div className={styles['date-picker-input']}>\n <InternalDateInput\n name={name}\n invalid={invalid}\n warning={warning}\n controlId={controlId}\n ariaLabelledby={ariaLabelledby}\n ariaDescribedby={ariaDescribedby}\n ariaLabel={ariaLabel}\n ariaRequired={ariaRequired}\n value={value}\n disabled={disabled}\n readOnly={readOnly}\n onChange={onInputChangeHandler}\n onBlur={onInputBlurHandler}\n placeholder={placeholder}\n ref={internalInputRef}\n autoFocus={autoFocus}\n onFocus={onDropdownCloseHandler}\n granularity={granularity}\n />\n </div>\n <div>\n <InternalButton\n iconName=\"calendar\"\n className={styles['open-calendar-button']}\n onClick={onButtonClickHandler}\n ref={buttonRef}\n ariaLabel={buttonAriaLabel}\n disabled={disabled || readOnly}\n formAction=\"none\"\n />\n </div>\n </div>\n );\n\n baseProps.className = clsx(baseProps.className, styles.root, styles['date-picker-container']);\n\n return (\n <div {...baseProps} ref={mergedRef} onKeyDown={!disabled && !readOnly ? onWrapperKeyDownHandler : undefined}>\n {disabled || readOnly ? (\n trigger\n ) : (\n <Dropdown\n stretchWidth={true}\n stretchHeight={true}\n open={isDropDownOpen}\n onDropdownClose={onDropdownCloseHandler}\n trigger={trigger}\n expandToViewport={expandToViewport}\n scrollable={false}\n dropdownId={dropdownId}\n >\n {isDropDownOpen && (\n <FocusLock className={styles['focus-lock']} autoFocus={true}>\n <div tabIndex={0} className={styles.calendar} role=\"dialog\">\n <InternalCalendar\n value={value}\n onChange={e => {\n fireNonCancelableEvent(onChange, e.detail);\n buttonRef?.current?.focus();\n setIsDropDownOpen(false);\n }}\n locale={normalizedLocale}\n startOfWeek={startOfWeek}\n ariaDescribedby={calendarDescriptionId}\n ariaLabel={ariaLabel}\n ariaLabelledby={ariaLabelledby}\n granularity={granularity}\n isDateEnabled={isDateEnabled}\n dateDisabledReason={dateDisabledReason}\n i18nStrings={{\n ...i18nStrings,\n todayAriaLabel: i18nStrings?.todayAriaLabel ?? todayAriaLabel,\n nextMonthAriaLabel: i18nStrings?.nextMonthAriaLabel ?? nextMonthAriaLabel,\n previousMonthAriaLabel: i18nStrings?.previousMonthAriaLabel ?? previousMonthAriaLabel,\n }}\n />\n <InternalLiveRegion id={calendarDescriptionId} hidden={true} tagName=\"span\">\n {getBaseDateLabel({ date: baseDate, granularity, locale: normalizedLocale })}\n </InternalLiveRegion>\n </div>\n </FocusLock>\n )}\n </Dropdown>\n )}\n </div>\n );\n }\n);\n\napplyDisplayName(DatePicker, 'DatePicker');\nexport default DatePicker;\n"]}
@@ -1,43 +1,43 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "calendar": "awsui_calendar_mgja0_59opa_153",
5
- "awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-0_mgja0_59opa_1",
6
- "root": "awsui_root_mgja0_59opa_176",
7
- "wide": "awsui_wide_mgja0_59opa_207",
8
- "focus-lock": "awsui_focus-lock_mgja0_59opa_214",
9
- "trigger-flexbox": "awsui_trigger-flexbox_mgja0_59opa_218",
10
- "calendar-container": "awsui_calendar-container_mgja0_59opa_222",
11
- "one-grid": "awsui_one-grid_mgja0_59opa_225",
12
- "calendar-header": "awsui_calendar-header_mgja0_59opa_229",
13
- "calendar-header-months-wrapper": "awsui_calendar-header-months-wrapper_mgja0_59opa_235",
14
- "calendar-header-month": "awsui_calendar-header-month_mgja0_59opa_235",
15
- "calendar-next-month-btn": "awsui_calendar-next-month-btn_mgja0_59opa_254",
16
- "calendar-prev-month-btn": "awsui_calendar-prev-month-btn_mgja0_59opa_257",
17
- "first-grid": "awsui_first-grid_mgja0_59opa_261",
18
- "second-grid": "awsui_second-grid_mgja0_59opa_262",
19
- "date-and-time-container": "awsui_date-and-time-container_mgja0_59opa_266",
20
- "date-and-time-wrapper": "awsui_date-and-time-wrapper_mgja0_59opa_272",
21
- "footer": "awsui_footer_mgja0_59opa_279",
22
- "has-clear-button": "awsui_has-clear-button_mgja0_59opa_288",
23
- "footer-button-wrapper": "awsui_footer-button-wrapper_mgja0_59opa_297",
24
- "icon-wrapper": "awsui_icon-wrapper_mgja0_59opa_304",
25
- "label": "awsui_label_mgja0_59opa_309",
26
- "label-enabled": "awsui_label-enabled_mgja0_59opa_314",
27
- "label-text": "awsui_label-text_mgja0_59opa_318",
28
- "label-token-nowrap": "awsui_label-token-nowrap_mgja0_59opa_323",
29
- "mode-switch": "awsui_mode-switch_mgja0_59opa_327",
30
- "dropdown": "awsui_dropdown_mgja0_59opa_331",
31
- "dropdown-content": "awsui_dropdown-content_mgja0_59opa_353",
32
- "start-date-input": "awsui_start-date-input_mgja0_59opa_362",
33
- "start-time-input": "awsui_start-time-input_mgja0_59opa_363",
34
- "end-date-input": "awsui_end-date-input_mgja0_59opa_364",
35
- "end-time-input": "awsui_end-time-input_mgja0_59opa_365",
36
- "validation-section": "awsui_validation-section_mgja0_59opa_369",
37
- "validation-error": "awsui_validation-error_mgja0_59opa_373",
38
- "clear-button": "awsui_clear-button_mgja0_59opa_377",
39
- "apply-button": "awsui_apply-button_mgja0_59opa_381",
40
- "cancel-button": "awsui_cancel-button_mgja0_59opa_385",
41
- "calendar-aria-live": "awsui_calendar-aria-live_mgja0_59opa_389"
4
+ "calendar": "awsui_calendar_mgja0_wy9d2_153",
5
+ "awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-0_mgja0_wy9d2_1",
6
+ "root": "awsui_root_mgja0_wy9d2_176",
7
+ "wide": "awsui_wide_mgja0_wy9d2_207",
8
+ "focus-lock": "awsui_focus-lock_mgja0_wy9d2_214",
9
+ "trigger-flexbox": "awsui_trigger-flexbox_mgja0_wy9d2_218",
10
+ "calendar-container": "awsui_calendar-container_mgja0_wy9d2_222",
11
+ "one-grid": "awsui_one-grid_mgja0_wy9d2_225",
12
+ "calendar-header": "awsui_calendar-header_mgja0_wy9d2_229",
13
+ "calendar-header-months-wrapper": "awsui_calendar-header-months-wrapper_mgja0_wy9d2_235",
14
+ "calendar-header-month": "awsui_calendar-header-month_mgja0_wy9d2_235",
15
+ "calendar-next-month-btn": "awsui_calendar-next-month-btn_mgja0_wy9d2_254",
16
+ "calendar-prev-month-btn": "awsui_calendar-prev-month-btn_mgja0_wy9d2_257",
17
+ "first-grid": "awsui_first-grid_mgja0_wy9d2_261",
18
+ "second-grid": "awsui_second-grid_mgja0_wy9d2_262",
19
+ "date-and-time-container": "awsui_date-and-time-container_mgja0_wy9d2_266",
20
+ "date-and-time-wrapper": "awsui_date-and-time-wrapper_mgja0_wy9d2_272",
21
+ "footer": "awsui_footer_mgja0_wy9d2_279",
22
+ "has-clear-button": "awsui_has-clear-button_mgja0_wy9d2_288",
23
+ "footer-button-wrapper": "awsui_footer-button-wrapper_mgja0_wy9d2_297",
24
+ "icon-wrapper": "awsui_icon-wrapper_mgja0_wy9d2_304",
25
+ "label": "awsui_label_mgja0_wy9d2_309",
26
+ "label-enabled": "awsui_label-enabled_mgja0_wy9d2_313",
27
+ "label-text": "awsui_label-text_mgja0_wy9d2_317",
28
+ "label-token-nowrap": "awsui_label-token-nowrap_mgja0_wy9d2_322",
29
+ "mode-switch": "awsui_mode-switch_mgja0_wy9d2_326",
30
+ "dropdown": "awsui_dropdown_mgja0_wy9d2_330",
31
+ "dropdown-content": "awsui_dropdown-content_mgja0_wy9d2_352",
32
+ "start-date-input": "awsui_start-date-input_mgja0_wy9d2_360",
33
+ "start-time-input": "awsui_start-time-input_mgja0_wy9d2_361",
34
+ "end-date-input": "awsui_end-date-input_mgja0_wy9d2_362",
35
+ "end-time-input": "awsui_end-time-input_mgja0_wy9d2_363",
36
+ "validation-section": "awsui_validation-section_mgja0_wy9d2_367",
37
+ "validation-error": "awsui_validation-error_mgja0_wy9d2_371",
38
+ "clear-button": "awsui_clear-button_mgja0_wy9d2_375",
39
+ "apply-button": "awsui_apply-button_mgja0_wy9d2_379",
40
+ "cancel-button": "awsui_cancel-button_mgja0_wy9d2_383",
41
+ "calendar-aria-live": "awsui_calendar-aria-live_mgja0_wy9d2_387"
42
42
  };
43
43