@cloudscape-design/components 3.0.697 → 3.0.698

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 (80) hide show
  1. package/app-layout/internal.d.ts.map +1 -1
  2. package/app-layout/internal.js +2 -2
  3. package/app-layout/internal.js.map +1 -1
  4. package/app-layout/utils/feature-flags.d.ts +2 -0
  5. package/app-layout/utils/feature-flags.d.ts.map +1 -0
  6. package/app-layout/utils/feature-flags.js +5 -0
  7. package/app-layout/utils/feature-flags.js.map +1 -0
  8. package/app-layout/visual-refresh-toolbar/index.js +1 -1
  9. package/app-layout/visual-refresh-toolbar/index.js.map +1 -1
  10. package/app-layout/visual-refresh-toolbar/multi-layout.d.ts.map +1 -1
  11. package/app-layout/visual-refresh-toolbar/multi-layout.js +2 -1
  12. package/app-layout/visual-refresh-toolbar/multi-layout.js.map +1 -1
  13. package/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.d.ts.map +1 -1
  14. package/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.js +1 -4
  15. package/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.js.map +1 -1
  16. package/app-layout/visual-refresh-toolbar/toolbar/index.d.ts.map +1 -1
  17. package/app-layout/visual-refresh-toolbar/toolbar/index.js +4 -1
  18. package/app-layout/visual-refresh-toolbar/toolbar/index.js.map +1 -1
  19. package/drawer/implementation.d.ts.map +1 -1
  20. package/drawer/implementation.js +2 -3
  21. package/drawer/implementation.js.map +1 -1
  22. package/internal/environment.js +1 -1
  23. package/internal/environment.json +1 -1
  24. package/internal/manifest.json +1 -1
  25. package/internal/plugins/helpers/use-global-breadcrumbs.d.ts.map +1 -1
  26. package/internal/plugins/helpers/use-global-breadcrumbs.js +2 -2
  27. package/internal/plugins/helpers/use-global-breadcrumbs.js.map +1 -1
  28. package/package.json +1 -1
  29. package/s3-resource-selector/interfaces.d.ts +1 -0
  30. package/s3-resource-selector/interfaces.d.ts.map +1 -1
  31. package/s3-resource-selector/interfaces.js.map +1 -1
  32. package/s3-resource-selector/s3-modal/basic-table.d.ts +8 -9
  33. package/s3-resource-selector/s3-modal/basic-table.d.ts.map +1 -1
  34. package/s3-resource-selector/s3-modal/basic-table.js +34 -2
  35. package/s3-resource-selector/s3-modal/basic-table.js.map +1 -1
  36. package/s3-resource-selector/s3-modal/styles.css.js +3 -2
  37. package/s3-resource-selector/s3-modal/styles.scoped.css +102 -2
  38. package/s3-resource-selector/s3-modal/styles.selectors.js +3 -2
  39. package/side-navigation/implementation.d.ts.map +1 -1
  40. package/side-navigation/implementation.js +2 -3
  41. package/side-navigation/implementation.js.map +1 -1
  42. package/split-panel/bottom.d.ts.map +1 -1
  43. package/split-panel/bottom.js +3 -3
  44. package/split-panel/bottom.js.map +1 -1
  45. package/split-panel/implementation.d.ts.map +1 -1
  46. package/split-panel/implementation.js +2 -3
  47. package/split-panel/implementation.js.map +1 -1
  48. package/split-panel/side.d.ts.map +1 -1
  49. package/split-panel/side.js +3 -4
  50. package/split-panel/side.js.map +1 -1
  51. package/test-utils/dom/autosuggest/index.js +2 -3
  52. package/test-utils/dom/autosuggest/index.js.map +1 -1
  53. package/test-utils/dom/button-dropdown/index.js +2 -2
  54. package/test-utils/dom/button-dropdown/index.js.map +1 -1
  55. package/test-utils/dom/code-editor/index.js +2 -2
  56. package/test-utils/dom/code-editor/index.js.map +1 -1
  57. package/test-utils/dom/date-range-picker/index.js +2 -2
  58. package/test-utils/dom/date-range-picker/index.js.map +1 -1
  59. package/test-utils/dom/input/base-input.js +4 -3
  60. package/test-utils/dom/input/base-input.js.map +1 -1
  61. package/test-utils/dom/internal/dropdown-host.js +4 -5
  62. package/test-utils/dom/internal/dropdown-host.js.map +1 -1
  63. package/test-utils/dom/prompt-input/index.js +2 -1
  64. package/test-utils/dom/prompt-input/index.js.map +1 -1
  65. package/test-utils/dom/textarea/index.js +2 -1
  66. package/test-utils/dom/textarea/index.js.map +1 -1
  67. package/test-utils/selectors/autosuggest/index.js +2 -0
  68. package/test-utils/selectors/autosuggest/index.js.map +1 -1
  69. package/test-utils/selectors/button-dropdown/index.js +2 -0
  70. package/test-utils/selectors/button-dropdown/index.js.map +1 -1
  71. package/test-utils/selectors/code-editor/index.js +2 -0
  72. package/test-utils/selectors/code-editor/index.js.map +1 -1
  73. package/test-utils/selectors/date-range-picker/index.js +2 -0
  74. package/test-utils/selectors/date-range-picker/index.js.map +1 -1
  75. package/test-utils/selectors/input/base-input.js.map +1 -1
  76. package/test-utils/selectors/internal/dropdown-host.js +2 -0
  77. package/test-utils/selectors/internal/dropdown-host.js.map +1 -1
  78. package/test-utils/selectors/prompt-input/index.js.map +1 -1
  79. package/test-utils/selectors/textarea/index.js.map +1 -1
  80. package/test-utils/tsconfig.tsbuildinfo +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/s3-resource-selector/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\nimport { BaseModalProps } from '../modal/interfaces';\nimport { PaginationProps } from '../pagination/interfaces';\nimport { TableProps } from '../table/interfaces';\n\nexport interface S3ResourceSelectorProps extends BaseComponentProps, BaseModalProps {\n /**\n * Specifies additional information about component status.\n */\n alert?: React.ReactNode;\n\n /**\n * Adds `aria-labelledby` to the component. If you're using this component within a form field,\n * don't set this property because the form field component automatically sets it.\n *\n * Use this property if the component isn't surrounded by a form field, or you want to override the value\n * automatically set by the form field (for example, if you have two components within a single form field).\n *\n * To use it correctly, define an ID for the element you want to use as label and set the property to that ID.\n */\n ariaLabelledby?: string;\n\n /**\n * Adds `aria-describedby` to the component. If you're using this component within a form field,\n * don't set this property because the form field component automatically sets it.\n *\n * Use this property if the component isn't surrounded by a form field, or you want to override the value\n * automatically set by the form field (for example, if you have two components within a single form field).\n *\n * To use it correctly, define an ID for each element that you want to use as a description\n * and set the property to a string of each ID separated by spaces (for example, `\"id1 id2 id3\"`).\n */\n ariaDescribedby?: string;\n\n /**\n * Adds `aria-label` to the component.\n */\n ariaLabel?: string;\n\n /**\n * Adds `aria-labelledby` to the S3 URI input. If you're using this component within a form field,\n * you do not need to set this property, as the form field component will set it automatically.\n *\n * Use this property if the component isn't surrounded by a form field, or you want to override the value\n * automatically set by the form field (for example, if you have two components within a single form field).\n *\n * To use it correctly, define an ID for the element you want to use as label and set the property to that ID.\n */\n inputAriaDescribedby?: string;\n\n /**\n * Adds a placeholder to the S3 URI input.\n */\n inputPlaceholder?: string;\n\n /**\n * An array of the item types that are selectable in the table view. The array may contain the following items:\n * 'buckets', 'objects', or 'versions'. Example: ['buckets', 'objects']. By default, no items are selectable.\n * This property determines whether the component operates in Read mode or Write mode:\n * * Read mode - When 'objects' and 'versions' values are provided (folder selection should be disabled by\n * customizing `objectsIsItemDisabled` function).\n * * Write mode - When 'buckets' and 'objects' values are provided (file selection should be disabled by\n * customizing `objectsIsItemDisabled` function).\n */\n selectableItemsTypes?: ReadonlyArray<S3ResourceSelectorProps.SelectableItems>;\n\n /**\n * Href of the selected object that is applied to the View button.\n */\n viewHref?: string;\n\n /**\n * Whether the S3 URI input field is in invalid state.\n */\n invalid?: boolean;\n\n /**\n * Optionally overrides the set of visible columns in the Buckets view. Available columns: 'Name', 'CreationDate',\n * and 'Region'.\n */\n bucketsVisibleColumns?: ReadonlyArray<string>;\n\n /**\n * Optionally overrides the set of visible columns in the Objects view. Available columns: 'Key', 'LastModified',\n * and 'Size'.\n */\n objectsVisibleColumns?: ReadonlyArray<string>;\n\n /**\n * Optionally overrides the set of visible columns in the Versions view. Available columns: 'ID', 'CreationDate',\n * and 'Size'.\n */\n versionsVisibleColumns?: ReadonlyArray<string>;\n\n /**\n * Optionally overrides whether a bucket should be disabled for selection in the Buckets view or not.\n * It has higher priority than `selectableItemsTypes`. Example: if `selectableItemsTypes` has `['buckets']` value and\n * `bucketsIsItemDisabled` returns false for a bucket, then the bucket is disabled for selection.\n */\n bucketsIsItemDisabled?: (item: S3ResourceSelectorProps.Bucket) => boolean;\n\n /**\n * Optionally overrides whether an object should be disabled for selection in the Objects view or not. Similar to\n * `bucketsIsItemDisabled` this property takes precedence over the `selectableItemsTypes` property.\n */\n objectsIsItemDisabled?: (item: S3ResourceSelectorProps.Object) => boolean;\n\n /**\n * Optionally overrides whether a version should be disabled for selection in the Versions view or not. Similar to\n * `bucketsIsItemDisabled` this property takes precedence over the `selectableItemsTypes` property.\n */\n versionsIsItemDisabled?: (item: S3ResourceSelectorProps.Version) => boolean;\n\n /**\n * The current selected resource. Resource has the following properties:\n * - `uri` (string) - URI of the resource.\n * - `versionId` (string) - (Optional) Version ID of the selected resource.\n */\n resource: S3ResourceSelectorProps.Resource;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n * @i18n\n */\n i18nStrings?: S3ResourceSelectorProps.I18nStrings;\n\n /**\n * Specifies a function that returns all available buckets. The return type of the function should be a promise\n * that resolves to a list of objects with the following properties:\n * - `Name` (string) - Name of the bucket.\n * - `CreationDate` (string) - (Optional) Creation date of the bucket.\n * - `Region` (string) - (Optional) Region of the bucket.\n */\n fetchBuckets: () => Promise<ReadonlyArray<S3ResourceSelectorProps.Bucket>>;\n\n /**\n * Specifies a function that returns available objects and object prefixes for the given `bucketName` and `pathPrefix`.\n * The return type of the function should be a promise that resolves to a list of objects with the following properties:\n * - `Key` (string) - Name of the object or object prefix.\n * - `LastModified` (string) - (Optional) Date when this object was last modified.\n * - `Size` (number) - (Optional) Size of the object.\n * - `IsFolder` (boolean) - (Optional) Determines whether the entry is an object prefix (folder).\n */\n fetchObjects: (bucketName: string, pathPrefix: string) => Promise<ReadonlyArray<S3ResourceSelectorProps.Object>>;\n\n /**\n * Specifies a function that returns available versions for the given `bucketName` and `pathPrefix`.\n * The return type of the function should be a promise that resolves to a list of versions with the following properties:\n * - `VersionId` (string) - Version ID of an object.\n * - `LastModified` (string) - (Optional) Date when this object was last modified.\n * - `Size` (number) - (Optional) Size of the object version.\n */\n fetchVersions: (bucketName: string, pathPrefix: string) => Promise<ReadonlyArray<S3ResourceSelectorProps.Version>>;\n\n /**\n * Fired when the resource selection is changed. The event detail object contains resource that represents the full\n * path of the selected resource and `errorText` that may contain a validation error.\n */\n onChange?: NonCancelableEventHandler<S3ResourceSelectorProps.ChangeDetail>;\n}\n\n// Does not use TableProps.AriaLabels, because here we do not need \"allItemsSelectionLabel\"\n// it is not applicable to single selection mode\ninterface SelectionLabels<T> {\n itemSelectionLabel: (data: TableProps.SelectionState<T>, row: T) => string;\n selectionGroupLabel: string;\n}\n\ntype SortingColumnContainingString = (columnName: string) => string;\n\nexport namespace S3ResourceSelectorProps {\n export interface Bucket {\n Name?: string;\n CreationDate?: string;\n // artificial field, does not exist on the real s3 response\n Region?: string;\n }\n export interface Object {\n Key?: string;\n LastModified?: string;\n Size?: number;\n // artificial field, does not exist on the real s3 response\n IsFolder?: boolean;\n }\n export interface Version {\n VersionId?: string;\n LastModified?: string;\n Size?: number;\n }\n\n export interface Resource {\n uri: string;\n versionId?: string;\n }\n\n export type SelectableItems = 'buckets' | 'objects' | 'versions';\n\n export interface I18nStrings {\n /**\n * @deprecated Use `inputPlaceholder` on the component instead.\n */\n inContextInputPlaceholder?: string;\n inContextInputClearAriaLabel?: string;\n inContextSelectPlaceholder?: string;\n inContextBrowseButton?: string;\n inContextViewButton?: string;\n inContextViewButtonAriaLabel?: string;\n inContextLoadingText?: string;\n inContextUriLabel?: string;\n inContextVersionSelectLabel?: string;\n\n modalTitle?: string;\n modalCancelButton?: string;\n modalSubmitButton?: string;\n modalBreadcrumbRootItem?: string;\n\n selectionBuckets?: string;\n selectionObjects?: string;\n selectionVersions?: string;\n selectionBucketsSearchPlaceholder?: string;\n selectionObjectsSearchPlaceholder?: string;\n selectionVersionsSearchPlaceholder?: string;\n selectionBucketsLoading?: string;\n selectionBucketsNoItems?: string;\n selectionObjectsLoading?: string;\n selectionObjectsNoItems?: string;\n selectionVersionsLoading?: string;\n selectionVersionsNoItems?: string;\n\n filteringCounterText?: (count: number) => string;\n filteringNoMatches?: string;\n filteringCantFindMatch?: string;\n clearFilterButtonText?: string;\n\n columnBucketName?: string;\n columnBucketCreationDate?: string;\n columnBucketRegion?: string;\n columnObjectKey?: string;\n columnObjectLastModified?: string;\n columnObjectSize?: string;\n columnVersionID?: string;\n columnVersionLastModified?: string;\n columnVersionSize?: string;\n\n validationPathMustBegin?: string;\n validationBucketLowerCase?: string;\n validationBucketMustNotContain?: string;\n validationBucketLength?: string;\n validationBucketMustComplyDns?: string;\n\n labelSortedDescending?: SortingColumnContainingString;\n labelSortedAscending?: SortingColumnContainingString;\n labelNotSorted?: SortingColumnContainingString;\n labelsPagination?: PaginationProps.Labels;\n labelsBucketsSelection?: SelectionLabels<Bucket>;\n labelsObjectsSelection?: SelectionLabels<S3ResourceSelectorProps.Object>;\n labelsVersionsSelection?: SelectionLabels<Version>;\n labelFiltering?: (itemsType: string) => string;\n labelRefresh?: string;\n labelModalDismiss?: string;\n labelBreadcrumbs?: string;\n labelExpandBreadcrumbs?: string;\n labelClearFilter?: string;\n }\n\n export interface ChangeDetail {\n resource: Resource;\n errorText?: string;\n }\n\n export interface Ref {\n /**\n * Focuses the S3 URI input field\n */\n focus(): void;\n }\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/s3-resource-selector/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\nimport { BaseModalProps } from '../modal/interfaces';\nimport { PaginationProps } from '../pagination/interfaces';\nimport { TableProps } from '../table/interfaces';\n\nexport interface S3ResourceSelectorProps extends BaseComponentProps, BaseModalProps {\n /**\n * Specifies additional information about component status.\n */\n alert?: React.ReactNode;\n\n /**\n * Adds `aria-labelledby` to the component. If you're using this component within a form field,\n * don't set this property because the form field component automatically sets it.\n *\n * Use this property if the component isn't surrounded by a form field, or you want to override the value\n * automatically set by the form field (for example, if you have two components within a single form field).\n *\n * To use it correctly, define an ID for the element you want to use as label and set the property to that ID.\n */\n ariaLabelledby?: string;\n\n /**\n * Adds `aria-describedby` to the component. If you're using this component within a form field,\n * don't set this property because the form field component automatically sets it.\n *\n * Use this property if the component isn't surrounded by a form field, or you want to override the value\n * automatically set by the form field (for example, if you have two components within a single form field).\n *\n * To use it correctly, define an ID for each element that you want to use as a description\n * and set the property to a string of each ID separated by spaces (for example, `\"id1 id2 id3\"`).\n */\n ariaDescribedby?: string;\n\n /**\n * Adds `aria-label` to the component.\n */\n ariaLabel?: string;\n\n /**\n * Adds `aria-labelledby` to the S3 URI input. If you're using this component within a form field,\n * you do not need to set this property, as the form field component will set it automatically.\n *\n * Use this property if the component isn't surrounded by a form field, or you want to override the value\n * automatically set by the form field (for example, if you have two components within a single form field).\n *\n * To use it correctly, define an ID for the element you want to use as label and set the property to that ID.\n */\n inputAriaDescribedby?: string;\n\n /**\n * Adds a placeholder to the S3 URI input.\n */\n inputPlaceholder?: string;\n\n /**\n * An array of the item types that are selectable in the table view. The array may contain the following items:\n * 'buckets', 'objects', or 'versions'. Example: ['buckets', 'objects']. By default, no items are selectable.\n * This property determines whether the component operates in Read mode or Write mode:\n * * Read mode - When 'objects' and 'versions' values are provided (folder selection should be disabled by\n * customizing `objectsIsItemDisabled` function).\n * * Write mode - When 'buckets' and 'objects' values are provided (file selection should be disabled by\n * customizing `objectsIsItemDisabled` function).\n */\n selectableItemsTypes?: ReadonlyArray<S3ResourceSelectorProps.SelectableItems>;\n\n /**\n * Href of the selected object that is applied to the View button.\n */\n viewHref?: string;\n\n /**\n * Whether the S3 URI input field is in invalid state.\n */\n invalid?: boolean;\n\n /**\n * Optionally overrides the set of visible columns in the Buckets view. Available columns: 'Name', 'CreationDate',\n * and 'Region'.\n */\n bucketsVisibleColumns?: ReadonlyArray<string>;\n\n /**\n * Optionally overrides the set of visible columns in the Objects view. Available columns: 'Key', 'LastModified',\n * and 'Size'.\n */\n objectsVisibleColumns?: ReadonlyArray<string>;\n\n /**\n * Optionally overrides the set of visible columns in the Versions view. Available columns: 'ID', 'CreationDate',\n * and 'Size'.\n */\n versionsVisibleColumns?: ReadonlyArray<string>;\n\n /**\n * Optionally overrides whether a bucket should be disabled for selection in the Buckets view or not.\n * It has higher priority than `selectableItemsTypes`. Example: if `selectableItemsTypes` has `['buckets']` value and\n * `bucketsIsItemDisabled` returns false for a bucket, then the bucket is disabled for selection.\n */\n bucketsIsItemDisabled?: (item: S3ResourceSelectorProps.Bucket) => boolean;\n\n /**\n * Optionally overrides whether an object should be disabled for selection in the Objects view or not. Similar to\n * `bucketsIsItemDisabled` this property takes precedence over the `selectableItemsTypes` property.\n */\n objectsIsItemDisabled?: (item: S3ResourceSelectorProps.Object) => boolean;\n\n /**\n * Optionally overrides whether a version should be disabled for selection in the Versions view or not. Similar to\n * `bucketsIsItemDisabled` this property takes precedence over the `selectableItemsTypes` property.\n */\n versionsIsItemDisabled?: (item: S3ResourceSelectorProps.Version) => boolean;\n\n /**\n * The current selected resource. Resource has the following properties:\n * - `uri` (string) - URI of the resource.\n * - `versionId` (string) - (Optional) Version ID of the selected resource.\n */\n resource: S3ResourceSelectorProps.Resource;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n * @i18n\n */\n i18nStrings?: S3ResourceSelectorProps.I18nStrings;\n\n /**\n * Specifies a function that returns all available buckets. The return type of the function should be a promise\n * that resolves to a list of objects with the following properties:\n * - `Name` (string) - Name of the bucket.\n * - `CreationDate` (string) - (Optional) Creation date of the bucket.\n * - `Region` (string) - (Optional) Region of the bucket.\n */\n fetchBuckets: () => Promise<ReadonlyArray<S3ResourceSelectorProps.Bucket>>;\n\n /**\n * Specifies a function that returns available objects and object prefixes for the given `bucketName` and `pathPrefix`.\n * The return type of the function should be a promise that resolves to a list of objects with the following properties:\n * - `Key` (string) - Name of the object or object prefix.\n * - `LastModified` (string) - (Optional) Date when this object was last modified.\n * - `Size` (number) - (Optional) Size of the object.\n * - `IsFolder` (boolean) - (Optional) Determines whether the entry is an object prefix (folder).\n */\n fetchObjects: (bucketName: string, pathPrefix: string) => Promise<ReadonlyArray<S3ResourceSelectorProps.Object>>;\n\n /**\n * Specifies a function that returns available versions for the given `bucketName` and `pathPrefix`.\n * The return type of the function should be a promise that resolves to a list of versions with the following properties:\n * - `VersionId` (string) - Version ID of an object.\n * - `LastModified` (string) - (Optional) Date when this object was last modified.\n * - `Size` (number) - (Optional) Size of the object version.\n */\n fetchVersions: (bucketName: string, pathPrefix: string) => Promise<ReadonlyArray<S3ResourceSelectorProps.Version>>;\n\n /**\n * Fired when the resource selection is changed. The event detail object contains resource that represents the full\n * path of the selected resource and `errorText` that may contain a validation error.\n */\n onChange?: NonCancelableEventHandler<S3ResourceSelectorProps.ChangeDetail>;\n}\n\n// Does not use TableProps.AriaLabels, because here we do not need \"allItemsSelectionLabel\"\n// it is not applicable to single selection mode\ninterface SelectionLabels<T> {\n itemSelectionLabel: (data: TableProps.SelectionState<T>, row: T) => string;\n selectionGroupLabel: string;\n}\n\ntype SortingColumnContainingString = (columnName: string) => string;\n\nexport namespace S3ResourceSelectorProps {\n export interface Bucket {\n Name?: string;\n CreationDate?: string;\n // artificial field, does not exist on the real s3 response\n Region?: string;\n }\n export interface Object {\n Key?: string;\n LastModified?: string;\n Size?: number;\n // artificial field, does not exist on the real s3 response\n IsFolder?: boolean;\n }\n export interface Version {\n VersionId?: string;\n LastModified?: string;\n Size?: number;\n }\n\n export interface Resource {\n uri: string;\n versionId?: string;\n }\n\n export type SelectableItems = 'buckets' | 'objects' | 'versions';\n\n export interface I18nStrings {\n /**\n * @deprecated Use `inputPlaceholder` on the component instead.\n */\n inContextInputPlaceholder?: string;\n inContextInputClearAriaLabel?: string;\n inContextSelectPlaceholder?: string;\n inContextBrowseButton?: string;\n inContextViewButton?: string;\n inContextViewButtonAriaLabel?: string;\n inContextLoadingText?: string;\n inContextUriLabel?: string;\n inContextVersionSelectLabel?: string;\n\n modalTitle?: string;\n modalCancelButton?: string;\n modalSubmitButton?: string;\n modalBreadcrumbRootItem?: string;\n modalLastUpdatedText?: string;\n\n selectionBuckets?: string;\n selectionObjects?: string;\n selectionVersions?: string;\n selectionBucketsSearchPlaceholder?: string;\n selectionObjectsSearchPlaceholder?: string;\n selectionVersionsSearchPlaceholder?: string;\n selectionBucketsLoading?: string;\n selectionBucketsNoItems?: string;\n selectionObjectsLoading?: string;\n selectionObjectsNoItems?: string;\n selectionVersionsLoading?: string;\n selectionVersionsNoItems?: string;\n\n filteringCounterText?: (count: number) => string;\n filteringNoMatches?: string;\n filteringCantFindMatch?: string;\n clearFilterButtonText?: string;\n\n columnBucketName?: string;\n columnBucketCreationDate?: string;\n columnBucketRegion?: string;\n columnObjectKey?: string;\n columnObjectLastModified?: string;\n columnObjectSize?: string;\n columnVersionID?: string;\n columnVersionLastModified?: string;\n columnVersionSize?: string;\n\n validationPathMustBegin?: string;\n validationBucketLowerCase?: string;\n validationBucketMustNotContain?: string;\n validationBucketLength?: string;\n validationBucketMustComplyDns?: string;\n\n labelSortedDescending?: SortingColumnContainingString;\n labelSortedAscending?: SortingColumnContainingString;\n labelNotSorted?: SortingColumnContainingString;\n labelsPagination?: PaginationProps.Labels;\n labelsBucketsSelection?: SelectionLabels<Bucket>;\n labelsObjectsSelection?: SelectionLabels<S3ResourceSelectorProps.Object>;\n labelsVersionsSelection?: SelectionLabels<Version>;\n labelFiltering?: (itemsType: string) => string;\n labelRefresh?: string;\n labelModalDismiss?: string;\n labelBreadcrumbs?: string;\n labelExpandBreadcrumbs?: string;\n labelClearFilter?: string;\n }\n\n export interface ChangeDetail {\n resource: Resource;\n errorText?: string;\n }\n\n export interface Ref {\n /**\n * Focuses the S3 URI input field\n */\n focus(): void;\n }\n}\n"]}
