@cloudscape-design/components-themeable 3.0.140 → 3.0.141

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 (88) hide show
  1. package/lib/internal/manifest.json +1 -1
  2. package/lib/internal/scss/collection-preferences/styles.scss +1 -0
  3. package/lib/internal/scss/table/body-cell/styles.scss +4 -0
  4. package/lib/internal/template/area-chart/chart-container.d.ts.map +1 -1
  5. package/lib/internal/template/area-chart/chart-container.js +2 -1
  6. package/lib/internal/template/area-chart/chart-container.js.map +1 -1
  7. package/lib/internal/template/area-chart/model/interactions-store.d.ts.map +1 -1
  8. package/lib/internal/template/area-chart/model/interactions-store.js +1 -1
  9. package/lib/internal/template/area-chart/model/interactions-store.js.map +1 -1
  10. package/lib/internal/template/area-chart/model/use-chart-model.d.ts +1 -2
  11. package/lib/internal/template/area-chart/model/use-chart-model.d.ts.map +1 -1
  12. package/lib/internal/template/area-chart/model/use-chart-model.js +46 -10
  13. package/lib/internal/template/area-chart/model/use-chart-model.js.map +1 -1
  14. package/lib/internal/template/collection-preferences/index.d.ts +1 -1
  15. package/lib/internal/template/collection-preferences/index.d.ts.map +1 -1
  16. package/lib/internal/template/collection-preferences/index.js +10 -5
  17. package/lib/internal/template/collection-preferences/index.js.map +1 -1
  18. package/lib/internal/template/collection-preferences/interfaces.d.ts +17 -0
  19. package/lib/internal/template/collection-preferences/interfaces.d.ts.map +1 -1
  20. package/lib/internal/template/collection-preferences/interfaces.js.map +1 -1
  21. package/lib/internal/template/collection-preferences/styles.css.js +20 -19
  22. package/lib/internal/template/collection-preferences/styles.scoped.css +21 -20
  23. package/lib/internal/template/collection-preferences/styles.selectors.js +20 -19
  24. package/lib/internal/template/collection-preferences/utils.d.ts +6 -1
  25. package/lib/internal/template/collection-preferences/utils.d.ts.map +1 -1
  26. package/lib/internal/template/collection-preferences/utils.js +10 -1
  27. package/lib/internal/template/collection-preferences/utils.js.map +1 -1
  28. package/lib/internal/template/internal/base-component/styles.scoped.css +9 -0
  29. package/lib/internal/template/internal/components/chart-plot/focus-outline.d.ts +2 -1
  30. package/lib/internal/template/internal/components/chart-plot/focus-outline.d.ts.map +1 -1
  31. package/lib/internal/template/internal/components/chart-plot/focus-outline.js +6 -4
  32. package/lib/internal/template/internal/components/chart-plot/focus-outline.js.map +1 -1
  33. package/lib/internal/template/internal/components/chart-plot/index.d.ts +2 -1
  34. package/lib/internal/template/internal/components/chart-plot/index.d.ts.map +1 -1
  35. package/lib/internal/template/internal/components/chart-plot/index.js.map +1 -1
  36. package/lib/internal/template/internal/components/chart-plot/interfaces.d.ts +5 -0
  37. package/lib/internal/template/internal/components/chart-plot/interfaces.d.ts.map +1 -0
  38. package/lib/internal/template/internal/components/chart-plot/interfaces.js +2 -0
  39. package/lib/internal/template/internal/components/chart-plot/interfaces.js.map +1 -0
  40. package/lib/internal/template/internal/components/interfaces.d.ts +5 -0
  41. package/lib/internal/template/internal/components/interfaces.d.ts.map +1 -0
  42. package/lib/internal/template/internal/components/interfaces.js +2 -0
  43. package/lib/internal/template/internal/components/interfaces.js.map +1 -0
  44. package/lib/internal/template/internal/environment.js +1 -1
  45. package/lib/internal/template/internal/generated/theming/index.cjs +26 -0
  46. package/lib/internal/template/internal/generated/theming/index.js +26 -0
  47. package/lib/internal/template/mixed-line-bar-chart/chart-container.d.ts +1 -2
  48. package/lib/internal/template/mixed-line-bar-chart/chart-container.d.ts.map +1 -1
  49. package/lib/internal/template/mixed-line-bar-chart/chart-container.js +55 -41
  50. package/lib/internal/template/mixed-line-bar-chart/chart-container.js.map +1 -1
  51. package/lib/internal/template/mixed-line-bar-chart/hooks/use-mouse-hover.d.ts +3 -4
  52. package/lib/internal/template/mixed-line-bar-chart/hooks/use-mouse-hover.d.ts.map +1 -1
  53. package/lib/internal/template/mixed-line-bar-chart/hooks/use-mouse-hover.js +22 -18
  54. package/lib/internal/template/mixed-line-bar-chart/hooks/use-mouse-hover.js.map +1 -1
  55. package/lib/internal/template/mixed-line-bar-chart/hooks/use-navigation.d.ts +6 -3
  56. package/lib/internal/template/mixed-line-bar-chart/hooks/use-navigation.d.ts.map +1 -1
  57. package/lib/internal/template/mixed-line-bar-chart/hooks/use-navigation.js +61 -31
  58. package/lib/internal/template/mixed-line-bar-chart/hooks/use-navigation.js.map +1 -1
  59. package/lib/internal/template/mixed-line-bar-chart/interfaces.d.ts +4 -0
  60. package/lib/internal/template/mixed-line-bar-chart/interfaces.d.ts.map +1 -1
  61. package/lib/internal/template/mixed-line-bar-chart/interfaces.js.map +1 -1
  62. package/lib/internal/template/mixed-line-bar-chart/internal.d.ts.map +1 -1
  63. package/lib/internal/template/mixed-line-bar-chart/internal.js +1 -1
  64. package/lib/internal/template/mixed-line-bar-chart/internal.js.map +1 -1
  65. package/lib/internal/template/table/body-cell/index.d.ts +3 -1
  66. package/lib/internal/template/table/body-cell/index.d.ts.map +1 -1
  67. package/lib/internal/template/table/body-cell/index.js +2 -2
  68. package/lib/internal/template/table/body-cell/index.js.map +1 -1
  69. package/lib/internal/template/table/body-cell/styles.css.js +8 -7
  70. package/lib/internal/template/table/body-cell/styles.scoped.css +21 -18
  71. package/lib/internal/template/table/body-cell/styles.selectors.js +8 -7
  72. package/lib/internal/template/table/interfaces.d.ts +4 -0
  73. package/lib/internal/template/table/interfaces.d.ts.map +1 -1
  74. package/lib/internal/template/table/interfaces.js.map +1 -1
  75. package/lib/internal/template/table/internal.d.ts.map +1 -1
  76. package/lib/internal/template/table/internal.js +4 -3
  77. package/lib/internal/template/table/internal.js.map +1 -1
  78. package/lib/internal/template/table/use-sticky-header.d.ts.map +1 -1
  79. package/lib/internal/template/table/use-sticky-header.js +4 -1
  80. package/lib/internal/template/table/use-sticky-header.js.map +1 -1
  81. package/lib/internal/template/test-utils/dom/collection-preferences/index.d.ts +1 -0
  82. package/lib/internal/template/test-utils/dom/collection-preferences/index.js +3 -0
  83. package/lib/internal/template/test-utils/dom/collection-preferences/index.js.map +1 -1
  84. package/lib/internal/template/test-utils/selectors/collection-preferences/index.d.ts +1 -0
  85. package/lib/internal/template/test-utils/selectors/collection-preferences/index.js +3 -0
  86. package/lib/internal/template/test-utils/selectors/collection-preferences/index.js.map +1 -1
  87. package/lib/internal/template/test-utils/tsconfig.tsbuildinfo +1 -1
  88. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/collection-preferences/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport interface CollectionPreferencesProps<CustomPreferenceType = any> extends BaseComponentProps {\n /**\n * Specifies the title of the preferences modal dialog. It is also used as an `aria-label` for the trigger button.\n */\n title: string;\n /**\n * Label of the confirm button in the modal footer.\n */\n confirmLabel: string;\n /**\n * Label of the cancel button in the modal footer.\n */\n cancelLabel: string;\n /**\n * Determines whether the preferences trigger button is disabled.\n */\n disabled?: boolean;\n /**\n * Configures the built-in \"page size selection\" preference.\n *\n * If you set it, the component displays this preference in the modal.\n *\n * It contains the following:\n * - `title` (string) - Specifies the text displayed at the top of the preference.\n * - `options` - Specifies an array of options for page size selection. Each entry contains:\n * - `value` (number) - The value for the radio button (that is, the number of items per page).\n * - `label` (string) - A label for the radio button (for example, \"10 resources\").\n *\n * You must set the current value in the `preferences.pageSize` property.\n */\n pageSizePreference?: CollectionPreferencesProps.PageSizePreference;\n /**\n * Configures the built-in \"wrap lines\" preference.\n *\n * If you set it, the component displays this preference in the modal.\n *\n * It contains the following:\n * - `label` (string) - Specifies the label for the option checkbox.\n * - `description` (string) - Specifies the text displayed below the checkbox label.\n *\n * You must set the current value in the `preferences.wrapLines` property.\n */\n wrapLinesPreference?: CollectionPreferencesProps.WrapLinesPreference;\n /**\n * Configures the built-in \"visible content selection\" preference (for example, visible columns in a table).\n *\n * If you set it, the component displays this preference in the modal.\n *\n * It contains the following:\n * - `title` (string) - Specifies the text displayed at the top of the preference.\n * - `options` - Specifies an array of groups of options for visible content selection.\n *\n * Each group of options contains the following:\n * - `label` (string) - The text to display as a title for the options group.\n * - `options` - Specifies an aray of options in the group. Each option contains the following:\n * - `id` (string) - Corresponds to a column `id` for tables or to a section `id` for cards.\n * - `label` (string) - Specifies a short description of the content.\n * - `editable` (boolean) - (Optional) Determines whether the user is able to toggle its visibility. This is `true` by default.\n *\n * You must set the current list of visible content `id`s in the `preferences.visibleContent` property.\n */\n visibleContentPreference?: CollectionPreferencesProps.VisibleContentPreference;\n /**\n * Specifies the current preference values. This includes both built-in and custom preferences.\n *\n * It contains the following:\n * - `pageSize` (number) - (Optional)\n * - `wrapLines` (boolean) - (Optional)\n * - `visibleContent` (ReadonlyArray<string>) - Specifies the list of visible content `id`s. The order of the `id`s does not influence the display.\n * - `custom` (CustomPreferenceType) - Specifies the value for your custom preference.\n */\n preferences?: CollectionPreferencesProps.Preferences<CustomPreferenceType>;\n /**\n * Configures custom preferences. The function receives two parameters:\n *\n * - `customValue` (CustomPreferenceType) - Current value for your custom preference. It is initialized using the value you provide in `preferences.custom`.\n * - `setCustomValue` - A function that is called to notify a state update.\n *\n * It should return the content of your custom preference, for example:\n * ```\n * (customValue, setCustomValue) => (\n * <Checkbox checked={customValue} onChange={({ detail }) => setCustomValue(detail.checked)} />\n * )\n * ```\n *\n * When the user confirms the changes, the new value is passed in the `detail.custom` property of the `onConfirm` listener.\n * When the user cancels the changes, the `customValue` is reset to the one present in `preferences.custom` property.\n *\n * **Display**\n * - If any of the built-in preferences (`pageSizePreference`, `wrapLinesPreference`, or `visibleContentPreference`) are displayed,\n * the custom content is displayed at the bottom of the left column within the modal.\n * - If no built-in preference is displayed, the custom content occupies the whole modal.\n */\n customPreference?: (\n customValue: CustomPreferenceType,\n setCustomValue: React.Dispatch<CustomPreferenceType>\n ) => React.ReactNode;\n /**\n * Called when the user cancels a preference change using the cancel button in the modal footer or by dismissing the modal.\n */\n onCancel?: NonCancelableEventHandler;\n /**\n * Called when the user confirms a preference change using the confirm button in the modal footer.\n *\n * The event `detail` contains the following:\n * - `pageSize` (number) - (Optional) The selected page size value. Available only if you specify the `pageSizePreference` property.\n * - `wrapLines` (boolean) - (Optional) The current line wrapping preference value. Available only if you specify the `wrapLinesPreference` property.\n * - `visibleContent` (ReadonlyArray<string>) - (Optional) The list of selected content `id`s. Available only if you specify the `visibleContentPreference` property.\n * - `custom` (CustomPreferenceType) - (Optional) The selected value for your custom preference.\n *\n * The values for all configured preferences are present even if the user didn't change their values.\n */\n onConfirm?: NonCancelableEventHandler<CollectionPreferencesProps.Preferences<CustomPreferenceType>>;\n}\n\nexport namespace CollectionPreferencesProps {\n export interface Preferences<CustomPreferenceType = any> {\n pageSize?: number;\n wrapLines?: boolean;\n visibleContent?: ReadonlyArray<string>;\n custom?: CustomPreferenceType;\n }\n\n export interface VisibleContentPreference {\n title: string;\n options: ReadonlyArray<CollectionPreferencesProps.VisibleContentOptionsGroup>;\n }\n\n export interface VisibleContentOptionsGroup {\n label: string;\n options: ReadonlyArray<CollectionPreferencesProps.VisibleContentOption>;\n }\n\n export interface VisibleContentOption {\n id: string;\n label: string;\n editable?: boolean;\n }\n\n export interface PageSizePreference {\n title: string;\n options: ReadonlyArray<PageSizeOption>;\n }\n\n export interface PageSizeOption {\n value: number;\n label: string;\n }\n\n export interface WrapLinesPreference {\n label: string;\n description: string;\n }\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/collection-preferences/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport interface CollectionPreferencesProps<CustomPreferenceType = any> extends BaseComponentProps {\n /**\n * Specifies the title of the preferences modal dialog. It is also used as an `aria-label` for the trigger button.\n */\n title: string;\n /**\n * Label of the confirm button in the modal footer.\n */\n confirmLabel: string;\n /**\n * Label of the cancel button in the modal footer.\n */\n cancelLabel: string;\n /**\n * Determines whether the preferences trigger button is disabled.\n */\n disabled?: boolean;\n /**\n * Configures the built-in \"page size selection\" preference.\n *\n * If you set it, the component displays this preference in the modal.\n *\n * It contains the following:\n * - `title` (string) - Specifies the text displayed at the top of the preference.\n * - `options` - Specifies an array of options for page size selection. Each entry contains:\n * - `value` (number) - The value for the radio button (that is, the number of items per page).\n * - `label` (string) - A label for the radio button (for example, \"10 resources\").\n *\n * You must set the current value in the `preferences.pageSize` property.\n */\n pageSizePreference?: CollectionPreferencesProps.PageSizePreference;\n /**\n * Configures the built-in \"wrap lines\" preference.\n *\n * If you set it, the component displays this preference in the modal.\n *\n * It contains the following:\n * - `label` (string) - Specifies the label for the option checkbox.\n * - `description` (string) - Specifies the text displayed below the checkbox label.\n *\n * You must set the current value in the `preferences.wrapLines` property.\n */\n wrapLinesPreference?: CollectionPreferencesProps.WrapLinesPreference;\n /**\n * Configures the built-in \"striped rows\" preference.\n *\n * If you set it, the component displays this preference in the modal.\n *\n * It contains the following:\n * - `label` (string) - Specifies the label for the option checkbox.\n * - `description` (string) - Specifies the text displayed below the checkbox label.\n *\n * You must set the current value in the `preferences.stripedRows` property.\n */\n stripedRowsPreference?: CollectionPreferencesProps.StripedRowsPreference;\n /**\n * Configures the built-in \"visible content selection\" preference (for example, visible columns in a table).\n *\n * If you set it, the component displays this preference in the modal.\n *\n * It contains the following:\n * - `title` (string) - Specifies the text displayed at the top of the preference.\n * - `options` - Specifies an array of groups of options for visible content selection.\n *\n * Each group of options contains the following:\n * - `label` (string) - The text to display as a title for the options group.\n * - `options` - Specifies an aray of options in the group. Each option contains the following:\n * - `id` (string) - Corresponds to a column `id` for tables or to a section `id` for cards.\n * - `label` (string) - Specifies a short description of the content.\n * - `editable` (boolean) - (Optional) Determines whether the user is able to toggle its visibility. This is `true` by default.\n *\n * You must set the current list of visible content `id`s in the `preferences.visibleContent` property.\n */\n visibleContentPreference?: CollectionPreferencesProps.VisibleContentPreference;\n /**\n * Specifies the current preference values. This includes both built-in and custom preferences.\n *\n * It contains the following:\n * - `pageSize` (number) - (Optional)\n * - `wrapLines` (boolean) - (Optional)\n * - `visibleContent` (ReadonlyArray<string>) - Specifies the list of visible content `id`s. The order of the `id`s does not influence the display.\n * - `custom` (CustomPreferenceType) - Specifies the value for your custom preference.\n */\n preferences?: CollectionPreferencesProps.Preferences<CustomPreferenceType>;\n /**\n * Configures custom preferences. The function receives two parameters:\n *\n * - `customValue` (CustomPreferenceType) - Current value for your custom preference. It is initialized using the value you provide in `preferences.custom`.\n * - `setCustomValue` - A function that is called to notify a state update.\n *\n * It should return the content of your custom preference, for example:\n * ```\n * (customValue, setCustomValue) => (\n * <Checkbox checked={customValue} onChange={({ detail }) => setCustomValue(detail.checked)} />\n * )\n * ```\n *\n * When the user confirms the changes, the new value is passed in the `detail.custom` property of the `onConfirm` listener.\n * When the user cancels the changes, the `customValue` is reset to the one present in `preferences.custom` property.\n *\n * **Display**\n * - If any of the built-in preferences (`pageSizePreference`, `wrapLinesPreference`, or `visibleContentPreference`) are displayed,\n * the custom content is displayed at the bottom of the left column within the modal.\n * - If no built-in preference is displayed, the custom content occupies the whole modal.\n */\n customPreference?: (\n customValue: CustomPreferenceType,\n setCustomValue: React.Dispatch<CustomPreferenceType>\n ) => React.ReactNode;\n /**\n * Called when the user cancels a preference change using the cancel button in the modal footer or by dismissing the modal.\n */\n onCancel?: NonCancelableEventHandler;\n /**\n * Called when the user confirms a preference change using the confirm button in the modal footer.\n *\n * The event `detail` contains the following:\n * - `pageSize` (number) - (Optional) The selected page size value. Available only if you specify the `pageSizePreference` property.\n * - `wrapLines` (boolean) - (Optional) The current line wrapping preference value. Available only if you specify the `wrapLinesPreference` property.\n * - `visibleContent` (ReadonlyArray<string>) - (Optional) The list of selected content `id`s. Available only if you specify the `visibleContentPreference` property.\n * - `custom` (CustomPreferenceType) - (Optional) The selected value for your custom preference.\n *\n * The values for all configured preferences are present even if the user didn't change their values.\n */\n onConfirm?: NonCancelableEventHandler<CollectionPreferencesProps.Preferences<CustomPreferenceType>>;\n}\n\nexport namespace CollectionPreferencesProps {\n export interface Preferences<CustomPreferenceType = any> {\n pageSize?: number;\n wrapLines?: boolean;\n stripedRows?: boolean;\n visibleContent?: ReadonlyArray<string>;\n custom?: CustomPreferenceType;\n }\n\n export interface VisibleContentPreference {\n title: string;\n options: ReadonlyArray<CollectionPreferencesProps.VisibleContentOptionsGroup>;\n }\n\n export interface VisibleContentOptionsGroup {\n label: string;\n options: ReadonlyArray<CollectionPreferencesProps.VisibleContentOption>;\n }\n\n export interface VisibleContentOption {\n id: string;\n label: string;\n editable?: boolean;\n }\n\n export interface PageSizePreference {\n title: string;\n options: ReadonlyArray<PageSizeOption>;\n }\n\n export interface PageSizeOption {\n value: number;\n label: string;\n }\n\n export interface WrapLinesPreference {\n label: string;\n description: string;\n }\n\n export interface StripedRowsPreference {\n label: string;\n description: string;\n }\n}\n"]}
@@ -1,24 +1,25 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "visible-content": "awsui_visible-content_tc96w_mj68r_185",
5
- "visible-content-toggle": "awsui_visible-content-toggle_tc96w_mj68r_186",
6
- "visible-content-groups": "awsui_visible-content-groups_tc96w_mj68r_187",
7
- "visible-content-group": "awsui_visible-content-group_tc96w_mj68r_187",
8
- "visible-content-title": "awsui_visible-content-title_tc96w_mj68r_192",
9
- "visible-content-group-label": "awsui_visible-content-group-label_tc96w_mj68r_200",
10
- "visible-content-option": "awsui_visible-content-option_tc96w_mj68r_206",
11
- "visible-content-option-label": "awsui_visible-content-option-label_tc96w_mj68r_217",
12
- "root": "awsui_root_tc96w_mj68r_224",
13
- "modal-root": "awsui_modal-root_tc96w_mj68r_225",
14
- "trigger-button": "awsui_trigger-button_tc96w_mj68r_226",
15
- "cancel-button": "awsui_cancel-button_tc96w_mj68r_227",
16
- "confirm-button": "awsui_confirm-button_tc96w_mj68r_228",
17
- "custom": "awsui_custom_tc96w_mj68r_229",
18
- "second-column-small": "awsui_second-column-small_tc96w_mj68r_233",
19
- "wrap-lines": "awsui_wrap-lines_tc96w_mj68r_237",
20
- "page-size": "awsui_page-size_tc96w_mj68r_238",
21
- "page-size-form-field": "awsui_page-size-form-field_tc96w_mj68r_239",
22
- "page-size-radio-group": "awsui_page-size-radio-group_tc96w_mj68r_240"
4
+ "visible-content": "awsui_visible-content_tc96w_rdaxh_185",
5
+ "visible-content-toggle": "awsui_visible-content-toggle_tc96w_rdaxh_186",
6
+ "visible-content-groups": "awsui_visible-content-groups_tc96w_rdaxh_187",
7
+ "visible-content-group": "awsui_visible-content-group_tc96w_rdaxh_187",
8
+ "visible-content-title": "awsui_visible-content-title_tc96w_rdaxh_192",
9
+ "visible-content-group-label": "awsui_visible-content-group-label_tc96w_rdaxh_200",
10
+ "visible-content-option": "awsui_visible-content-option_tc96w_rdaxh_206",
11
+ "visible-content-option-label": "awsui_visible-content-option-label_tc96w_rdaxh_217",
12
+ "root": "awsui_root_tc96w_rdaxh_224",
13
+ "modal-root": "awsui_modal-root_tc96w_rdaxh_225",
14
+ "trigger-button": "awsui_trigger-button_tc96w_rdaxh_226",
15
+ "cancel-button": "awsui_cancel-button_tc96w_rdaxh_227",
16
+ "confirm-button": "awsui_confirm-button_tc96w_rdaxh_228",
17
+ "custom": "awsui_custom_tc96w_rdaxh_229",
18
+ "second-column-small": "awsui_second-column-small_tc96w_rdaxh_233",
19
+ "wrap-lines": "awsui_wrap-lines_tc96w_rdaxh_237",
20
+ "striped-rows": "awsui_striped-rows_tc96w_rdaxh_238",
21
+ "page-size": "awsui_page-size_tc96w_rdaxh_239",
22
+ "page-size-form-field": "awsui_page-size-form-field_tc96w_rdaxh_240",
23
+ "page-size-radio-group": "awsui_page-size-radio-group_tc96w_rdaxh_241"
23
24
  };