@@ -13,6 +13,7 @@ interface BasicS3TableStrings<T> {
13
13
  filteringAriaLabel?: string;
14
14
  filteringClearAriaLabel?: string;
15
15
  filteringCounterText?: S3ResourceSelectorProps.I18nStrings['filteringCounterText'];
16
+ lastUpdatedText?: string;
16
17
  emptyText?: string;
17
18
  noMatchTitle?: string;
18
19
  noMatchSubtitle?: string;
@@ -30,15 +31,13 @@ interface BasicS3TableProps<T> {
30
31
  isItemDisabled: TableProps.IsItemDisabled<T> | undefined;
31
32
  onSelect: (item: T | undefined) => void;
32
33
  }
33
- export declare function getSharedI18Strings(i18n: ComponentFormatFunction<'s3-resource-selector'>, i18nStrings: S3ResourceSelectorProps.I18nStrings | undefined): {
34
- filteringCounterText: ((count: number) => string) | undefined;
35
- labelRefresh: string | undefined;
36
- labelsPagination: PaginationProps.Labels | undefined;
37
- noMatchTitle: string | undefined;
38
- noMatchSubtitle: string | undefined;
39
- clearFilterButtonText: string | undefined;
40
- filteringClearAriaLabel: string | undefined;
41
- };
34
+ export declare function getSharedI18Strings(i18n: ComponentFormatFunction<'s3-resource-selector'>, i18nStrings: S3ResourceSelectorProps.I18nStrings | undefined): BasicS3TableStrings<unknown>;
42
35
  export declare function BasicS3Table<T>({ forwardFocusRef, columnDefinitions, fetchData, trackBy, i18nStrings, isVisualRefresh, visibleColumns, isItemDisabled, onSelect, }: BasicS3TableProps<T>): JSX.Element;
36
+ interface InternalHeaderActionsProps<T> {
37
+ reloadData: () => void;
38
+ i18nStrings: BasicS3TableProps<T>['i18nStrings'];
39
+ lastUpdated: Date | undefined;
40
+ }
41
+ export declare function InternalHeaderActions<T>({ i18nStrings, reloadData, lastUpdated }: InternalHeaderActionsProps<T>): JSX.Element;
43
42
  export {};
44
43
  //# sourceMappingURL=basic-table.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"basic-table.d.ts","sourceRoot":"","sources":["../../../../src/s3-resource-selector/s3-modal/basic-table.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAO3D,OAAO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cAAc,EACd,cAAc,EACd,QAAQ,GACT,EAAE,iBAAiB,CAAC,CAAC,CAAC,eAsGtB;AAED,UAAU,0BAA0B,CAAC,CAAC;IACpC,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,WAAW,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC;IACjD,WAAW,EAAE,IAAI,GAAG,SAAS,CAAC;CAC/B;AAED,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,EAAE,0BAA0B,CAAC,CAAC,CAAC,eA2B/G"}
@@ -1,3 +1,4 @@
1
+ import { __awaiter } from "tslib";
1
2
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
3
  // SPDX-License-Identifier: Apache-2.0
3
4
  import React, { useEffect, useRef, useState } from 'react';
@@ -5,11 +6,15 @@ import { useCollection } from '@cloudscape-design/collection-hooks';
5
6
  import { useStableCallback } from '@cloudscape-design/component-toolkit/internal';
6
7
  import { InternalButton } from '../../button/internal';
7
8
  import InternalHeader from '../../header/internal';
9
+ import LiveRegion from '../../internal/components/live-region';
8
10
  import useForwardFocus from '../../internal/hooks/forward-focus';
11
+ import formatDateLocalized from '../../internal/utils/date-time/format-date-localized';
9
12
  import InternalPagination from '../../pagination/internal';
13
+ import InternalSpaceBetween from '../../space-between/internal';
10
14
  import InternalTable from '../../table/internal';
11
15
  import InternalTextFilter from '../../text-filter/internal';
12
16
  import { EmptyState } from './empty-state';
17
+ import styles from './styles.css.js';
13
18
  export function getSharedI18Strings(i18n, i18nStrings) {
14
19
  return {
15
20
  filteringCounterText: i18n('i18nStrings.filteringCounterText', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.filteringCounterText, format => count => format({ count })),
@@ -19,17 +24,19 @@ export function getSharedI18Strings(i18n, i18nStrings) {
19
24
  noMatchSubtitle: i18n('i18nStrings.filteringCantFindMatch', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.filteringCantFindMatch),
20
25
  clearFilterButtonText: i18n('i18nStrings.clearFilterButtonText', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.clearFilterButtonText),
21
26
  filteringClearAriaLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.labelClearFilter,
27
+ lastUpdatedText: i18n('i18nStrings.modalLastUpdatedText', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.modalLastUpdatedText),
22
28
  };
23
29
  }
24
30
  export function BasicS3Table({ forwardFocusRef, columnDefinitions, fetchData, trackBy, i18nStrings = {}, isVisualRefresh, visibleColumns, isItemDisabled, onSelect, }) {
25
31
  var _a;
26
32
  const [loading, setLoading] = useState(false);
27
33
  const [allItems, setAllItems] = useState([]);
34
+ const [lastUpdated, setLastUpdated] = useState();
28
35
  const textFilterRef = useRef(null);
29
36
  const onSelectLatest = useStableCallback(onSelect);
30
37
  function loadData() {
31
38
  setLoading(true);
32
- fetchData()
39
+ return fetchData()
33
40
  .then(items => {
34
41
  setAllItems(items);
35
42
  setLoading(false);
@@ -39,6 +46,12 @@ export function BasicS3Table({ forwardFocusRef, columnDefinitions, fetchData, tr
39
46
  setLoading(false);
40
47
  });
41
48
  }
49
+ function reloadData() {
50
+ return __awaiter(this, void 0, void 0, function* () {
51
+ yield loadData();
52
+ setLastUpdated(new Date());
53
+ });
54
+ }
42
55
  useEffect(() => {
43
56
  loadData();
44
57
  // Data loading is only happening on initial render, or via refresh button
@@ -60,6 +73,25 @@ export function BasicS3Table({ forwardFocusRef, columnDefinitions, fetchData, tr
60
73
  useEffect(() => {
61
74
  onSelectLatest(selectedItem);
62
75
  }, [selectedItem, onSelectLatest]);
63
- return (React.createElement(InternalTable, Object.assign({ variant: isVisualRefresh ? 'borderless' : 'container' }, collectionProps, { header: React.createElement(InternalHeader, { variant: isVisualRefresh ? 'h3' : 'h2', headingTagOverride: 'h3', actions: React.createElement(InternalButton, { iconName: "refresh", ariaLabel: i18nStrings.labelRefresh, onClick: loadData }), counter: selectedItem ? `(1/${allItems.length})` : `(${allItems.length})` }, i18nStrings.header), trackBy: trackBy, filter: React.createElement(InternalTextFilter, Object.assign({}, filterProps, { ref: textFilterRef, filteringAriaLabel: i18nStrings.filteringAriaLabel, filteringClearAriaLabel: i18nStrings.filteringClearAriaLabel, filteringPlaceholder: i18nStrings.filteringPlaceholder, countText: i18nStrings.filteringCounterText ? i18nStrings.filteringCounterText(filteredItemsCount) : '' })), pagination: React.createElement(InternalPagination, Object.assign({}, paginationProps, { ariaLabels: i18nStrings.labelsPagination })), selectionType: "single", ariaLabels: i18nStrings.selectionLabels, loading: loading, loadingText: i18nStrings.loadingText, items: items, visibleColumns: visibleColumns, isItemDisabled: isItemDisabled, columnDefinitions: columnDefinitions, enableKeyboardNavigation: true })));
76
+ return (React.createElement(InternalTable, Object.assign({ variant: isVisualRefresh ? 'borderless' : 'container' }, collectionProps, { header: React.createElement(InternalHeader, { variant: isVisualRefresh ? 'h3' : 'h2', headingTagOverride: 'h3', actions: React.createElement(InternalHeaderActions, { reloadData: reloadData, i18nStrings: i18nStrings, lastUpdated: lastUpdated }), counter: selectedItem ? `(1/${allItems.length})` : `(${allItems.length})` }, i18nStrings.header), trackBy: trackBy, filter: React.createElement(InternalTextFilter, Object.assign({}, filterProps, { ref: textFilterRef, filteringAriaLabel: i18nStrings.filteringAriaLabel, filteringClearAriaLabel: i18nStrings.filteringClearAriaLabel, filteringPlaceholder: i18nStrings.filteringPlaceholder, countText: i18nStrings.filteringCounterText ? i18nStrings.filteringCounterText(filteredItemsCount) : '' })), pagination: React.createElement(InternalPagination, Object.assign({}, paginationProps, { ariaLabels: i18nStrings.labelsPagination })), selectionType: "single", ariaLabels: i18nStrings.selectionLabels, loading: loading, loadingText: i18nStrings.loadingText, items: items, visibleColumns: visibleColumns, isItemDisabled: isItemDisabled, columnDefinitions: columnDefinitions, enableKeyboardNavigation: true })));
77
+ }
78
+ export function InternalHeaderActions({ i18nStrings, reloadData, lastUpdated }) {
79
+ function getLastUpdated() {
80
+ if (!lastUpdated || !i18nStrings.lastUpdatedText) {
81
+ return null;
82
+ }
83
+ const formattedDate = formatDateLocalized({
84
+ date: lastUpdated.toString(),
85
+ isDateOnly: false,
86
+ });
87
+ return (React.createElement("div", { className: styles['last-updated-caption'] },
88
+ i18nStrings.lastUpdatedText,
89
+ React.createElement("br", null),
90
+ formattedDate,
91
+ React.createElement(LiveRegion, { visible: false, source: [i18nStrings.lastUpdatedText, formattedDate] })));
92
+ }
93
+ return (React.createElement(InternalSpaceBetween, { size: "s", direction: "horizontal", alignItems: "center" },
94
+ getLastUpdated(),
95
+ React.createElement(InternalButton, { iconName: "refresh", ariaLabel: i18nStrings.labelRefresh, onClick: reloadData })));
64
96
  }
65
97
  //# sourceMappingURL=basic-table.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"basic-table.js","sourceRoot":"","sources":["../../../../src/s3-resource-selector/s3-modal/basic-table.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE3D,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAElF,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,cAAc,MAAM,uBAAuB,CAAC;AAEnD,OAAO,eAAoC,MAAM,oCAAoC,CAAC;AAEtF,OAAO,kBAAkB,MAAM,2BAA2B,CAAC;AAE3D,OAAO,aAAa,MAAM,sBAAsB,CAAC;AAEjD,OAAO,kBAAkB,MAAM,4BAA4B,CAAC;AAE5D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAgC3C,MAAM,UAAU,mBAAmB,CACjC,IAAqD,EACrD,WAA4D;IAE5D,OAAO;QACL,oBAAoB,EAAE,IAAI,CACxB,kCAAkC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useRef, useState } from 'react';\n\nimport { useCollection } from '@cloudscape-design/collection-hooks';\nimport { useStableCallback } from '@cloudscape-design/component-toolkit/internal';\n\nimport { InternalButton } from '../../button/internal';\nimport InternalHeader from '../../header/internal';\nimport { ComponentFormatFunction } from '../../i18n/context';\nimport useForwardFocus, { ForwardFocusRef } from '../../internal/hooks/forward-focus';\nimport { PaginationProps } from '../../pagination/interfaces';\nimport InternalPagination from '../../pagination/internal';\nimport { TableProps } from '../../table/interfaces';\nimport InternalTable from '../../table/internal';\nimport { TextFilterProps } from '../../text-filter/interfaces';\nimport InternalTextFilter from '../../text-filter/internal';\nimport { S3ResourceSelectorProps } from '../interfaces';\nimport { EmptyState } from './empty-state';\n\ninterface BasicS3TableStrings<T> {\n labelRefresh?: string;\n labelsPagination?: PaginationProps.Labels;\n header?: string;\n loadingText?: string;\n filteringPlaceholder?: string;\n filteringAriaLabel?: string;\n filteringClearAriaLabel?: string;\n filteringCounterText?: S3ResourceSelectorProps.I18nStrings['filteringCounterText'];\n emptyText?: string;\n noMatchTitle?: string;\n noMatchSubtitle?: string;\n clearFilterButtonText?: string;\n selectionLabels?: TableProps.AriaLabels<T>;\n}\n\ninterface BasicS3TableProps<T> {\n // We do not use idiomatic `ref` prop because it does not allow generics.\n // Option 3 from this solution: https://stackoverflow.com/a/58473012/1297743\n forwardFocusRef: React.Ref<ForwardFocusRef>;\n columnDefinitions: ReadonlyArray<TableProps.ColumnDefinition<T>>;\n fetchData: () => Promise<ReadonlyArray<T>>;\n trackBy: TableProps.TrackBy<T>;\n i18nStrings: BasicS3TableStrings<T>;\n isVisualRefresh?: boolean;\n visibleColumns: ReadonlyArray<string>;\n isItemDisabled: TableProps.IsItemDisabled<T> | undefined;\n onSelect: (item: T | undefined) => void;\n}\n\nexport function getSharedI18Strings(\n i18n: ComponentFormatFunction<'s3-resource-selector'>,\n i18nStrings: S3ResourceSelectorProps.I18nStrings | undefined\n) {\n return {\n filteringCounterText: i18n(\n 'i18nStrings.filteringCounterText',\n i18nStrings?.filteringCounterText,\n format => count => format({ count })\n ),\n labelRefresh: i18n('i18nStrings.labelRefresh', i18nStrings?.labelRefresh),\n labelsPagination: i18nStrings?.labelsPagination,\n noMatchTitle: i18n('i18nStrings.filteringNoMatches', i18nStrings?.filteringNoMatches),\n noMatchSubtitle: i18n('i18nStrings.filteringCantFindMatch', i18nStrings?.filteringCantFindMatch),\n clearFilterButtonText: i18n('i18nStrings.clearFilterButtonText', i18nStrings?.clearFilterButtonText),\n filteringClearAriaLabel: i18nStrings?.labelClearFilter,\n };\n}\n\nexport function BasicS3Table<T>({\n forwardFocusRef,\n columnDefinitions,\n fetchData,\n trackBy,\n i18nStrings = {},\n isVisualRefresh,\n visibleColumns,\n isItemDisabled,\n onSelect,\n}: BasicS3TableProps<T>) {\n const [loading, setLoading] = useState(false);\n const [allItems, setAllItems] = useState<ReadonlyArray<T>>([]);\n const textFilterRef = useRef<TextFilterProps.Ref>(null);\n const onSelectLatest = useStableCallback(onSelect);\n\n function loadData() {\n setLoading(true);\n fetchData()\n .then(items => {\n setAllItems(items);\n setLoading(false);\n })\n .catch(() => {\n // error handling should happen on the customer side, outside of this component\n setLoading(false);\n });\n }\n\n useEffect(() => {\n loadData();\n // Data loading is only happening on initial render, or via refresh button\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useForwardFocus(forwardFocusRef, textFilterRef);\n\n const { items, filteredItemsCount, collectionProps, filterProps, paginationProps, actions } = useCollection(\n allItems,\n {\n selection: { trackBy },\n filtering: {\n empty: i18nStrings.emptyText,\n noMatch: (\n <EmptyState\n title={i18nStrings.noMatchTitle}\n subtitle={i18nStrings.noMatchSubtitle}\n action={\n <InternalButton onClick={() => actions.setFiltering('')}>\n {i18nStrings.clearFilterButtonText}\n </InternalButton>\n }\n />\n ),\n },\n pagination: {},\n sorting: {},\n }\n );\n const selectedItem = collectionProps.selectedItems?.[0];\n\n // selectedItem can change internally inside the hook after pagination or filtering\n // useEffect will capture all possible changes\n useEffect(() => {\n onSelectLatest(selectedItem);\n }, [selectedItem, onSelectLatest]);\n\n return (\n <InternalTable<T>\n variant={isVisualRefresh ? 'borderless' : 'container'}\n {...collectionProps}\n header={\n <InternalHeader\n variant={isVisualRefresh ? 'h3' : 'h2'}\n headingTagOverride={'h3'}\n actions={<InternalButton iconName=\"refresh\" ariaLabel={i18nStrings.labelRefresh} onClick={loadData} />}\n counter={selectedItem ? `(1/${allItems.length})` : `(${allItems.length})`}\n >\n {i18nStrings.header}\n </InternalHeader>\n }\n trackBy={trackBy}\n filter={\n <InternalTextFilter\n {...filterProps}\n ref={textFilterRef}\n filteringAriaLabel={i18nStrings.filteringAriaLabel}\n filteringClearAriaLabel={i18nStrings.filteringClearAriaLabel}\n filteringPlaceholder={i18nStrings.filteringPlaceholder}\n countText={i18nStrings.filteringCounterText ? i18nStrings.filteringCounterText(filteredItemsCount!) : ''}\n />\n }\n pagination={<InternalPagination {...paginationProps} ariaLabels={i18nStrings.labelsPagination} />}\n selectionType=\"single\"\n ariaLabels={i18nStrings.selectionLabels}\n loading={loading}\n loadingText={i18nStrings.loadingText}\n items={items}\n visibleColumns={visibleColumns}\n isItemDisabled={isItemDisabled}\n columnDefinitions={columnDefinitions}\n enableKeyboardNavigation={true}\n />\n );\n}\n"]}
1
+ {"version":3,"file":"basic-table.js","sourceRoot":"","sources":["../../../../src/s3-resource-selector/s3-modal/basic-table.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE3D,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAElF,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,cAAc,MAAM,uBAAuB,CAAC;AAEnD,OAAO,UAAU,MAAM,uCAAuC,CAAC;AAC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AC,GAAG,EAAC,SAAS,EAAC,YAAY,EAAC,UAAU,EAAC,QAAQ;QACtE,cAAc,EAAE;QACjB,oBAAC,cAAc,IAAC,QAAQ,EAAC,SAAS,EAAC,SAAS,EAAE,WAAW,CAAC,YAAY,EAAE,OAAO,EAAE,UAAU,GAAI,CAC1E,CACxB,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef, useState } from 'react';\n\nimport { useCollection } from '@cloudscape-design/collection-hooks';\nimport { useStableCallback } from '@cloudscape-design/component-toolkit/internal';\n\nimport { InternalButton } from '../../button/internal';\nimport InternalHeader from '../../header/internal';\nimport { ComponentFormatFunction } from '../../i18n/context';\nimport LiveRegion from '../../internal/components/live-region';\nimport useForwardFocus, { ForwardFocusRef } from '../../internal/hooks/forward-focus';\nimport formatDateLocalized from '../../internal/utils/date-time/format-date-localized';\nimport { PaginationProps } from '../../pagination/interfaces';\nimport InternalPagination from '../../pagination/internal';\nimport InternalSpaceBetween from '../../space-between/internal';\nimport { TableProps } from '../../table/interfaces';\nimport InternalTable from '../../table/internal';\nimport { TextFilterProps } from '../../text-filter/interfaces';\nimport InternalTextFilter from '../../text-filter/internal';\nimport { S3ResourceSelectorProps } from '../interfaces';\nimport { EmptyState } from './empty-state';\n\nimport styles from './styles.css.js';\n\ninterface BasicS3TableStrings<T> {\n labelRefresh?: string;\n labelsPagination?: PaginationProps.Labels;\n header?: string;\n loadingText?: string;\n filteringPlaceholder?: string;\n filteringAriaLabel?: string;\n filteringClearAriaLabel?: string;\n filteringCounterText?: S3ResourceSelectorProps.I18nStrings['filteringCounterText'];\n lastUpdatedText?: string;\n emptyText?: string;\n noMatchTitle?: string;\n noMatchSubtitle?: string;\n clearFilterButtonText?: string;\n selectionLabels?: TableProps.AriaLabels<T>;\n}\n\ninterface BasicS3TableProps<T> {\n // We do not use idiomatic `ref` prop because it does not allow generics.\n // Option 3 from this solution: https://stackoverflow.com/a/58473012/1297743\n forwardFocusRef: React.Ref<ForwardFocusRef>;\n columnDefinitions: ReadonlyArray<TableProps.ColumnDefinition<T>>;\n fetchData: () => Promise<ReadonlyArray<T>>;\n trackBy: TableProps.TrackBy<T>;\n i18nStrings: BasicS3TableStrings<T>;\n isVisualRefresh?: boolean;\n visibleColumns: ReadonlyArray<string>;\n isItemDisabled: TableProps.IsItemDisabled<T> | undefined;\n onSelect: (item: T | undefined) => void;\n}\n\nexport function getSharedI18Strings(\n i18n: ComponentFormatFunction<'s3-resource-selector'>,\n i18nStrings: S3ResourceSelectorProps.I18nStrings | undefined\n): BasicS3TableStrings<unknown> {\n return {\n filteringCounterText: i18n(\n 'i18nStrings.filteringCounterText',\n i18nStrings?.filteringCounterText,\n format => count => format({ count })\n ),\n labelRefresh: i18n('i18nStrings.labelRefresh', i18nStrings?.labelRefresh),\n labelsPagination: i18nStrings?.labelsPagination,\n noMatchTitle: i18n('i18nStrings.filteringNoMatches', i18nStrings?.filteringNoMatches),\n noMatchSubtitle: i18n('i18nStrings.filteringCantFindMatch', i18nStrings?.filteringCantFindMatch),\n clearFilterButtonText: i18n('i18nStrings.clearFilterButtonText', i18nStrings?.clearFilterButtonText),\n filteringClearAriaLabel: i18nStrings?.labelClearFilter,\n lastUpdatedText: i18n('i18nStrings.modalLastUpdatedText', i18nStrings?.modalLastUpdatedText),\n };\n}\n\nexport function BasicS3Table<T>({\n forwardFocusRef,\n columnDefinitions,\n fetchData,\n trackBy,\n i18nStrings = {},\n isVisualRefresh,\n visibleColumns,\n isItemDisabled,\n onSelect,\n}: BasicS3TableProps<T>) {\n const [loading, setLoading] = useState(false);\n const [allItems, setAllItems] = useState<ReadonlyArray<T>>([]);\n const [lastUpdated, setLastUpdated] = useState<Date>();\n const textFilterRef = useRef<TextFilterProps.Ref>(null);\n const onSelectLatest = useStableCallback(onSelect);\n\n function loadData() {\n setLoading(true);\n return fetchData()\n .then(items => {\n setAllItems(items);\n setLoading(false);\n })\n .catch(() => {\n // error handling should happen on the customer side, outside of this component\n setLoading(false);\n });\n }\n\n async function reloadData() {\n await loadData();\n setLastUpdated(new Date());\n }\n\n useEffect(() => {\n loadData();\n // Data loading is only happening on initial render, or via refresh button\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useForwardFocus(forwardFocusRef, textFilterRef);\n\n const { items, filteredItemsCount, collectionProps, filterProps, paginationProps, actions } = useCollection(\n allItems,\n {\n selection: { trackBy },\n filtering: {\n empty: i18nStrings.emptyText,\n noMatch: (\n <EmptyState\n title={i18nStrings.noMatchTitle}\n subtitle={i18nStrings.noMatchSubtitle}\n action={\n <InternalButton onClick={() => actions.setFiltering('')}>\n {i18nStrings.clearFilterButtonText}\n </InternalButton>\n }\n />\n ),\n },\n pagination: {},\n sorting: {},\n }\n );\n const selectedItem = collectionProps.selectedItems?.[0];\n\n // selectedItem can change internally inside the hook after pagination or filtering\n // useEffect will capture all possible changes\n useEffect(() => {\n onSelectLatest(selectedItem);\n }, [selectedItem, onSelectLatest]);\n\n return (\n <InternalTable<T>\n variant={isVisualRefresh ? 'borderless' : 'container'}\n {...collectionProps}\n header={\n <InternalHeader\n variant={isVisualRefresh ? 'h3' : 'h2'}\n headingTagOverride={'h3'}\n actions={\n <InternalHeaderActions<T> reloadData={reloadData} i18nStrings={i18nStrings} lastUpdated={lastUpdated} />\n }\n counter={selectedItem ? `(1/${allItems.length})` : `(${allItems.length})`}\n >\n {i18nStrings.header}\n </InternalHeader>\n }\n trackBy={trackBy}\n filter={\n <InternalTextFilter\n {...filterProps}\n ref={textFilterRef}\n filteringAriaLabel={i18nStrings.filteringAriaLabel}\n filteringClearAriaLabel={i18nStrings.filteringClearAriaLabel}\n filteringPlaceholder={i18nStrings.filteringPlaceholder}\n countText={i18nStrings.filteringCounterText ? i18nStrings.filteringCounterText(filteredItemsCount!) : ''}\n />\n }\n pagination={<InternalPagination {...paginationProps} ariaLabels={i18nStrings.labelsPagination} />}\n selectionType=\"single\"\n ariaLabels={i18nStrings.selectionLabels}\n loading={loading}\n loadingText={i18nStrings.loadingText}\n items={items}\n visibleColumns={visibleColumns}\n isItemDisabled={isItemDisabled}\n columnDefinitions={columnDefinitions}\n enableKeyboardNavigation={true}\n />\n );\n}\n\ninterface InternalHeaderActionsProps<T> {\n reloadData: () => void;\n i18nStrings: BasicS3TableProps<T>['i18nStrings'];\n lastUpdated: Date | undefined;\n}\n\nexport function InternalHeaderActions<T>({ i18nStrings, reloadData, lastUpdated }: InternalHeaderActionsProps<T>) {\n function getLastUpdated() {\n if (!lastUpdated || !i18nStrings.lastUpdatedText) {\n return null;\n }\n\n const formattedDate = formatDateLocalized({\n date: lastUpdated.toString(),\n isDateOnly: false,\n });\n\n return (\n <div className={styles['last-updated-caption']}>\n {i18nStrings.lastUpdatedText}\n <br />\n {formattedDate}\n <LiveRegion visible={false} source={[i18nStrings.lastUpdatedText, formattedDate]} />\n </div>\n );\n }\n\n return (\n <InternalSpaceBetween size=\"s\" direction=\"horizontal\" alignItems=\"center\">\n {getLastUpdated()}\n <InternalButton iconName=\"refresh\" ariaLabel={i18nStrings.labelRefresh} onClick={reloadData} />\n </InternalSpaceBetween>\n );\n}\n"]}
@@ -1,7 +1,8 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "modal-actions": "awsui_modal-actions_12hyz_1p88p_5",
5
- "submit-button": "awsui_submit-button_12hyz_1p88p_9"
4
+ "modal-actions": "awsui_modal-actions_12hyz_1iljt_97",
5
+ "submit-button": "awsui_submit-button_12hyz_1iljt_101",
6
+ "last-updated-caption": "awsui_last-updated-caption_12hyz_1iljt_105"
6
7
  };
7
8
 
@@ -2,10 +2,110 @@
2
2
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  SPDX-License-Identifier: Apache-2.0
4
4
  */
5
- .awsui_modal-actions_12hyz_1p88p_5:not(#\9) {
5
+ /*
6
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
7
+ SPDX-License-Identifier: Apache-2.0
8
+ */
9
+ /*
10
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
11
+ SPDX-License-Identifier: Apache-2.0
12
+ */
13
+ /*
14
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
15
+ SPDX-License-Identifier: Apache-2.0
16
+ */
17
+ /*
18
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
19
+ SPDX-License-Identifier: Apache-2.0
20
+ */
21
+ /*
22
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
23
+ SPDX-License-Identifier: Apache-2.0
24
+ */
25
+ /*
26
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
27
+ SPDX-License-Identifier: Apache-2.0
28
+ */
29
+ /*
30
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
31
+ SPDX-License-Identifier: Apache-2.0
32
+ */
33
+ /*
34
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
35
+ SPDX-License-Identifier: Apache-2.0
36
+ */
37
+ /*
38
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
39
+ SPDX-License-Identifier: Apache-2.0
40
+ */
41
+ /*
42
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
43
+ SPDX-License-Identifier: Apache-2.0
44
+ */
45
+ /*
46
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
47
+ SPDX-License-Identifier: Apache-2.0
48
+ */
49
+ /*
50
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
51
+ SPDX-License-Identifier: Apache-2.0
52
+ */
53
+ /*
54
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
55
+ SPDX-License-Identifier: Apache-2.0
56
+ */
57
+ /*
58
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
59
+ SPDX-License-Identifier: Apache-2.0
60
+ */
61
+ /*
62
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
63
+ SPDX-License-Identifier: Apache-2.0
64
+ */
65
+ /*
66
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
67
+ SPDX-License-Identifier: Apache-2.0
68
+ */
69
+ /* stylelint-disable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
70
+ /* stylelint-enable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
71
+ /*
72
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
73
+ SPDX-License-Identifier: Apache-2.0
74
+ */
75
+ /*
76
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
77
+ SPDX-License-Identifier: Apache-2.0
78
+ */
79
+ /*
80
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
81
+ SPDX-License-Identifier: Apache-2.0
82
+ */
83
+ /*
84
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
85
+ SPDX-License-Identifier: Apache-2.0
86
+ */
87
+ /* Style used for links in slots/components that are text heavy, to help links stand out among
88
+ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F73#description */
89
+ /*
90
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
91
+ SPDX-License-Identifier: Apache-2.0
92
+ */
93
+ /*
94
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
95
+ SPDX-License-Identifier: Apache-2.0
96
+ */
97
+ .awsui_modal-actions_12hyz_1iljt_97:not(#\9) {
6
98
  justify-content: flex-end;
7
99
  }
8
100
 
9
- .awsui_submit-button_12hyz_1p88p_9:not(#\9) {
101
+ .awsui_submit-button_12hyz_1iljt_101:not(#\9) {
10
102
  /* used in test-utils */
103
+ }
104
+
105
+ .awsui_last-updated-caption_12hyz_1iljt_105:not(#\9) {
106
+ font-size: var(--font-size-body-s-asqx2i, 12px);
107
+ line-height: var(--line-height-body-s-7zv1j5, 16px);
108
+ letter-spacing: var(--letter-spacing-body-s-z9jkwp, 0.005em);
109
+ text-align: end;
110
+ color: var(--color-text-status-inactive-m7co45, #5f6b7a);
11
111
  }
@@ -2,7 +2,8 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "modal-actions": "awsui_modal-actions_12hyz_1p88p_5",
6
- "submit-button": "awsui_submit-button_12hyz_1p88p_9"
5
+ "modal-actions": "awsui_modal-actions_12hyz_1iljt_97",
6
+ "submit-button": "awsui_submit-button_12hyz_1iljt_101",
7
+ "last-updated-caption": "awsui_last-updated-caption_12hyz_1iljt_105"
7
8
  };
8
9
 
@@ -1 +1 @@
1
- {"version":3,"file":"implementation.d.ts","sourceRoot":"","sources":["../../../src/side-navigation/implementation.tsx"],"names":[],"mappings":";AASA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAGlF,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAMnD,MAAM,MAAM,2BAA2B,GAAG,mBAAmB,GAAG,0BAA0B,CAAC;AAE3F,wBAAgB,4BAA4B,CAAC,EAC3C,MAAM,EACN,UAAU,EACV,KAAU,EACV,QAAQ,EACR,QAAQ,EACR,iBAAiB,EACjB,GAAG,KAAK,EACT,EAAE,2BAA2B,eAwD7B;AAED,eAAO,MAAM,8BAA8B,mGAA0D,CAAC"}
1
+ {"version":3,"file":"implementation.d.ts","sourceRoot":"","sources":["../../../src/side-navigation/implementation.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAGlF,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAMnD,MAAM,MAAM,2BAA2B,GAAG,mBAAmB,GAAG,0BAA0B,CAAC;AAE3F,wBAAgB,4BAA4B,CAAC,EAC3C,MAAM,EACN,UAAU,EACV,KAAU,EACV,QAAQ,EACR,QAAQ,EACR,iBAAiB,EACjB,GAAG,KAAK,EACT,EAAE,2BAA2B,eAuD7B;AAED,eAAO,MAAM,8BAA8B,mGAA0D,CAAC"}
@@ -3,7 +3,7 @@ import { __rest } from "tslib";
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
  import React, { useCallback, useEffect, useMemo } from 'react';
5
5
  import clsx from 'clsx';
6
- import { getGlobalFlag } from '@cloudscape-design/component-toolkit/internal';
6
+ import { isAppLayoutToolbarEnabled } from '../app-layout/utils/feature-flags';
7
7
  import { getBaseProps } from '../internal/base-component';
8
8
  import { fireCancelableEvent, fireNonCancelableEvent } from '../internal/events';
9
9
  import { isDevelopment } from '../internal/is-development';
@@ -15,7 +15,6 @@ export function SideNavigationImplementation(_a) {
15
15
  var { header, activeHref, items = [], onFollow, onChange, __internalRootRef } = _a, props = __rest(_a, ["header", "activeHref", "items", "onFollow", "onChange", "__internalRootRef"]);
16
16
  const baseProps = getBaseProps(props);
17
17
  const parentMap = useMemo(() => generateExpandableItemsMapping(items), [items]);
18
- const hasToolbar = getGlobalFlag('appLayoutWidget');
19
18
  if (isDevelopment) {
20
19
  // This code should be wiped in production anyway.
21
20
  // eslint-disable-next-line react-hooks/rules-of-hooks
@@ -29,7 +28,7 @@ export function SideNavigationImplementation(_a) {
29
28
  const onFollowHandler = useCallback((item, sourceEvent) => {
30
29
  fireCancelableEvent(onFollow, item, sourceEvent);
31
30
  }, [onFollow]);
32
- return (React.createElement("div", Object.assign({}, baseProps, { className: clsx(styles.root, baseProps.className, hasToolbar && styles['with-toolbar']), ref: __internalRootRef }),
31
+ return (React.createElement("div", Object.assign({}, baseProps, { className: clsx(styles.root, baseProps.className, isAppLayoutToolbarEnabled() && styles['with-toolbar']), ref: __internalRootRef }),
33
32
  header && (React.createElement(Header, { definition: header, activeHref: activeHref, fireChange: onChangeHandler, fireFollow: onFollowHandler })),
34
33
  items && (React.createElement("div", { className: styles['list-container'] },
35
34
  React.createElement(NavigationItemsList, { variant: "root", items: items, fireFollow: onFollowHandler, fireChange: onChangeHandler, activeHref: activeHref })))));
@@ -1 +1 @@
1
- {"version":3,"file":"implementation.js","sourceRoot":"","sources":["../../../src/side-navigation/implementation.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC/D,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,aAAa,EAAE,MAAM,+CAA+C,CAAC;AAE9E,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAEjF,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAEhE,OAAO,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,8BAA8B,EAAE,MAAM,QAAQ,CAAC;AAE7E,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAIrC,MAAM,UAAU,4BAA4B,CAAC,EAQf;QARe,EAC3C,MAAM,EACN,UAAU,EACV,KAAK,GAAG,EAAE,EACV,QAAQ,EACR,QAAQ,EACR,iBAAiB,OAEW,EADzB,KAAK,cAPmC,8EAQ5C,CADS;IAER,MAAM,SAAS,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IACtC,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,8BAA8B,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAChF,MAAM,UAAU,GAAG,aAAa,CAAC,iBAAiB,CAAC,CAAC;IAEpD,IAAI,aAAa,EAAE;QACjB,kDAAkD;QAClD,sDAAsD;QACtD,SAAS,CAAC,GAAG,EAAE,CAAC,mBAAmB,CAAC,KAAK,CAAC,EAAE,CAAC,KAA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Apache-2.0\nimport React, { useCallback, useEffect, useMemo } from 'react';\nimport clsx from 'clsx';\n\nimport { getGlobalFlag } from '@cloudscape-design/component-toolkit/internal';\n\nimport { getBaseProps } from '../internal/base-component';\nimport { fireCancelableEvent, fireNonCancelableEvent } from '../internal/events';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { isDevelopment } from '../internal/is-development';\nimport { createWidgetizedComponent } from '../internal/widgets';\nimport { SideNavigationProps } from './interfaces';\nimport { Header, NavigationItemsList } from './parts';\nimport { checkDuplicateHrefs, generateExpandableItemsMapping } from './util';\n\nimport styles from './styles.css.js';\n\nexport type SideNavigationInternalProps = SideNavigationProps & InternalBaseComponentProps;\n\nexport function SideNavigationImplementation({\n header,\n activeHref,\n items = [],\n onFollow,\n onChange,\n __internalRootRef,\n ...props\n}: SideNavigationInternalProps) {\n const baseProps = getBaseProps(props);\n const parentMap = useMemo(() => generateExpandableItemsMapping(items), [items]);\n const hasToolbar = getGlobalFlag('appLayoutWidget');\n\n if (isDevelopment) {\n // This code should be wiped in production anyway.\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useEffect(() => checkDuplicateHrefs(items), [items]);\n }\n\n const onChangeHandler = useCallback(\n (item: SideNavigationProps.Section | SideNavigationProps.ExpandableLinkGroup, expanded: boolean) => {\n // generateExpandableItemsMapping walks through the entire tree, so we're certain about getting a value.\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n fireNonCancelableEvent(onChange, { item, expanded: expanded, expandableParents: parentMap.get(item)! });\n },\n [onChange, parentMap]\n );\n\n const onFollowHandler = useCallback(\n (\n item:\n | SideNavigationProps.Link\n | SideNavigationProps.Header\n | SideNavigationProps.LinkGroup\n | SideNavigationProps.ExpandableLinkGroup,\n sourceEvent: React.SyntheticEvent | Event\n ) => {\n fireCancelableEvent(onFollow, item, sourceEvent);\n },\n [onFollow]\n );\n\n return (\n <div\n {...baseProps}\n className={clsx(styles.root, baseProps.className, hasToolbar && styles['with-toolbar'])}\n ref={__internalRootRef}\n >\n {header && (\n <Header definition={header} activeHref={activeHref} fireChange={onChangeHandler} fireFollow={onFollowHandler} />\n )}\n {items && (\n <div className={styles['list-container']}>\n <NavigationItemsList\n variant=\"root\"\n items={items}\n fireFollow={onFollowHandler}\n fireChange={onChangeHandler}\n activeHref={activeHref}\n />\n </div>\n )}\n </div>\n );\n}\n\nexport const createWidgetizedSideNavigation = createWidgetizedComponent(SideNavigationImplementation);\n"]}
1
+ {"version":3,"file":"implementation.js","sourceRoot":"","sources":["../../../src/side-navigation/implementation.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC/D,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAEjF,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAEhE,OAAO,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,8BAA8B,EAAE,MAAM,QAAQ,CAAC;AAE7E,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAIrC,MAAM,UAAU,4BAA4B,CAAC,EAQf;QARe,EAC3C,MAAM,EACN,UAAU,EACV,KAAK,GAAG,EAAE,EACV,QAAQ,EACR,QAAQ,EACR,iBAAiB,OAEW,EADzB,KAAK,cAPmC,8EAQ5C,CADS;IAER,MAAM,SAAS,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IACtC,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,EAAE,CAA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AC3B,UAAU,EAAE,UAAU,GACtB,CACE,CACP,CACG,CACP,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,8BAA8B,GAAG,yBAAyB,CAAC,4BAA4B,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useCallback, useEffect, useMemo } from 'react';\nimport clsx from 'clsx';\n\nimport { isAppLayoutToolbarEnabled } from '../app-layout/utils/feature-flags';\nimport { getBaseProps } from '../internal/base-component';\nimport { fireCancelableEvent, fireNonCancelableEvent } from '../internal/events';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { isDevelopment } from '../internal/is-development';\nimport { createWidgetizedComponent } from '../internal/widgets';\nimport { SideNavigationProps } from './interfaces';\nimport { Header, NavigationItemsList } from './parts';\nimport { checkDuplicateHrefs, generateExpandableItemsMapping } from './util';\n\nimport styles from './styles.css.js';\n\nexport type SideNavigationInternalProps = SideNavigationProps & InternalBaseComponentProps;\n\nexport function SideNavigationImplementation({\n header,\n activeHref,\n items = [],\n onFollow,\n onChange,\n __internalRootRef,\n ...props\n}: SideNavigationInternalProps) {\n const baseProps = getBaseProps(props);\n const parentMap = useMemo(() => generateExpandableItemsMapping(items), [items]);\n\n if (isDevelopment) {\n // This code should be wiped in production anyway.\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useEffect(() => checkDuplicateHrefs(items), [items]);\n }\n\n const onChangeHandler = useCallback(\n (item: SideNavigationProps.Section | SideNavigationProps.ExpandableLinkGroup, expanded: boolean) => {\n // generateExpandableItemsMapping walks through the entire tree, so we're certain about getting a value.\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n fireNonCancelableEvent(onChange, { item, expanded: expanded, expandableParents: parentMap.get(item)! });\n },\n [onChange, parentMap]\n );\n\n const onFollowHandler = useCallback(\n (\n item:\n | SideNavigationProps.Link\n | SideNavigationProps.Header\n | SideNavigationProps.LinkGroup\n | SideNavigationProps.ExpandableLinkGroup,\n sourceEvent: React.SyntheticEvent | Event\n ) => {\n fireCancelableEvent(onFollow, item, sourceEvent);\n },\n [onFollow]\n );\n\n return (\n <div\n {...baseProps}\n className={clsx(styles.root, baseProps.className, isAppLayoutToolbarEnabled() && styles['with-toolbar'])}\n ref={__internalRootRef}\n >\n {header && (\n <Header definition={header} activeHref={activeHref} fireChange={onChangeHandler} fireFollow={onFollowHandler} />\n )}\n {items && (\n <div className={styles['list-container']}>\n <NavigationItemsList\n variant=\"root\"\n items={items}\n fireFollow={onFollowHandler}\n fireChange={onChangeHandler}\n activeHref={activeHref}\n />\n </div>\n )}\n </div>\n );\n}\n\nexport const createWidgetizedSideNavigation = createWidgetizedComponent(SideNavigationImplementation);\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"bottom.d.ts","sourceRoot":"","sources":["../../../src/split-panel/bottom.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAKjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAKrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAKtD,UAAU,4BAA6B,SAAQ,sBAAsB;IACnE,KAAK,EAAE,gBAAgB,CAAC;IACxB,uBAAuB,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACxC,iBAAiB,EAAE,KAAK,CAAC,aAAa,GAAG,SAAS,CAAC;CACpD;AAED,wBAAgB,uBAAuB,CAAC,EACtC,SAAS,EACT,MAAM,EACN,KAAK,EACL,uBAAuB,EACvB,aAAa,EACb,UAAU,EACV,MAAM,EACN,YAAY,EACZ,QAAQ,EACR,iBAAiB,EACjB,aAAa,EACb,QAAQ,GACT,EAAE,4BAA4B,eAwD9B"}
1
+ {"version":3,"file":"bottom.d.ts","sourceRoot":"","sources":["../../../src/split-panel/bottom.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAMjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAKrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAKtD,UAAU,4BAA6B,SAAQ,sBAAsB;IACnE,KAAK,EAAE,gBAAgB,CAAC;IACxB,uBAAuB,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACxC,iBAAiB,EAAE,KAAK,CAAC,aAAa,GAAG,SAAS,CAAC;CACpD;AAED,wBAAgB,uBAAuB,CAAC,EACtC,SAAS,EACT,MAAM,EACN,KAAK,EACL,uBAAuB,EACvB,aAAa,EACb,UAAU,EACV,MAAM,EACN,YAAY,EACZ,QAAQ,EACR,iBAAiB,EACjB,aAAa,EACb,QAAQ,GACT,EAAE,4BAA4B,eAuD9B"}
@@ -2,7 +2,8 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import React, { useEffect, useRef } from 'react';
4
4
  import clsx from 'clsx';
5
- import { getGlobalFlag, useResizeObserver } from '@cloudscape-design/component-toolkit/internal';
5
+ import { useResizeObserver } from '@cloudscape-design/component-toolkit/internal';
6
+ import { isAppLayoutToolbarEnabled } from '../app-layout/utils/feature-flags';
6
7
  import { useSplitPanelContext } from '../internal/context/split-panel-context';
7
8
  import { useMergeRefs } from '../internal/hooks/use-merge-refs';
8
9
  import { useMobile } from '../internal/hooks/use-mobile';
@@ -11,7 +12,6 @@ import styles from './styles.css.js';
11
12
  import testUtilStyles from './test-classes/styles.css.js';
12
13
  export function SplitPanelContentBottom({ baseProps, isOpen, state, transitioningElementRef, splitPanelRef, cappedSize, header, resizeHandle, children, appLayoutMaxWidth, panelHeaderId, onToggle, }) {
13
14
  const isRefresh = useVisualRefresh();
14
- const hasToolbar = getGlobalFlag('appLayoutWidget');
15
15
  const { bottomOffset, leftOffset, rightOffset, disableContentPaddings, contentWrapperPaddings, reportHeaderHeight } = useSplitPanelContext();
16
16
  const transitionContentBottomRef = useMergeRefs(splitPanelRef || null, transitioningElementRef);
17
17
  const isMobile = useMobile();
@@ -34,7 +34,7 @@ export function SplitPanelContentBottom({ baseProps, isOpen, state, transitionin
34
34
  [styles['drawer-disable-content-paddings']]: disableContentPaddings,
35
35
  [styles.animating]: isRefresh && (state === 'entering' || state === 'exiting'),
36
36
  [styles.refresh]: isRefresh,
37
- [styles['with-toolbar']]: hasToolbar,
37
+ [styles['with-toolbar']]: isAppLayoutToolbarEnabled(),
38
38
  }), onClick: () => !isOpen && onToggle(), style: {
39
39
  insetBlockEnd: bottomOffset,
40
40
  insetInlineStart: leftOffset,
@@ -1 +1 @@
1
- {"version":3,"file":"bottom.js","sourceRoot":"","sources":["../../../src/split-panel/bottom.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAGjG,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAGrE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAQ1D,MAAM,UAAU,uBAAuB,CAAC,EACtC,SAAS,EACT,MAAM,EACN,KAAK,EACL,uBAAuB,EACvB,aAAa,EACb,UAAU,EACV,MAAM,EACN,YAAY,EACZ,QAAQ,EACR,iBAAiB,EACjB,aAAa,EACb,QAAQ,GACqB;IAC7B,MAAM,SAAS,GAAG,gBAAgB,EAAE,CAAC;IACrC,MAAM,UAAU,GAAG,aAAa,CAAC,iBAAiB,CAAC,CAAC;IACpD,MAAM,EAAE,YAAY,EAAE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CAAC,CAAC,EAAE,sBAAsB;YACnE,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,SAAS,IAAI,CAAC,KAAK,KAAK,UAAU,IAAI,KAAK,KAAK,SAAS,CAAC;YAC9E,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,SAAS;YAC3B,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,EAAE,UAAU;SACrC,CAAC,EACF,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,IAAI,QAAQ,EAAE,EACpC,KAAK,EAAE;YACL,aAAa,EAAE,YAAY;YAC3B,gBAAgB,EAAE,UAAU;YAC5B,cAAc,EAAE,WAAW;YAC3B,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS;SAC3C,EACD,GAAG,EAAE,0BAA0B;QAE9B,MAAM,IAAI,6BAAK,SAAS,EAAE,MAAM,CAAC,uBAAuB,CAAC,IAAG,YAAY,CAAO;QAChF,6BAAK,SAAS,EAAE,MAAM,CAAC,uBAAuB,CAAC,qBAAmB,aAAa,EAAE,IAAI,EAAC,QAAQ;YAC5F,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,4BAA4B,CAAC,EAAE,uBAAuB,CAAC,EAAE,GAAG,EAAE,SAAS,IAChG,MAAM,CACH;YACN,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,EAAE,uBAAuB,CAAC,iBAAe,CAAC,MAAM;gBAC3F,6BAAK,SAAS,EAAE,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,0BAA0B,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,iBAAiB,IAChG,QAAQ,CACL,CACF,CACF,CACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { getGlobalFlag, useResizeObserver } from '@cloudscape-design/component-toolkit/internal';\n\nimport { TransitionStatus } from '../internal/components/transition';\nimport { useSplitPanelContext } from '../internal/context/split-panel-context';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { useMobile } from '../internal/hooks/use-mobile';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { SplitPanelContentProps } from './interfaces';\n\nimport styles from './styles.css.js';\nimport testUtilStyles from './test-classes/styles.css.js';\n\ninterface SplitPanelContentBottomProps extends SplitPanelContentProps {\n state: TransitionStatus;\n transitioningElementRef: React.Ref<any>;\n appLayoutMaxWidth: React.CSSProperties | undefined;\n}\n\nexport function SplitPanelContentBottom({\n baseProps,\n isOpen,\n state,\n transitioningElementRef,\n splitPanelRef,\n cappedSize,\n header,\n resizeHandle,\n children,\n appLayoutMaxWidth,\n panelHeaderId,\n onToggle,\n}: SplitPanelContentBottomProps) {\n const isRefresh = useVisualRefresh();\n const hasToolbar = getGlobalFlag('appLayoutWidget');\n const { bottomOffset, leftOffset, rightOffset, disableContentPaddings, contentWrapperPaddings, reportHeaderHeight } =\n useSplitPanelContext();\n const transitionContentBottomRef = useMergeRefs(splitPanelRef || null, transitioningElementRef);\n const isMobile = useMobile();\n\n const headerRef = useRef<HTMLDivElement>(null);\n useResizeObserver(headerRef, entry => reportHeaderHeight(entry.borderBoxHeight));\n useEffect(() => {\n // report empty height when unmounting the panel\n return () => reportHeaderHeight(0);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const centeredMaxWidthClasses = clsx({\n [styles['pane-bottom-center-align']]: isRefresh,\n [styles['pane-bottom-content-nav-padding']]: contentWrapperPaddings?.closedNav,\n [styles['pane-bottom-content-tools-padding']]: contentWrapperPaddings?.closedTools,\n });\n\n return (\n <div\n {...baseProps}\n className={clsx(baseProps.className, styles.drawer, styles['position-bottom'], testUtilStyles.root, {\n [testUtilStyles['open-position-bottom']]: isOpen,\n [styles['drawer-closed']]: !isOpen,\n [styles['drawer-mobile']]: isMobile,\n [styles['drawer-disable-content-paddings']]: disableContentPaddings,\n [styles.animating]: isRefresh && (state === 'entering' || state === 'exiting'),\n [styles.refresh]: isRefresh,\n [styles['with-toolbar']]: hasToolbar,\n })}\n onClick={() => !isOpen && onToggle()}\n style={{\n insetBlockEnd: bottomOffset,\n insetInlineStart: leftOffset,\n insetInlineEnd: rightOffset,\n blockSize: isOpen ? cappedSize : undefined,\n }}\n ref={transitionContentBottomRef}\n >\n {isOpen && <div className={styles['slider-wrapper-bottom']}>{resizeHandle}</div>}\n <div className={styles['drawer-content-bottom']} aria-labelledby={panelHeaderId} role=\"region\">\n <div className={clsx(styles['pane-header-wrapper-bottom'], centeredMaxWidthClasses)} ref={headerRef}>\n {header}\n </div>\n <div className={clsx(styles['content-bottom'], centeredMaxWidthClasses)} aria-hidden={!isOpen}>\n <div className={clsx({ [styles['content-bottom-max-width']]: isRefresh })} style={appLayoutMaxWidth}>\n {children}\n </div>\n </div>\n </div>\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"bottom.js","sourceRoot":"","sources":["../../../src/split-panel/bottom.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAElF,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAE9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAGrE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,cAAc,MAAM,8B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CAAC,EAAE,CAAC,MAAM,CAAC,0BAA0B,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,iBAAiB,IAChG,QAAQ,CACL,CACF,CACF,CACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { useResizeObserver } from '@cloudscape-design/component-toolkit/internal';\n\nimport { isAppLayoutToolbarEnabled } from '../app-layout/utils/feature-flags';\nimport { TransitionStatus } from '../internal/components/transition';\nimport { useSplitPanelContext } from '../internal/context/split-panel-context';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { useMobile } from '../internal/hooks/use-mobile';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { SplitPanelContentProps } from './interfaces';\n\nimport styles from './styles.css.js';\nimport testUtilStyles from './test-classes/styles.css.js';\n\ninterface SplitPanelContentBottomProps extends SplitPanelContentProps {\n state: TransitionStatus;\n transitioningElementRef: React.Ref<any>;\n appLayoutMaxWidth: React.CSSProperties | undefined;\n}\n\nexport function SplitPanelContentBottom({\n baseProps,\n isOpen,\n state,\n transitioningElementRef,\n splitPanelRef,\n cappedSize,\n header,\n resizeHandle,\n children,\n appLayoutMaxWidth,\n panelHeaderId,\n onToggle,\n}: SplitPanelContentBottomProps) {\n const isRefresh = useVisualRefresh();\n const { bottomOffset, leftOffset, rightOffset, disableContentPaddings, contentWrapperPaddings, reportHeaderHeight } =\n useSplitPanelContext();\n const transitionContentBottomRef = useMergeRefs(splitPanelRef || null, transitioningElementRef);\n const isMobile = useMobile();\n\n const headerRef = useRef<HTMLDivElement>(null);\n useResizeObserver(headerRef, entry => reportHeaderHeight(entry.borderBoxHeight));\n useEffect(() => {\n // report empty height when unmounting the panel\n return () => reportHeaderHeight(0);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const centeredMaxWidthClasses = clsx({\n [styles['pane-bottom-center-align']]: isRefresh,\n [styles['pane-bottom-content-nav-padding']]: contentWrapperPaddings?.closedNav,\n [styles['pane-bottom-content-tools-padding']]: contentWrapperPaddings?.closedTools,\n });\n\n return (\n <div\n {...baseProps}\n className={clsx(baseProps.className, styles.drawer, styles['position-bottom'], testUtilStyles.root, {\n [testUtilStyles['open-position-bottom']]: isOpen,\n [styles['drawer-closed']]: !isOpen,\n [styles['drawer-mobile']]: isMobile,\n [styles['drawer-disable-content-paddings']]: disableContentPaddings,\n [styles.animating]: isRefresh && (state === 'entering' || state === 'exiting'),\n [styles.refresh]: isRefresh,\n [styles['with-toolbar']]: isAppLayoutToolbarEnabled(),\n })}\n onClick={() => !isOpen && onToggle()}\n style={{\n insetBlockEnd: bottomOffset,\n insetInlineStart: leftOffset,\n insetInlineEnd: rightOffset,\n blockSize: isOpen ? cappedSize : undefined,\n }}\n ref={transitionContentBottomRef}\n >\n {isOpen && <div className={styles['slider-wrapper-bottom']}>{resizeHandle}</div>}\n <div className={styles['drawer-content-bottom']} aria-labelledby={panelHeaderId} role=\"region\">\n <div className={clsx(styles['pane-header-wrapper-bottom'], centeredMaxWidthClasses)} ref={headerRef}>\n {header}\n </div>\n <div className={clsx(styles['content-bottom'], centeredMaxWidthClasses)} aria-hidden={!isOpen}>\n <div className={clsx({ [styles['content-bottom-max-width']]: isRefresh })} style={appLayoutMaxWidth}>\n {children}\n </div>\n </div>\n </div>\n </div>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"implementation.d.ts","sourceRoot":"","sources":["../../../src/split-panel/implementation.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAuD,MAAM,OAAO,CAAC;AAoB5E,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAO/C,OAAO,EAAE,eAAe,EAAE,CAAC;AAE3B,eAAO,MAAM,wBAAwB,qFAyOpC,CAAC;AAEF,eAAO,MAAM,0BAA0B,mMAIZ,CAAC"}
1
+ {"version":3,"file":"implementation.d.ts","sourceRoot":"","sources":["../../../src/split-panel/implementation.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAuD,MAAM,OAAO,CAAC;AAmB5E,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAO/C,OAAO,EAAE,eAAe,EAAE,CAAC;AAE3B,eAAO,MAAM,wBAAwB,qFA2OpC,CAAC;AAEF,eAAO,MAAM,0BAA0B,mMAIZ,CAAC"}
@@ -3,7 +3,7 @@ import { __rest } from "tslib";
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
  import React, { useEffect, useLayoutEffect, useRef, useState } from 'react';
5
5
  import clsx from 'clsx';
6
- import { getGlobalFlag } from '@cloudscape-design/component-toolkit/internal';
6
+ import { isAppLayoutToolbarEnabled } from '../app-layout/utils/feature-flags';
7
7
  import { useKeyboardEvents } from '../app-layout/utils/use-keyboard-events';
8
8
  import { usePointerEvents } from '../app-layout/utils/use-pointer-events';
9
9
  import { InternalButton } from '../button/internal';
@@ -28,7 +28,6 @@ export const SplitPanelImplementation = React.forwardRef((_a, __internalRootRef)
28
28
  const { position, topOffset, bottomOffset, rightOffset, contentWidthStyles, isOpen, isForcedPosition, onPreferencesChange, onResize, onToggle, size, relativeSize, setSplitPanelToggle, refs, } = useSplitPanelContext();
29
29
  const baseProps = getBaseProps(restProps);
30
30
  const i18n = useInternalI18n('split-panel');
31
- const hasToolbar = getGlobalFlag('appLayoutWidget');
32
31
  const [isPreferencesOpen, setPreferencesOpen] = useState(false);
33
32
  const appLayoutMaxWidth = isRefresh && position === 'bottom' ? contentWidthStyles : undefined;
34
33
  const openButtonAriaLabel = i18n('i18nStrings.openButtonAriaLabel', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.openButtonAriaLabel);
@@ -49,7 +48,7 @@ export const SplitPanelImplementation = React.forwardRef((_a, __internalRootRef)
49
48
  [globalVars.stickyVerticalBottomOffset]: bottomOffset,
50
49
  };
51
50
  const panelHeaderId = useUniqueId('split-panel-header');
52
- const wrappedHeader = (React.createElement("div", { className: clsx(styles.header, hasToolbar && styles['with-toolbar']), style: appLayoutMaxWidth },
51
+ const wrappedHeader = (React.createElement("div", { className: clsx(styles.header, isAppLayoutToolbarEnabled() && styles['with-toolbar']), style: appLayoutMaxWidth },
53
52
  React.createElement("h2", { className: clsx(styles['header-text'], testUtilStyles['header-text']), id: panelHeaderId }, header),
54
53
  React.createElement("div", { className: styles['header-actions'] },
55
54
  !hidePreferencesButton && isOpen && (React.createElement(React.Fragment, null,