24
25
 
@@ -182,14 +182,14 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
182
182
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
183
183
  SPDX-License-Identifier: Apache-2.0
184
184
  */
185
- .awsui_visible-content_tc96w_mj68r_185:not(#\9),
186
- .awsui_visible-content-toggle_tc96w_mj68r_186:not(#\9),
187
- .awsui_visible-content-groups_tc96w_mj68r_187:not(#\9),
188
- .awsui_visible-content-group_tc96w_mj68r_187:not(#\9) {
185
+ .awsui_visible-content_tc96w_rdaxh_185:not(#\9),
186
+ .awsui_visible-content-toggle_tc96w_rdaxh_186:not(#\9),
187
+ .awsui_visible-content-groups_tc96w_rdaxh_187:not(#\9),
188
+ .awsui_visible-content-group_tc96w_rdaxh_187:not(#\9) {
189
189
  /* used in test-utils */
190
190
  }
191
191
 
192
- .awsui_visible-content-title_tc96w_mj68r_192:not(#\9) {
192
+ .awsui_visible-content-title_tc96w_rdaxh_192:not(#\9) {
193
193
  font-size: var(--font-body-m-size-sregvd, 14px);
194
194
  line-height: var(--font-body-m-line-height-i7xxvv, 22px);
195
195
  font-weight: var(--font-display-label-weight-tjy9e4, 400);
@@ -197,46 +197,47 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
197
197
  margin-bottom: var(--space-scaled-l-t03y3z, 20px);
198
198
  }
199
199
 
200
- .awsui_visible-content-group-label_tc96w_mj68r_200:not(#\9) {
200
+ .awsui_visible-content-group-label_tc96w_rdaxh_200:not(#\9) {
201
201
  color: var(--color-text-group-label-5rxtyp, #545b64);
202
202
  padding-bottom: var(--space-xs-rsr2qu, 8px);
203
203
  border-bottom: var(--border-divider-list-width-hacikr, 1px) solid var(--color-border-divider-default-k96bks, #eaeded);
204
204
  }
205
205
 
206
- .awsui_visible-content-option_tc96w_mj68r_206:not(#\9) {
206
+ .awsui_visible-content-option_tc96w_rdaxh_206:not(#\9) {
207
207
  display: flex;
208
208
  flex-wrap: nowrap;
209
209
  justify-content: space-between;
210
210
  padding: var(--space-xs-rsr2qu, 8px) 0px var(--space-xs-rsr2qu, 8px) var(--space-scaled-l-t03y3z, 20px);
211
211
  border-bottom: var(--border-divider-list-width-hacikr, 1px) solid var(--color-border-divider-default-k96bks, #eaeded);
212
212
  }
213
- .awsui_visible-content-option_tc96w_mj68r_206:not(#\9):last-child {
213
+ .awsui_visible-content-option_tc96w_rdaxh_206:not(#\9):last-child {
214
214
  border-bottom: none;
215
215
  }
216
216
 
217
- .awsui_visible-content-option-label_tc96w_mj68r_217:not(#\9) {
217
+ .awsui_visible-content-option-label_tc96w_rdaxh_217:not(#\9) {
218
218
  overflow: hidden;
219
219
  text-overflow: ellipsis;
220
220
  padding-right: var(--space-l-4vl6xu, 20px);
221
221
  flex-grow: 1;
222
222
  }
223
223
 
224
- .awsui_root_tc96w_mj68r_224:not(#\9),
225
- .awsui_modal-root_tc96w_mj68r_225:not(#\9),
226
- .awsui_trigger-button_tc96w_mj68r_226:not(#\9),
227
- .awsui_cancel-button_tc96w_mj68r_227:not(#\9),
228
- .awsui_confirm-button_tc96w_mj68r_228:not(#\9),
229
- .awsui_custom_tc96w_mj68r_229:not(#\9) {
224
+ .awsui_root_tc96w_rdaxh_224:not(#\9),
225
+ .awsui_modal-root_tc96w_rdaxh_225:not(#\9),
226
+ .awsui_trigger-button_tc96w_rdaxh_226:not(#\9),
227
+ .awsui_cancel-button_tc96w_rdaxh_227:not(#\9),
228
+ .awsui_confirm-button_tc96w_rdaxh_228:not(#\9),
229
+ .awsui_custom_tc96w_rdaxh_229:not(#\9) {
230
230
  /* used in test-utils */
231
231
  }
232
232
 
233
- .awsui_second-column-small_tc96w_mj68r_233:not(#\9) {
233
+ .awsui_second-column-small_tc96w_rdaxh_233:not(#\9) {
234
234
  padding-top: calc(2 * var(--space-scaled-l-t03y3z, 20px));
235
235
  }
236
236
 
237
- .awsui_wrap-lines_tc96w_mj68r_237:not(#\9),
238
- .awsui_page-size_tc96w_mj68r_238:not(#\9),
239
- .awsui_page-size-form-field_tc96w_mj68r_239:not(#\9),
240
- .awsui_page-size-radio-group_tc96w_mj68r_240:not(#\9) {
237
+ .awsui_wrap-lines_tc96w_rdaxh_237:not(#\9),
238
+ .awsui_striped-rows_tc96w_rdaxh_238:not(#\9),
239
+ .awsui_page-size_tc96w_rdaxh_239:not(#\9),
240
+ .awsui_page-size-form-field_tc96w_rdaxh_240:not(#\9),
241
+ .awsui_page-size-radio-group_tc96w_rdaxh_241:not(#\9) {
241
242
  /* used in test-utils */
242
243
  }
@@ -2,24 +2,25 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "visible-content": "awsui_visible-content_tc96w_mj68r_185",
6
- "visible-content-toggle": "awsui_visible-content-toggle_tc96w_mj68r_186",
7
- "visible-content-groups": "awsui_visible-content-groups_tc96w_mj68r_187",
8
- "visible-content-group": "awsui_visible-content-group_tc96w_mj68r_187",
9
- "visible-content-title": "awsui_visible-content-title_tc96w_mj68r_192",
10
- "visible-content-group-label": "awsui_visible-content-group-label_tc96w_mj68r_200",
11
- "visible-content-option": "awsui_visible-content-option_tc96w_mj68r_206",
12
- "visible-content-option-label": "awsui_visible-content-option-label_tc96w_mj68r_217",
13
- "root": "awsui_root_tc96w_mj68r_224",
14
- "modal-root": "awsui_modal-root_tc96w_mj68r_225",
15
- "trigger-button": "awsui_trigger-button_tc96w_mj68r_226",
16
- "cancel-button": "awsui_cancel-button_tc96w_mj68r_227",
17
- "confirm-button": "awsui_confirm-button_tc96w_mj68r_228",
18
- "custom": "awsui_custom_tc96w_mj68r_229",
19
- "second-column-small": "awsui_second-column-small_tc96w_mj68r_233",
20
- "wrap-lines": "awsui_wrap-lines_tc96w_mj68r_237",
21
- "page-size": "awsui_page-size_tc96w_mj68r_238",
22
- "page-size-form-field": "awsui_page-size-form-field_tc96w_mj68r_239",
23
- "page-size-radio-group": "awsui_page-size-radio-group_tc96w_mj68r_240"
5
+ "visible-content": "awsui_visible-content_tc96w_rdaxh_185",
6
+ "visible-content-toggle": "awsui_visible-content-toggle_tc96w_rdaxh_186",
7
+ "visible-content-groups": "awsui_visible-content-groups_tc96w_rdaxh_187",
8
+ "visible-content-group": "awsui_visible-content-group_tc96w_rdaxh_187",
9
+ "visible-content-title": "awsui_visible-content-title_tc96w_rdaxh_192",
10
+ "visible-content-group-label": "awsui_visible-content-group-label_tc96w_rdaxh_200",
11
+ "visible-content-option": "awsui_visible-content-option_tc96w_rdaxh_206",
12
+ "visible-content-option-label": "awsui_visible-content-option-label_tc96w_rdaxh_217",
13
+ "root": "awsui_root_tc96w_rdaxh_224",
14
+ "modal-root": "awsui_modal-root_tc96w_rdaxh_225",
15
+ "trigger-button": "awsui_trigger-button_tc96w_rdaxh_226",
16
+ "cancel-button": "awsui_cancel-button_tc96w_rdaxh_227",
17
+ "confirm-button": "awsui_confirm-button_tc96w_rdaxh_228",
18
+ "custom": "awsui_custom_tc96w_rdaxh_229",
19
+ "second-column-small": "awsui_second-column-small_tc96w_rdaxh_233",
20
+ "wrap-lines": "awsui_wrap-lines_tc96w_rdaxh_237",
21
+ "striped-rows": "awsui_striped-rows_tc96w_rdaxh_238",
22
+ "page-size": "awsui_page-size_tc96w_rdaxh_239",
23
+ "page-size-form-field": "awsui_page-size-form-field_tc96w_rdaxh_240",
24
+ "page-size-radio-group": "awsui_page-size-radio-group_tc96w_rdaxh_241"
24
25
  };
25
26
 
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { CollectionPreferencesProps } from './interfaces';
3
- export declare const copyPreferences: ({ pageSize, wrapLines, visibleContent, custom, }: CollectionPreferencesProps.Preferences) => CollectionPreferencesProps.Preferences;
3
+ export declare const copyPreferences: ({ pageSize, wrapLines, stripedRows, visibleContent, custom, }: CollectionPreferencesProps.Preferences) => CollectionPreferencesProps.Preferences;
4
4
  export declare const mergePreferences: (newPref: CollectionPreferencesProps.Preferences, oldPref: CollectionPreferencesProps.Preferences) => CollectionPreferencesProps.Preferences;
5
5
  interface ModalContentLayoutProps {
6
6
  left: React.ReactNode;
@@ -17,6 +17,11 @@ interface WrapLinesPreferenceProps extends CollectionPreferencesProps.WrapLinesP
17
17
  value?: boolean;
18
18
  }
19
19
  export declare const WrapLinesPreference: ({ label, description, value, onChange }: WrapLinesPreferenceProps) => JSX.Element;
20
+ interface StripedRowsPreferenceProps extends CollectionPreferencesProps.StripedRowsPreference {
21
+ onChange: (value: boolean) => void;
22
+ value?: boolean;
23
+ }
24
+ export declare const StripedRowsPreference: ({ label, description, value, onChange }: StripedRowsPreferenceProps) => JSX.Element;
20
25
  interface CustomPreferenceProps<T = any> extends Pick<CollectionPreferencesProps<T>, 'customPreference'> {
21
26
  onChange: (value: T) => void;
22
27
  value: T;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/collection-preferences/utils.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAMxC,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAG1D,eAAO,MAAM,eAAe,qDAKzB,2BAA2B,WAAW,KAAG,2BAA2B,WAKrE,CAAC;AAEH,eAAO,MAAM,gBAAgB,YAClB,2BAA2B,WAAW,WACtC,2BAA2B,WAAW,KAC9C,2BAA2B,WAK5B,CAAC;AAEH,UAAU,uBAAuB;IAC/B,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;CACxB;AAED,eAAO,MAAM,kBAAkB,oBAAqB,uBAAuB,gBAsB1E,CAAC;AAEF,UAAU,uBAAwB,SAAQ,0BAA0B,CAAC,kBAAkB;IACrF,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,kBAAkB,wCAAyC,uBAAuB,gBAW9F,CAAC;AAEF,UAAU,wBAAyB,SAAQ,0BAA0B,CAAC,mBAAmB;IACvF,QAAQ,EAAE,CAAC,KAA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AC;IACnC,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,eAAO,MAAM,mBAAmB,4CAA6C,wBAAwB,gBASpG,CAAC;AAEF,UAAU,0BAA2B,SAAQ,0BAA0B,CAAC,qBAAqB;IAC3F,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACnC,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,eAAO,MAAM,qBAAqB,4CAA6C,0BAA0B,gBASxG,CAAC;AAEF,UAAU,qBAAqB,CAAC,CAAC,GAAG,GAAG,CAAE,SAAQ,IAAI,CAAC,0BAA0B,CAAC,CAAC,CAAC,EAAE,kBAAkB,CAAC;IACtG,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAC7B,KAAK,EAAE,CAAC,CAAC;CACV;AACD,eAAO,MAAM,gBAAgB,0CAA2C,qBAAqB,uBAc5F,CAAC"}
@@ -8,10 +8,11 @@ import InternalRadioGroup from '../radio-group/internal';
8
8
  import { useContainerBreakpoints } from '../internal/hooks/container-queries';
9
9
  import styles from './styles.css.js';
10
10
  export var copyPreferences = function (_a) {
11
- var pageSize = _a.pageSize, wrapLines = _a.wrapLines, visibleContent = _a.visibleContent, custom = _a.custom;
11
+ var pageSize = _a.pageSize, wrapLines = _a.wrapLines, stripedRows = _a.stripedRows, visibleContent = _a.visibleContent, custom = _a.custom;
12
12
  return ({
13
13
  pageSize: pageSize,
14
14
  wrapLines: wrapLines,
15
+ stripedRows: stripedRows,
15
16
  visibleContent: visibleContent,
16
17
  custom: custom
17
18
  });
@@ -19,6 +20,7 @@ export var copyPreferences = function (_a) {
19
20
  export var mergePreferences = function (newPref, oldPref) { return ({
20
21
  pageSize: newPref.pageSize !== undefined ? newPref.pageSize : oldPref.pageSize,
21
22
  wrapLines: newPref.wrapLines !== undefined ? newPref.wrapLines : oldPref.wrapLines,
23
+ stripedRows: newPref.stripedRows !== undefined ? newPref.stripedRows : oldPref.stripedRows,
22
24
  visibleContent: newPref.visibleContent !== undefined ? newPref.visibleContent : oldPref.visibleContent,
23
25
  custom: newPref.custom !== undefined ? newPref.custom : oldPref.custom
24
26
  }); };
@@ -56,6 +58,13 @@ export var WrapLinesPreference = function (_a) {
56
58
  return onChange(detail.checked);
57
59
  }, className: styles['wrap-lines'] }, label));
58
60
  };
61
+ export var StripedRowsPreference = function (_a) {
62
+ var label = _a.label, description = _a.description, value = _a.value, onChange = _a.onChange;
63
+ return (React.createElement(InternalCheckbox, { checked: !!value, description: description, onChange: function (_a) {
64
+ var detail = _a.detail;
65
+ return onChange(detail.checked);
66
+ }, className: styles['striped-rows'] }, label));
67
+ };
59
68
  export var CustomPreference = function (_a) {
60
69
  var value = _a.value, customPreference = _a.customPreference, onChange = _a.onChange;
61
70
  var _b = useState(value), customState = _b[0], setCustomState = _b[1];
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/collection-preferences/utils.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,gBAAgB,MAAM,sBAAsB,CAAC;AACpD,OAAO,oBAAoB,MAAM,2BAA2B,CAAC;AAC7D,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AACvD,OAAO,kBAAkB,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAE9E,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,MAAM,CAAC,IAAM,eAAe,GAAG,UAAC,EAKS;QAJvC,QAAQ,cAAA,EACR,SAAS,eAAA,EACT,cAAc,oBAAA,EACd,MAAM,YAAA;IAC8E,OAAA,CAAC;QACrF,QAAQ,UAAA;QACR,SAAS,WAAA;QACT,cAAc,gBAAA;QACd,MAAM,QAAA;KACP,CAAC;AALoF,CAKpF,CAAC;AAEH,MAAM,CAAC,IAAM,gB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MAAM,CAAC,YAAY,CAAC,IAE9B,KAAK,CACW,CACpB;AATyG,CASzG,CAAC;AAMF,MAAM,CAAC,IAAM,gBAAgB,GAAG,UAAC,EAA4D;QAA1D,KAAK,WAAA,EAAE,gBAAgB,sBAAA,EAAE,QAAQ,cAAA;IAC5D,IAAA,KAAgC,QAAQ,CAAC,KAAK,CAAC,EAA9C,WAAW,QAAA,EAAE,cAAc,QAAmB,CAAC;IACtD,IAAI,gBAAgB,EAAE;QACpB,OAAO,CACL,6BAAK,SAAS,EAAE,MAAM,CAAC,MAAM,IAC1B,gBAAgB,CAAC,WAAW,EAAE,UAAA,KAAK;YAClC,uDAAuD;YACvD,cAAc,CAAC,cAAM,OAAA,KAAK,EAAL,CAAK,CAAC,CAAC;YAC5B,QAAQ,CAAC,KAAK,CAAC,CAAC;QAClB,CAAC,CAAC,CACE,CACP,CAAC;KACH;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useState } from 'react';\nimport InternalCheckbox from '../checkbox/internal';\nimport InternalColumnLayout from '../column-layout/internal';\nimport InternalFormField from '../form-field/internal';\nimport InternalRadioGroup from '../radio-group/internal';\nimport { useContainerBreakpoints } from '../internal/hooks/container-queries';\nimport { CollectionPreferencesProps } from './interfaces';\nimport styles from './styles.css.js';\n\nexport const copyPreferences = ({\n pageSize,\n wrapLines,\n visibleContent,\n custom,\n}: CollectionPreferencesProps.Preferences): CollectionPreferencesProps.Preferences => ({\n pageSize,\n wrapLines,\n visibleContent,\n custom,\n});\n\nexport const mergePreferences = (\n newPref: CollectionPreferencesProps.Preferences,\n oldPref: CollectionPreferencesProps.Preferences\n): CollectionPreferencesProps.Preferences => ({\n pageSize: newPref.pageSize !== undefined ? newPref.pageSize : oldPref.pageSize,\n wrapLines: newPref.wrapLines !== undefined ? newPref.wrapLines : oldPref.wrapLines,\n visibleContent: newPref.visibleContent !== undefined ? newPref.visibleContent : oldPref.visibleContent,\n custom: newPref.custom !== undefined ? newPref.custom : oldPref.custom,\n});\n\ninterface ModalContentLayoutProps {\n left: React.ReactNode;\n right: React.ReactNode;\n}\n\nexport const ModalContentLayout = ({ left, right }: ModalContentLayoutProps) => {\n const [breakpoint, ref] = useContainerBreakpoints(['xs']);\n const smallContainer = breakpoint === 'default';\n\n if (smallContainer) {\n return (\n <div ref={ref}>\n <div>{left}</div>\n {right && <div className={styles['second-column-small']}>{right}</div>}\n </div>\n );\n }\n\n const columns = right ? 2 : 1;\n return (\n <div ref={ref}>\n <InternalColumnLayout columns={columns} variant=\"text-grid\">\n <div>{left}</div>\n {right && <div>{right}</div>}\n </InternalColumnLayout>\n </div>\n );\n};\n\ninterface PageSizePreferenceProps extends CollectionPreferencesProps.PageSizePreference {\n onChange: (value: number) => void;\n value?: number;\n}\n\nexport const PageSizePreference = ({ title, options, value, onChange }: PageSizePreferenceProps) => (\n <div className={styles['page-size']}>\n <InternalFormField label={title} stretch={true} className={styles['page-size-form-field']}>\n <InternalRadioGroup\n className={styles['page-size-radio-group']}\n value={`${value}`}\n items={options.map(({ label, value }) => ({ label, value: `${value}` }))}\n onChange={({ detail }) => onChange(parseInt(detail.value, 10))}\n />\n </InternalFormField>\n </div>\n);\n\ninterface WrapLinesPreferenceProps extends CollectionPreferencesProps.WrapLinesPreference {\n onChange: (value: boolean) => void;\n value?: boolean;\n}\n\nexport const WrapLinesPreference = ({ label, description, value, onChange }: WrapLinesPreferenceProps) => (\n <InternalCheckbox\n checked={!!value}\n description={description}\n onChange={({ detail }) => onChange(detail.checked)}\n className={styles['wrap-lines']}\n >\n {label}\n </InternalCheckbox>\n);\n\ninterface CustomPreferenceProps<T = any> extends Pick<CollectionPreferencesProps<T>, 'customPreference'> {\n onChange: (value: T) => void;\n value: T;\n}\nexport const CustomPreference = ({ value, customPreference, onChange }: CustomPreferenceProps) => {\n const [customState, setCustomState] = useState(value);\n if (customPreference) {\n return (\n <div className={styles.custom}>\n {customPreference(customState, value => {\n // prevent value to be treated as a functional callback\n setCustomState(() => value);\n onChange(value);\n })}\n </div>\n );\n }\n return null;\n};\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/collection-preferences/utils.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,gBAAgB,MAAM,sBAAsB,CAAC;AACpD,OAAO,oBAAoB,MAAM,2BAA2B,CAAC;AAC7D,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AACvD,OAAO,kBAAkB,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAE9E,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,MAAM,CAAC,IAAM,eAAe,GAAG,UAAC,EAMS;QALvC,QAAQ,cAAA,EACR,SAAS,eAAA,EACT,WAAW,iBAAA,EACX,cAAc,oBAAA,EACd,MAAM,YAAA;IAC8E,OAAA,CAAC;QACrF,QAAQ,UAAA;QACR,SAAS,WAAA;QACT,WAAW,aAAA;QACX,cAAc,gBAAA;QACd,MAAM,QAAA;KACP,CAAC;AANoF,CAMpF,CAAC;AAEH,MAAM,CAAC,IAAM,gBAAgB,GAAG,UAC9B,OAA+C,EAC/C,OAA+C,IACJ,OAAA,CAAC;IAC5C,QAAQ,EAAE,OAAO,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ;IAC9E,SAAS,EAAE,OAAO,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS;IAClF,WAAW,EAAE,OAAO,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,CA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AAE,WAAW,EACxB,QAAQ,EAAE,UAAC,EAAU;gBAAR,MAAM,YAAA;YAAO,OAAA,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC;QAAxB,CAAwB,EAClD,SAAS,EAAE,MAAM,CAAC,cAAc,CAAC,IAEhC,KAAK,CACW,CACpB;AAT6G,CAS7G,CAAC;AAMF,MAAM,CAAC,IAAM,gBAAgB,GAAG,UAAC,EAA4D;QAA1D,KAAK,WAAA,EAAE,gBAAgB,sBAAA,EAAE,QAAQ,cAAA;IAC5D,IAAA,KAAgC,QAAQ,CAAC,KAAK,CAAC,EAA9C,WAAW,QAAA,EAAE,cAAc,QAAmB,CAAC;IACtD,IAAI,gBAAgB,EAAE;QACpB,OAAO,CACL,6BAAK,SAAS,EAAE,MAAM,CAAC,MAAM,IAC1B,gBAAgB,CAAC,WAAW,EAAE,UAAA,KAAK;YAClC,uDAAuD;YACvD,cAAc,CAAC,cAAM,OAAA,KAAK,EAAL,CAAK,CAAC,CAAC;YAC5B,QAAQ,CAAC,KAAK,CAAC,CAAC;QAClB,CAAC,CAAC,CACE,CACP,CAAC;KACH;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useState } from 'react';\nimport InternalCheckbox from '../checkbox/internal';\nimport InternalColumnLayout from '../column-layout/internal';\nimport InternalFormField from '../form-field/internal';\nimport InternalRadioGroup from '../radio-group/internal';\nimport { useContainerBreakpoints } from '../internal/hooks/container-queries';\nimport { CollectionPreferencesProps } from './interfaces';\nimport styles from './styles.css.js';\n\nexport const copyPreferences = ({\n pageSize,\n wrapLines,\n stripedRows,\n visibleContent,\n custom,\n}: CollectionPreferencesProps.Preferences): CollectionPreferencesProps.Preferences => ({\n pageSize,\n wrapLines,\n stripedRows,\n visibleContent,\n custom,\n});\n\nexport const mergePreferences = (\n newPref: CollectionPreferencesProps.Preferences,\n oldPref: CollectionPreferencesProps.Preferences\n): CollectionPreferencesProps.Preferences => ({\n pageSize: newPref.pageSize !== undefined ? newPref.pageSize : oldPref.pageSize,\n wrapLines: newPref.wrapLines !== undefined ? newPref.wrapLines : oldPref.wrapLines,\n stripedRows: newPref.stripedRows !== undefined ? newPref.stripedRows : oldPref.stripedRows,\n visibleContent: newPref.visibleContent !== undefined ? newPref.visibleContent : oldPref.visibleContent,\n custom: newPref.custom !== undefined ? newPref.custom : oldPref.custom,\n});\n\ninterface ModalContentLayoutProps {\n left: React.ReactNode;\n right: React.ReactNode;\n}\n\nexport const ModalContentLayout = ({ left, right }: ModalContentLayoutProps) => {\n const [breakpoint, ref] = useContainerBreakpoints(['xs']);\n const smallContainer = breakpoint === 'default';\n\n if (smallContainer) {\n return (\n <div ref={ref}>\n <div>{left}</div>\n {right && <div className={styles['second-column-small']}>{right}</div>}\n </div>\n );\n }\n\n const columns = right ? 2 : 1;\n return (\n <div ref={ref}>\n <InternalColumnLayout columns={columns} variant=\"text-grid\">\n <div>{left}</div>\n {right && <div>{right}</div>}\n </InternalColumnLayout>\n </div>\n );\n};\n\ninterface PageSizePreferenceProps extends CollectionPreferencesProps.PageSizePreference {\n onChange: (value: number) => void;\n value?: number;\n}\n\nexport const PageSizePreference = ({ title, options, value, onChange }: PageSizePreferenceProps) => (\n <div className={styles['page-size']}>\n <InternalFormField label={title} stretch={true} className={styles['page-size-form-field']}>\n <InternalRadioGroup\n className={styles['page-size-radio-group']}\n value={`${value}`}\n items={options.map(({ label, value }) => ({ label, value: `${value}` }))}\n onChange={({ detail }) => onChange(parseInt(detail.value, 10))}\n />\n </InternalFormField>\n </div>\n);\n\ninterface WrapLinesPreferenceProps extends CollectionPreferencesProps.WrapLinesPreference {\n onChange: (value: boolean) => void;\n value?: boolean;\n}\n\nexport const WrapLinesPreference = ({ label, description, value, onChange }: WrapLinesPreferenceProps) => (\n <InternalCheckbox\n checked={!!value}\n description={description}\n onChange={({ detail }) => onChange(detail.checked)}\n className={styles['wrap-lines']}\n >\n {label}\n </InternalCheckbox>\n);\n\ninterface StripedRowsPreferenceProps extends CollectionPreferencesProps.StripedRowsPreference {\n onChange: (value: boolean) => void;\n value?: boolean;\n}\n\nexport const StripedRowsPreference = ({ label, description, value, onChange }: StripedRowsPreferenceProps) => (\n <InternalCheckbox\n checked={!!value}\n description={description}\n onChange={({ detail }) => onChange(detail.checked)}\n className={styles['striped-rows']}\n >\n {label}\n </InternalCheckbox>\n);\n\ninterface CustomPreferenceProps<T = any> extends Pick<CollectionPreferencesProps<T>, 'customPreference'> {\n onChange: (value: T) => void;\n value: T;\n}\nexport const CustomPreference = ({ value, customPreference, onChange }: CustomPreferenceProps) => {\n const [customState, setCustomState] = useState(value);\n if (customPreference) {\n return (\n <div className={styles.custom}>\n {customPreference(customState, value => {\n // prevent value to be treated as a functional callback\n setCustomState(() => value);\n onChange(value);\n })}\n </div>\n );\n }\n return null;\n};\n"]}
@@ -165,6 +165,7 @@
165
165
  --color-background-button-primary-disabled-2xivjm:#ffffff;
166
166
  --color-background-button-primary-hover-qli9yh:#0a4a74;
167
167
  --color-background-calendar-today-wm2baz:#f2f3f3;
168
+ --color-background-cell-shaded-y6pwcp:#f2f3f3;
168
169
  --color-background-code-editor-gutter-active-line-default-iqj33p:#687078;
169
170
  --color-background-code-editor-gutter-active-line-error-stt57c:#d13212;
170
171
  --color-background-code-editor-gutter-default-jzy459:#f2f3f3;
@@ -738,6 +739,7 @@
738
739
  --color-background-button-primary-disabled-2xivjm:#2a2e33;
739
740
  --color-background-button-primary-hover-qli9yh:#00a1c9;
740
741
  --color-background-calendar-today-wm2baz:#16191f;
742
+ --color-background-cell-shaded-y6pwcp:#16191f;
741
743
  --color-background-code-editor-gutter-active-line-default-iqj33p:#879596;
742
744
  --color-background-code-editor-gutter-active-line-error-stt57c:#ff5d64;
743
745
  --color-background-code-editor-gutter-default-jzy459:#21252c;
@@ -968,6 +970,7 @@
968
970
  --color-background-button-primary-disabled-2xivjm:#2a2e33;
969
971
  --color-background-button-primary-hover-qli9yh:#00a1c9;
970
972
  --color-background-calendar-today-wm2baz:#16191f;
973
+ --color-background-cell-shaded-y6pwcp:#16191f;
971
974
  --color-background-code-editor-gutter-active-line-default-iqj33p:#879596;
972
975
  --color-background-code-editor-gutter-active-line-error-stt57c:#ff5d64;
973
976
  --color-background-code-editor-gutter-default-jzy459:#21252c;
@@ -1143,6 +1146,7 @@
1143
1146
  --color-background-button-primary-disabled-2xivjm:#e9ebed;
1144
1147
  --color-background-button-primary-hover-qli9yh:#033160;
1145
1148
  --color-background-calendar-today-wm2baz:#f4f4f4;
1149
+ --color-background-cell-shaded-y6pwcp:#f8f8f8;
1146
1150
  --color-background-code-editor-gutter-active-line-default-iqj33p:#5f6b7a;
1147
1151
  --color-background-code-editor-gutter-active-line-error-stt57c:#d91515;
1148
1152
  --color-background-code-editor-gutter-default-jzy459:#f4f4f4;
@@ -1469,6 +1473,7 @@
1469
1473
  --color-background-button-primary-disabled-2xivjm:#354150;
1470
1474
  --color-background-button-primary-hover-qli9yh:#89bdee;
1471
1475
  --color-background-calendar-today-wm2baz:#354150;
1476
+ --color-background-cell-shaded-y6pwcp:#232f3e;
1472
1477
  --color-background-code-editor-gutter-active-line-default-iqj33p:#7d8998;
1473
1478
  --color-background-code-editor-gutter-active-line-error-stt57c:#eb6f6f;
1474
1479
  --color-background-code-editor-gutter-default-jzy459:#192534;
@@ -1676,6 +1681,7 @@
1676
1681
  --color-background-button-primary-disabled-2xivjm:#354150;
1677
1682
  --color-background-button-primary-hover-qli9yh:#89bdee;
1678
1683
  --color-background-calendar-today-wm2baz:#354150;
1684
+ --color-background-cell-shaded-y6pwcp:#232f3e;
1679
1685
  --color-background-code-editor-gutter-active-line-default-iqj33p:#7d8998;
1680
1686
  --color-background-code-editor-gutter-active-line-error-stt57c:#eb6f6f;
1681
1687
  --color-background-code-editor-gutter-default-jzy459:#192534;
@@ -1852,6 +1858,7 @@
1852
1858
  --color-background-button-primary-disabled-2xivjm:#354150;
1853
1859
  --color-background-button-primary-hover-qli9yh:#89bdee;
1854
1860
  --color-background-calendar-today-wm2baz:#354150;
1861
+ --color-background-cell-shaded-y6pwcp:#232f3e;
1855
1862
  --color-background-code-editor-gutter-active-line-default-iqj33p:#7d8998;
1856
1863
  --color-background-code-editor-gutter-active-line-error-stt57c:#eb6f6f;
1857
1864
  --color-background-code-editor-gutter-default-jzy459:#192534;
@@ -2022,6 +2029,7 @@
2022
2029
  --color-background-button-primary-disabled-2xivjm:#354150;
2023
2030
  --color-background-button-primary-hover-qli9yh:#89bdee;
2024
2031
  --color-background-calendar-today-wm2baz:#354150;
2032
+ --color-background-cell-shaded-y6pwcp:#232f3e;
2025
2033
  --color-background-code-editor-gutter-active-line-default-iqj33p:#7d8998;
2026
2034
  --color-background-code-editor-gutter-active-line-error-stt57c:#eb6f6f;
2027
2035
  --color-background-code-editor-gutter-default-jzy459:#192534;
@@ -2201,6 +2209,7 @@
2201
2209
  --color-background-button-primary-disabled-2xivjm:#354150;
2202
2210
  --color-background-button-primary-hover-qli9yh:#89bdee;
2203
2211
  --color-background-calendar-today-wm2baz:#354150;
2212
+ --color-background-cell-shaded-y6pwcp:#232f3e;
2204
2213
  --color-background-code-editor-gutter-active-line-default-iqj33p:#7d8998;
2205
2214
  --color-background-code-editor-gutter-active-line-error-stt57c:#eb6f6f;
2206
2215
  --color-background-code-editor-gutter-default-jzy459:#192534;
@@ -1,8 +1,9 @@
1
1
  import React from 'react';
2
+ import { Offset } from '../interfaces';
2
3
  export interface FocusOutlineProps {
3
4
  elementKey?: null | string | number | boolean;
4
5
  elementRef?: React.RefObject<SVGSVGElement | SVGGElement>;
5
- offset?: number;
6
+ offset?: Offset;
6
7
  }
7
8
  export default function FocusOutline({ elementKey, elementRef, offset }: FocusOutlineProps): JSX.Element;
8
9
  //# sourceMappingURL=focus-outline.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"focus-outline.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/chart-plot/focus-outline.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAKjD,MAAM,WAAW,iBAAiB;IAChC,UAAU,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;IAC9C,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,aAAa,GAAG,WAAW,CAAC,CAAC;IAC1D,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,MAAU,EAAE,EAAE,iBAAiB,eAkB7F"}
1
+ {"version":3,"file":"focus-outline.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/chart-plot/focus-outline.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAIjD,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,MAAM,WAAW,iBAAiB;IAChC,UAAU,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;IAC9C,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,aAAa,GAAG,WAAW,CAAC,CAAC;IAC1D,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,MAAU,EAAE,EAAE,iBAAiB,eAkB7F"}
@@ -22,10 +22,12 @@ export default function FocusOutline(_a) {
22
22
  return React.createElement("rect", { ref: ref, "aria-hidden": "true", className: styles['focus-outline'], rx: "2" });
23
23
  }
24
24
  function showOutline(el, position, offset) {
25
- el.setAttribute('x', (position.x - offset).toString());
26
- el.setAttribute('y', (position.y - offset).toString());
27
- el.setAttribute('width', (position.width + 2 * offset).toString());
28
- el.setAttribute('height', (position.height + 2 * offset).toString());
25
+ var offsetX = typeof offset === 'number' ? offset : offset.x;
26
+ var offsetY = typeof offset === 'number' ? offset : offset.y;
27
+ el.setAttribute('x', (position.x - offsetX).toString());
28
+ el.setAttribute('y', (position.y - offsetY).toString());
29
+ el.setAttribute('width', (position.width + 2 * offsetX).toString());
30
+ el.setAttribute('height', (position.height + 2 * offsetY).toString());
29
31
  el.style.visibility = 'visible';
30
32
  }
31
33
  function hideOutline(el) {
@@ -1 +1 @@
1
- {"version":3,"file":"focus-outline.js","sourceRoot":"","sources":["../../../../../src/internal/components/chart-plot/focus-outline.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEjD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAQ9D,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EAAyD;QAAvD,UAAU,gBAAA,EAAE,UAAU,gBAAA,EAAE,cAAU,EAAV,MAAM,mBAAG,CAAC,KAAA;IACvE,IAAM,GAAG,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IACjC,IAA4B,YAAY,GAAK,eAAe,EAAE,4BAAtB,CAAuB;IAEvE,SAAS,CAAC;QACR,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE;YAChB,OAAO;SACR;QAED,IAAI,YAAY,IAAI,UAAU,IAAI,UAAU,IAAI,UAAU,CAAC,OAAO,IAAI,UAAU,CAAC,OAAO,CAAC,OAAO,EAAE;YAChG,IAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;YAC7C,WAAW,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;SAC3C;aAAM;YACL,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;SAC1B;IACH,CAAC,EAAE,CAAC,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;IAEnD,OAAO,8BAAM,GAAG,EAAE,GAAG,iBAAc,MAAM,EAAC,SAAS,EAAE,MAAM,CAAC,eAAe,CAAC,EAAE,EAAE,EAAC,GAAG,GAAG,CAAC;AAC1F,CAAC;AAED,SAAS,WAAW,CAClB,EAAkB,EAClB,QAAiE,EACjE,MAAc;IAEd,EAAE,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;IACvD,EAAE,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;IACvD,EAAE,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,KAAK,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;IACnE,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;IACrE,EAAE,CAAC,KAAK,CAAC,UAAU,GAAG,SAAS,CAAC;AAClC,CAAC;AAED,SAAS,WAAW,CAAC,EAAkB;IACrC,EAAE,CAAC,KAAK,CAAC,UAAU,GAAG,QAAQ,CAAC;IAC/B,EAAE,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;IACxB,EAAE,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;IACxB,EAAE,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IAC5B,EAAE,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;AAC/B,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef } from 'react';\n\nimport styles from './styles.css.js';\nimport useFocusVisible from '../../hooks/focus-visible/index';\n\nexport interface FocusOutlineProps {\n elementKey?: null | string | number | boolean;\n elementRef?: React.RefObject<SVGSVGElement | SVGGElement>;\n offset?: number;\n}\n\nexport default function FocusOutline({ elementKey, elementRef, offset = 0 }: FocusOutlineProps) {\n const ref = useRef<SVGRectElement>(null);\n const { 'data-awsui-focus-visible': focusVisible } = useFocusVisible();\n\n useEffect(() => {\n if (!ref.current) {\n return;\n }\n\n if (focusVisible && elementKey && elementRef && elementRef.current && elementRef.current.getBBox) {\n const element = elementRef.current.getBBox();\n showOutline(ref.current, element, offset);\n } else {\n hideOutline(ref.current);\n }\n }, [focusVisible, elementKey, elementRef, offset]);\n\n return <rect ref={ref} aria-hidden=\"true\" className={styles['focus-outline']} rx=\"2\" />;\n}\n\nfunction showOutline(\n el: SVGRectElement,\n position: { x: number; y: number; width: number; height: number },\n offset: number\n) {\n el.setAttribute('x', (position.x - offset).toString());\n el.setAttribute('y', (position.y - offset).toString());\n el.setAttribute('width', (position.width + 2 * offset).toString());\n el.setAttribute('height', (position.height + 2 * offset).toString());\n el.style.visibility = 'visible';\n}\n\nfunction hideOutline(el: SVGRectElement) {\n el.style.visibility = 'hidden';\n el.removeAttribute('x');\n el.removeAttribute('y');\n el.removeAttribute('width');\n el.removeAttribute('height');\n}\n"]}
1
+ {"version":3,"file":"focus-outline.js","sourceRoot":"","sources":["../../../../../src/internal/components/chart-plot/focus-outline.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEjD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAS9D,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EAAyD;QAAvD,UAAU,gBAAA,EAAE,UAAU,gBAAA,EAAE,cAAU,EAAV,MAAM,mBAAG,CAAC,KAAA;IACvE,IAAM,GAAG,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IACjC,IAA4B,YAAY,GAAK,eAAe,EAAE,4BAAtB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,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;IACpE,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;IACtE,EAAE,CAAC,KAAK,CAAC,UAAU,GAAG,SAAS,CAAC;AAClC,CAAC;AAED,SAAS,WAAW,CAAC,EAAkB;IACrC,EAAE,CAAC,KAAK,CAAC,UAAU,GAAG,QAAQ,CAAC;IAC/B,EAAE,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;IACxB,EAAE,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;IACxB,EAAE,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IAC5B,EAAE,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;AAC/B,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef } from 'react';\n\nimport styles from './styles.css.js';\nimport useFocusVisible from '../../hooks/focus-visible/index';\nimport { Offset } from '../interfaces';\n\nexport interface FocusOutlineProps {\n elementKey?: null | string | number | boolean;\n elementRef?: React.RefObject<SVGSVGElement | SVGGElement>;\n offset?: Offset;\n}\n\nexport default function FocusOutline({ elementKey, elementRef, offset = 0 }: FocusOutlineProps) {\n const ref = useRef<SVGRectElement>(null);\n const { 'data-awsui-focus-visible': focusVisible } = useFocusVisible();\n\n useEffect(() => {\n if (!ref.current) {\n return;\n }\n\n if (focusVisible && elementKey && elementRef && elementRef.current && elementRef.current.getBBox) {\n const element = elementRef.current.getBBox();\n showOutline(ref.current, element, offset);\n } else {\n hideOutline(ref.current);\n }\n }, [focusVisible, elementKey, elementRef, offset]);\n\n return <rect ref={ref} aria-hidden=\"true\" className={styles['focus-outline']} rx=\"2\" />;\n}\n\nfunction showOutline(\n el: SVGRectElement,\n position: { x: number; y: number; width: number; height: number },\n offset: Offset\n) {\n const offsetX = typeof offset === 'number' ? offset : offset.x;\n const offsetY = typeof offset === 'number' ? offset : offset.y;\n el.setAttribute('x', (position.x - offsetX).toString());\n el.setAttribute('y', (position.y - offsetY).toString());\n el.setAttribute('width', (position.width + 2 * offsetX).toString());\n el.setAttribute('height', (position.height + 2 * offsetY).toString());\n el.style.visibility = 'visible';\n}\n\nfunction hideOutline(el: SVGRectElement) {\n el.style.visibility = 'hidden';\n el.removeAttribute('x');\n el.removeAttribute('y');\n el.removeAttribute('width');\n el.removeAttribute('height');\n}\n"]}
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import { Offset } from '../interfaces';
2
3
  export interface ChartPlotRef {
3
4
  svg: SVGSVGElement;
4
5
  focusPlot(): void;
@@ -20,7 +21,7 @@ export interface ChartPlotProps {
20
21
  ariaRoleDescription?: string;
21
22
  activeElementKey?: null | string | number | boolean;
22
23
  activeElementRef?: React.RefObject<SVGGElement>;
23
- activeElementFocusOffset?: number;
24
+ activeElementFocusOffset?: Offset;
24
25
  ariaLiveRegion?: React.ReactNode;
25
26
  isClickable?: boolean;
26
27
  isPrecise?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/chart-plot/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAejF,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,aAAa,CAAC;IACnB,SAAS,IAAI,IAAI,CAAC;IAClB,gBAAgB,IAAI,IAAI,CAAC;CAC1B;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,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;gBAC/B,GAAC,MAAM,CAAC,OAAO,IAAG,SAAS;oBAC3B,EACF,WAAW,EAAE,eAAe,EAC5B,OAAO,EAAE,WAAW,EACpB,MAAM,EAAE,UAAU,EAClB,SAAS,EAAE,aAAa;YAExB,oBAAC,YAAY,IAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,EAAE,WAAW,GAAI;YAEpF,2BAAG,SAAS,EAAE,SAAS,EAAE,IAAI,EAAC,OAAO;gBACnC,oBAAC,qBAAqB,IACpB,gBAAgB,EAAE,gBAAgB,IAAI,IAAI,EAC1C,gBAAgB,EAAE,gBAAgB,EAClC,GAAG,EAAE,cAAc,EACnB,OAAO,EAAE,kBAAkB,EAC3B,MAAM,EAAE,iBAAiB,EACzB,SAAS,EAAE,oBAAoB,GAC/B;gBAGD,eAAe,IAAI,aAAa,IAAI,CACnC,6CAAkB,MAAM,EAAC,EAAE,EAAE,qBAAqB,IAC/C,eAAe,CACX,CACR;gBAEA,QAAQ;gBAET,oBAAC,YAAY,IACX,UAAU,EAAE,gBAAgB,EAC5B,UAAU,EAAE,oBAAoB,IAAI,gBAAgB,EACpD,MAAM,EAAE,wBAAwB,GAChC,CACA,CACA;QAEN,oBAAC,UAAU,QAAE,cAAc,CAAc,CACxC,CACJ,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { forwardRef, useImperativeHandle, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport styles from './styles.css.js';\nimport { useUniqueId } from '../../hooks/use-unique-id';\n\nimport { KeyCode } from '../../keycode';\nimport LiveRegion from '../live-region/index';\nimport ApplicationController, { ApplicationRef } from './application-controller';\nimport FocusOutline from './focus-outline';\nimport focusSvgElement from '../../utils/focus-svg-element';\n\nconst DEFAULT_PLOT_FOCUS_OFFSET = 3;\nconst DEFAULT_ELEMENT_FOCUS_OFFSET = 3;\n\nexport interface ChartPlotRef {\n svg: SVGSVGElement;\n focusPlot(): void;\n focusApplication(): void;\n}\n\nexport interface ChartPlotProps {\n width: number;\n height: number;\n transform?: string;\n offsetTop?: number;\n offsetBottom?: number;\n offsetLeft?: number;\n offsetRight?: number;\n focusOffset?: number;\n ariaLabel?: string;\n ariaLabelledby?: string;\n ariaDescription?: string;\n ariaDescribedby?: string;\n ariaRoleDescription?: string;\n activeElementKey?: null | string | number | boolean;\n activeElementRef?: React.RefObject<SVGGElement>;\n activeElementFocusOffset?: number;\n ariaLiveRegion?: React.ReactNode;\n isClickable?: boolean;\n isPrecise?: boolean;\n onMouseDown?: (event: React.MouseEvent<SVGSVGElement>) => void;\n onMouseMove?: (event: React.MouseEvent<SVGSVGElement>) => void;\n onMouseOut?: (event: React.MouseEvent<SVGSVGElement>) => void;\n onFocus?: (event: React.FocusEvent<SVGGElement>, trigger: 'mouse' | 'keyboard') => void;\n onBlur?: (event: React.FocusEvent<SVGGElement>) => void;\n onKeyDown?: (event: React.KeyboardEvent<SVGGElement>) => void;\n children: React.ReactNode;\n}\n\n/**\n An extension for the SVG to be used for charts. It includes a controller element to\n handle the focus and keyboard interactions in a way that is supported by screen readers.\n\n The application mimics the aria-activedescendant behavior which is unsupported by Safari. The\n activeElementRef is the pointer to the secondary-focus element and activeElementKey denotes when\n the focus transition was made.\n\n Alternatively, ariaLiveRegion can be used to make announcements.\n*/\nexport default forwardRef(ChartPlot);\n\nfunction ChartPlot(\n {\n width,\n height,\n transform,\n offsetTop,\n offsetBottom,\n offsetLeft,\n offsetRight,\n ariaLabel,\n ariaLabelledby,\n ariaRoleDescription,\n ariaDescription,\n ariaDescribedby,\n activeElementKey,\n activeElementRef,\n ariaLiveRegion,\n isClickable,\n isPrecise,\n children,\n onMouseDown,\n onKeyDown,\n onFocus,\n onBlur,\n focusOffset = DEFAULT_PLOT_FOCUS_OFFSET,\n activeElementFocusOffset = DEFAULT_ELEMENT_FOCUS_OFFSET,\n ...restProps\n }: ChartPlotProps,\n ref: React.Ref<ChartPlotRef>\n) {\n const svgRef = useRef<SVGSVGElement>(null);\n const applicationRef = useRef<ApplicationRef>(null);\n const plotClickedRef = useRef(false);\n const [isPlotFocused, setPlotFocused] = useState(false);\n const [isApplicationFocused, setApplicationFocused] = useState(false);\n\n const internalDescriptionId = useUniqueId('awsui-chart-plot__description');\n const ariaDescriptionId = [ariaDescription && internalDescriptionId, ariaDescribedby].filter(Boolean).join(' ');\n\n useImperativeHandle(ref, () => ({\n svg: svgRef.current!,\n focusPlot: () => focusSvgElement(svgRef.current!),\n focusApplication: () => applicationRef.current!.focus(),\n }));\n\n const onPlotMouseDown = (event: React.MouseEvent<SVGSVGElement, MouseEvent>) => {\n onMouseDown && onMouseDown(event);\n // Record the click was made for the application focus handler.\n plotClickedRef.current = true;\n };\n const onPlotFocus = (event: React.FocusEvent<SVGSVGElement>) => {\n if (event.target === svgRef.current && !plotClickedRef.current) {\n setPlotFocused(true);\n }\n // The click should focus the underling application bypassing the svg.\n else if (plotClickedRef.current) {\n applicationRef.current!.focus();\n }\n };\n const onPlotBlur = (event: React.FocusEvent<SVGSVGElement>) => {\n if (event.target === svgRef.current) {\n setPlotFocused(false);\n }\n };\n // Once one of the expected keys is pressed the focus is delegated to the application controller.\n const onPlotKeyDown = (event: React.KeyboardEvent) => {\n if (isPlotFocused) {\n // Delegate the focus to the application if one of the expected keys was pressed.\n const codes = [KeyCode.space, KeyCode.enter, KeyCode.up, KeyCode.left, KeyCode.right, KeyCode.down];\n if (codes.indexOf(event.keyCode) !== -1) {\n applicationRef.current!.focus();\n }\n }\n };\n\n const onApplicationFocus = (event: React.FocusEvent<SVGGElement>) => {\n onFocus && onFocus(event, plotClickedRef.current ? 'mouse' : 'keyboard');\n // \"Release\" the click reference to not affect the next call of this handler.\n plotClickedRef.current = false;\n setApplicationFocused(true);\n };\n const onApplicationBlur = (event: React.FocusEvent<SVGGElement>) => {\n onBlur && onBlur(event);\n setApplicationFocused(false);\n };\n const onApplicationKeyDown = onKeyDown;\n\n const plotFocusable = !isApplicationFocused;\n const plotTabIndex = plotFocusable ? 0 : -1;\n const plotAria = !isApplicationFocused\n ? {\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n 'aria-describedby': ariaDescriptionId,\n 'aria-roledescription': ariaRoleDescription,\n }\n : {};\n\n return (\n <>\n <svg\n {...restProps}\n focusable={plotFocusable}\n tabIndex={plotTabIndex}\n role=\"application\"\n aria-hidden=\"false\"\n {...plotAria}\n ref={svgRef}\n width={width}\n height={height}\n style={{\n marginTop: offsetTop,\n marginBottom: offsetBottom,\n marginLeft: offsetLeft,\n marginRight: offsetRight,\n }}\n className={clsx(styles.root, {\n [styles.clickable]: isClickable,\n [styles.precise]: isPrecise,\n })}\n onMouseDown={onPlotMouseDown}\n onFocus={onPlotFocus}\n onBlur={onPlotBlur}\n onKeyDown={onPlotKeyDown}\n >\n <FocusOutline elementRef={svgRef} elementKey={isPlotFocused} offset={focusOffset} />\n\n <g transform={transform} role=\"group\">\n <ApplicationController\n activeElementKey={activeElementKey || null}\n activeElementRef={activeElementRef}\n ref={applicationRef}\n onFocus={onApplicationFocus}\n onBlur={onApplicationBlur}\n onKeyDown={onApplicationKeyDown}\n />\n\n {/* Only show description when plot is focusable to avoid repetition in Safari and Firefox */}\n {ariaDescription && plotFocusable && (\n <desc aria-hidden=\"true\" id={internalDescriptionId}>\n {ariaDescription}\n </desc>\n )}\n\n {children}\n\n <FocusOutline\n elementRef={activeElementRef}\n elementKey={isApplicationFocused && activeElementKey}\n offset={activeElementFocusOffset}\n />\n </g>\n </svg>\n\n <LiveRegion>{ariaLiveRegion}</LiveRegion>\n </>\n );\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/components/chart-plot/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,O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AEN,oBAAC,UAAU,QAAE,cAAc,CAAc,CACxC,CACJ,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { forwardRef, useImperativeHandle, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport styles from './styles.css.js';\nimport { useUniqueId } from '../../hooks/use-unique-id';\n\nimport { KeyCode } from '../../keycode';\nimport LiveRegion from '../live-region/index';\nimport ApplicationController, { ApplicationRef } from './application-controller';\nimport FocusOutline from './focus-outline';\nimport focusSvgElement from '../../utils/focus-svg-element';\nimport { Offset } from '../interfaces';\n\nconst DEFAULT_PLOT_FOCUS_OFFSET = 3;\nconst DEFAULT_ELEMENT_FOCUS_OFFSET = 3;\n\nexport interface ChartPlotRef {\n svg: SVGSVGElement;\n focusPlot(): void;\n focusApplication(): void;\n}\n\nexport interface ChartPlotProps {\n width: number;\n height: number;\n transform?: string;\n offsetTop?: number;\n offsetBottom?: number;\n offsetLeft?: number;\n offsetRight?: number;\n focusOffset?: number;\n ariaLabel?: string;\n ariaLabelledby?: string;\n ariaDescription?: string;\n ariaDescribedby?: string;\n ariaRoleDescription?: string;\n activeElementKey?: null | string | number | boolean;\n activeElementRef?: React.RefObject<SVGGElement>;\n activeElementFocusOffset?: Offset;\n ariaLiveRegion?: React.ReactNode;\n isClickable?: boolean;\n isPrecise?: boolean;\n onMouseDown?: (event: React.MouseEvent<SVGSVGElement>) => void;\n onMouseMove?: (event: React.MouseEvent<SVGSVGElement>) => void;\n onMouseOut?: (event: React.MouseEvent<SVGSVGElement>) => void;\n onFocus?: (event: React.FocusEvent<SVGGElement>, trigger: 'mouse' | 'keyboard') => void;\n onBlur?: (event: React.FocusEvent<SVGGElement>) => void;\n onKeyDown?: (event: React.KeyboardEvent<SVGGElement>) => void;\n children: React.ReactNode;\n}\n\n/**\n An extension for the SVG to be used for charts. It includes a controller element to\n handle the focus and keyboard interactions in a way that is supported by screen readers.\n\n The application mimics the aria-activedescendant behavior which is unsupported by Safari. The\n activeElementRef is the pointer to the secondary-focus element and activeElementKey denotes when\n the focus transition was made.\n\n Alternatively, ariaLiveRegion can be used to make announcements.\n*/\nexport default forwardRef(ChartPlot);\n\nfunction ChartPlot(\n {\n width,\n height,\n transform,\n offsetTop,\n offsetBottom,\n offsetLeft,\n offsetRight,\n ariaLabel,\n ariaLabelledby,\n ariaRoleDescription,\n ariaDescription,\n ariaDescribedby,\n activeElementKey,\n activeElementRef,\n ariaLiveRegion,\n isClickable,\n isPrecise,\n children,\n onMouseDown,\n onKeyDown,\n onFocus,\n onBlur,\n focusOffset = DEFAULT_PLOT_FOCUS_OFFSET,\n activeElementFocusOffset = DEFAULT_ELEMENT_FOCUS_OFFSET,\n ...restProps\n }: ChartPlotProps,\n ref: React.Ref<ChartPlotRef>\n) {\n const svgRef = useRef<SVGSVGElement>(null);\n const applicationRef = useRef<ApplicationRef>(null);\n const plotClickedRef = useRef(false);\n const [isPlotFocused, setPlotFocused] = useState(false);\n const [isApplicationFocused, setApplicationFocused] = useState(false);\n\n const internalDescriptionId = useUniqueId('awsui-chart-plot__description');\n const ariaDescriptionId = [ariaDescription && internalDescriptionId, ariaDescribedby].filter(Boolean).join(' ');\n\n useImperativeHandle(ref, () => ({\n svg: svgRef.current!,\n focusPlot: () => focusSvgElement(svgRef.current!),\n focusApplication: () => applicationRef.current!.focus(),\n }));\n\n const onPlotMouseDown = (event: React.MouseEvent<SVGSVGElement, MouseEvent>) => {\n onMouseDown && onMouseDown(event);\n // Record the click was made for the application focus handler.\n plotClickedRef.current = true;\n };\n const onPlotFocus = (event: React.FocusEvent<SVGSVGElement>) => {\n if (event.target === svgRef.current && !plotClickedRef.current) {\n setPlotFocused(true);\n }\n // The click should focus the underling application bypassing the svg.\n else if (plotClickedRef.current) {\n applicationRef.current!.focus();\n }\n };\n const onPlotBlur = (event: React.FocusEvent<SVGSVGElement>) => {\n if (event.target === svgRef.current) {\n setPlotFocused(false);\n }\n };\n // Once one of the expected keys is pressed the focus is delegated to the application controller.\n const onPlotKeyDown = (event: React.KeyboardEvent) => {\n if (isPlotFocused) {\n // Delegate the focus to the application if one of the expected keys was pressed.\n const codes = [KeyCode.space, KeyCode.enter, KeyCode.up, KeyCode.left, KeyCode.right, KeyCode.down];\n if (codes.indexOf(event.keyCode) !== -1) {\n applicationRef.current!.focus();\n }\n }\n };\n\n const onApplicationFocus = (event: React.FocusEvent<SVGGElement>) => {\n onFocus && onFocus(event, plotClickedRef.current ? 'mouse' : 'keyboard');\n // \"Release\" the click reference to not affect the next call of this handler.\n plotClickedRef.current = false;\n setApplicationFocused(true);\n };\n const onApplicationBlur = (event: React.FocusEvent<SVGGElement>) => {\n onBlur && onBlur(event);\n setApplicationFocused(false);\n };\n const onApplicationKeyDown = onKeyDown;\n\n const plotFocusable = !isApplicationFocused;\n const plotTabIndex = plotFocusable ? 0 : -1;\n const plotAria = !isApplicationFocused\n ? {\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n 'aria-describedby': ariaDescriptionId,\n 'aria-roledescription': ariaRoleDescription,\n }\n : {};\n\n return (\n <>\n <svg\n {...restProps}\n focusable={plotFocusable}\n tabIndex={plotTabIndex}\n role=\"application\"\n aria-hidden=\"false\"\n {...plotAria}\n ref={svgRef}\n width={width}\n height={height}\n style={{\n marginTop: offsetTop,\n marginBottom: offsetBottom,\n marginLeft: offsetLeft,\n marginRight: offsetRight,\n }}\n className={clsx(styles.root, {\n [styles.clickable]: isClickable,\n [styles.precise]: isPrecise,\n })}\n onMouseDown={onPlotMouseDown}\n onFocus={onPlotFocus}\n onBlur={onPlotBlur}\n onKeyDown={onPlotKeyDown}\n >\n <FocusOutline elementRef={svgRef} elementKey={isPlotFocused} offset={focusOffset} />\n\n <g transform={transform} role=\"group\">\n <ApplicationController\n activeElementKey={activeElementKey || null}\n activeElementRef={activeElementRef}\n ref={applicationRef}\n onFocus={onApplicationFocus}\n onBlur={onApplicationBlur}\n onKeyDown={onApplicationKeyDown}\n />\n\n {/* Only show description when plot is focusable to avoid repetition in Safari and Firefox */}\n {ariaDescription && plotFocusable && (\n <desc aria-hidden=\"true\" id={internalDescriptionId}>\n {ariaDescription}\n </desc>\n )}\n\n {children}\n\n <FocusOutline\n elementRef={activeElementRef}\n elementKey={isApplicationFocused && activeElementKey}\n offset={activeElementFocusOffset}\n />\n </g>\n </svg>\n\n <LiveRegion>{ariaLiveRegion}</LiveRegion>\n </>\n );\n}\n"]}
@@ -0,0 +1,5 @@
1
+ export type Offset = number | {
2
+ x: number;
3
+ y: number;
4
+ };
5
+ //# sourceMappingURL=interfaces.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/chart-plot/interfaces.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,MAAM,GAAG,MAAM,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=interfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../../src/internal/components/chart-plot/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport type Offset = number | { x: number; y: number };\n"]}
@@ -0,0 +1,5 @@
1
+ export type Offset = number | {
2
+ x: number;
3
+ y: number;
4
+ };
5
+ //# sourceMappingURL=interfaces.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../src/internal/components/interfaces.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,MAAM,GAAG,MAAM,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=interfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../src/internal/components/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport type Offset = number | { x: number; y: number };\n"]}
@@ -1,5 +1,5 @@
1
1
 
2
- export var PACKAGE_VERSION = '3.0.0 (308d769)';
2
+ export var PACKAGE_VERSION = '3.0.0 (fe9e4c3)';
3
3
  export var THEME = 'open-source-visual-refresh';
4
4
  export var ALWAYS_VISUAL_REFRESH = true;
5
5