@cloudscape-design/components 3.0.268 → 3.0.270

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 (47) hide show
  1. package/cards/index.d.ts.map +1 -1
  2. package/cards/index.js +4 -2
  3. package/cards/index.js.map +1 -1
  4. package/container/internal.d.ts +2 -1
  5. package/container/internal.d.ts.map +1 -1
  6. package/container/internal.js +8 -3
  7. package/container/internal.js.map +1 -1
  8. package/container/use-sticky-header.d.ts +1 -2
  9. package/container/use-sticky-header.d.ts.map +1 -1
  10. package/container/use-sticky-header.js +6 -8
  11. package/container/use-sticky-header.js.map +1 -1
  12. package/expandable-section/expandable-section-header.d.ts.map +1 -1
  13. package/expandable-section/expandable-section-header.js +8 -13
  14. package/expandable-section/expandable-section-header.js.map +1 -1
  15. package/internal/base-component/styles.scoped.css +4 -4
  16. package/internal/environment.js +1 -1
  17. package/internal/generated/theming/index.cjs +11 -11
  18. package/internal/generated/theming/index.js +11 -11
  19. package/internal/manifest.json +1 -1
  20. package/package.json +1 -1
  21. package/side-navigation/interfaces.d.ts +3 -0
  22. package/side-navigation/interfaces.d.ts.map +1 -1
  23. package/side-navigation/interfaces.js.map +1 -1
  24. package/side-navigation/internal.js +1 -1
  25. package/side-navigation/internal.js.map +1 -1
  26. package/table/header-cell/styles.css.js +19 -19
  27. package/table/header-cell/styles.scoped.css +33 -33
  28. package/table/header-cell/styles.selectors.js +19 -19
  29. package/table/internal.d.ts.map +1 -1
  30. package/table/internal.js +9 -3
  31. package/table/internal.js.map +1 -1
  32. package/table/use-sticky-columns.d.ts +73 -0
  33. package/table/use-sticky-columns.d.ts.map +1 -0
  34. package/table/use-sticky-columns.js +251 -0
  35. package/table/use-sticky-columns.js.map +1 -0
  36. package/test-utils/dom/multiselect/index.d.ts +1 -1
  37. package/test-utils/dom/multiselect/index.js +1 -1
  38. package/test-utils/dom/select/index.d.ts +1 -1
  39. package/test-utils/dom/select/index.js +1 -1
  40. package/test-utils/selectors/multiselect/index.d.ts +1 -1
  41. package/test-utils/selectors/multiselect/index.js +1 -1
  42. package/test-utils/selectors/select/index.d.ts +1 -1
  43. package/test-utils/selectors/select/index.js +1 -1
  44. package/test-utils/tsconfig.tsbuildinfo +1 -1
  45. package/wizard/styles.css.js +32 -32
  46. package/wizard/styles.scoped.css +66 -63
  47. package/wizard/styles.selectors.js +32 -32
@@ -1164,8 +1164,8 @@ export var preset = {
1164
1164
  "dark": "{colorGrey450}"
1165
1165
  },
1166
1166
  "colorBorderDividerInteractiveDefault": {
1167
- "light": "{colorTextInteractiveDefault}",
1168
- "dark": "{colorTextInteractiveDefault}"
1167
+ "light": "{colorGrey500}",
1168
+ "dark": "{colorGrey300}"
1169
1169
  },
1170
1170
  "colorBorderTabsDivider": {
1171
1171
  "light": "{colorGrey200}",
@@ -3125,8 +3125,8 @@ export var preset = {
3125
3125
  "dark": "{colorGrey450}"
3126
3126
  },
3127
3127
  "colorBorderDividerInteractiveDefault": {
3128
- "light": "{colorTextInteractiveDefault}",
3129
- "dark": "{colorTextInteractiveDefault}"
3128
+ "light": "{colorGrey300}",
3129
+ "dark": "{colorGrey300}"
3130
3130
  },
3131
3131
  "colorBorderTabsDivider": {
3132
3132
  "light": "{colorGrey600}",
@@ -4103,8 +4103,8 @@ export var preset = {
4103
4103
  "dark": "{colorGrey450}"
4104
4104
  },
4105
4105
  "colorBorderDividerInteractiveDefault": {
4106
- "light": "{colorTextInteractiveDefault}",
4107
- "dark": "{colorTextInteractiveDefault}"
4106
+ "light": "{colorGrey300}",
4107
+ "dark": "{colorGrey300}"
4108
4108
  },
4109
4109
  "colorBorderTabsDivider": {
4110
4110
  "light": "{colorGrey600}",
@@ -5013,8 +5013,8 @@ export var preset = {
5013
5013
  "dark": "{colorGrey450}"
5014
5014
  },
5015
5015
  "colorBorderDividerInteractiveDefault": {
5016
- "light": "{colorTextInteractiveDefault}",
5017
- "dark": "{colorTextInteractiveDefault}"
5016
+ "light": "{colorGrey500}",
5017
+ "dark": "{colorGrey300}"
5018
5018
  },
5019
5019
  "colorBorderTabsDivider": {
5020
5020
  "light": "{colorGrey200}",
@@ -5923,8 +5923,8 @@ export var preset = {
5923
5923
  "dark": "{colorGrey450}"
5924
5924
  },
5925
5925
  "colorBorderDividerInteractiveDefault": {
5926
- "light": "{colorTextInteractiveDefault}",
5927
- "dark": "{colorTextInteractiveDefault}"
5926
+ "light": "{colorGrey500}",
5927
+ "dark": "{colorGrey300}"
5928
5928
  },
5929
5929
  "colorBorderTabsDivider": {
5930
5930
  "light": "{colorGrey200}",
@@ -8334,7 +8334,7 @@ export var preset = {
8334
8334
  "colorBorderStatusInfo": "--color-border-status-info-546i7i",
8335
8335
  "colorBorderStatusSuccess": "--color-border-status-success-cqi45f",
8336
8336
  "colorBorderStatusWarning": "--color-border-status-warning-hg85ut",
8337
- "colorBorderDividerInteractiveDefault": "--color-border-divider-interactive-default-0hdcst",
8337
+ "colorBorderDividerInteractiveDefault": "--color-border-divider-interactive-default-4pf6ra",
8338
8338
  "colorBorderTabsDivider": "--color-border-tabs-divider-69fx5i",
8339
8339
  "colorBorderTabsShadow": "--color-border-tabs-shadow-4lmh2z",
8340
8340
  "colorBorderTabsUnderline": "--color-border-tabs-underline-9bcfzu",
@@ -1,3 +1,3 @@
1
1
  {
2
- "commit": "5171042c6b961e73046e3177fce843771e7fe133"
2
+ "commit": "561fa6ba6ffb456bb290ec0fb9362218849524a5"
3
3
  }
package/package.json CHANGED
@@ -109,7 +109,7 @@
109
109
  "./internal/base-component/index.js",
110
110
  "./internal/base-component/styles.css.js"
111
111
  ],
112
- "version": "3.0.268",
112
+ "version": "3.0.270",
113
113
  "repository": {
114
114
  "type": "git",
115
115
  "url": "https://github.com/cloudscape-design/components.git"
@@ -67,6 +67,8 @@ export interface SideNavigationProps extends BaseComponentProps {
67
67
  * - `type`: `'link-group'`.
68
68
  * - `text` (string) - Specifies the text of the group link.
69
69
  * - `href` (string) - Specifies the `href` of the group link.
70
+ * - `info` (ReactNode) - Enables you to display content next to the link. Although it is technically possible to insert any content,
71
+ * our UX guidelines allow only to add a Badge and/or a "New" label.
70
72
  * - `items` (array) - Specifies the content of the section. You can use any valid item from this list.
71
73
  * Although there is no technical limitation to the nesting level,
72
74
  * our UX recommendation is to use only one level.
@@ -146,6 +148,7 @@ export declare namespace SideNavigationProps {
146
148
  type: 'link-group';
147
149
  text: string;
148
150
  href: string;
151
+ info?: React.ReactNode;
149
152
  items: ReadonlyArray<Item>;
150
153
  }
151
154
  interface ExpandableLinkGroup {
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"lib/default/","sources":["side-navigation/interfaces.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAE7G,MAAM,WAAW,mBAAoB,SAAQ,kBAAkB;IAC7D;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,mBAAmB,CAAC,MAAM,CAAC;IAEpC;;;;;;;OAOG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8DG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAEhD;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,sBAAsB,CAAC,mBAAmB,CAAC,YAAY,CAAC,CAAC;IAEpE;;;;;;;;;;;;;OAaG;IACH,QAAQ,CAAC,EAAE,yBAAyB,CAAC,mBAAmB,CAAC,YAAY,CAAC,CAAC;CACxE;AAED,yBAAiB,mBAAmB,CAAC;IACnC,UAAiB,IAAI;QACnB,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,CAAC,EAAE,MAAM,CAAC;K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AY,IAAI,GAAG,OAAO,GAAG,IAAI,GAAG,OAAO,GAAG,SAAS,GAAG,mBAAmB,GAAG,YAAY,CAAC;IAE7F,UAAiB,YAAY;QAC3B,IAAI,EAAE,OAAO,GAAG,mBAAmB,CAAC;QACpC,QAAQ,EAAE,OAAO,CAAC;QAClB,iBAAiB,EAAE,aAAa,CAAC,OAAO,GAAG,mBAAmB,CAAC,CAAC;KACjE;IAED,UAAiB,YAAa,SAAQ,oBAAoB;QACxD,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,MAAM,GAAG,YAAY,GAAG,uBAAuB,GAAG,gBAAgB,CAAC;QAC1E,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;KACxB;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"lib/default/","sources":["side-navigation/interfaces.tsx"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { BaseNavigationDetail, CancelableEventHandler, NonCancelableEventHandler } from '../internal/events';\n\nexport interface SideNavigationProps extends BaseComponentProps {\n /**\n * Controls the header that appears at the top of the navigation component.\n *\n * It contains the following:\n * - `text` (string) - Specifies the header text.\n * - `href` (string) - Specifies the `href` that the header links to.\n * - `logo` (object) - Specifies a logo image.\n */\n header?: SideNavigationProps.Header;\n\n /**\n * Specifies the `href` of the currently active link.\n * All items within the navigation with a matching `href` are highlighted.\n *\n * `Sections` and `Expandable Page Groups` that contain a highlighted item\n * are automatically expanded, unless their definitions have the `defaultExpanded`\n * property explicitly set to `false`.\n */\n activeHref?: string;\n\n /**\n * Specifies the items to be displayed in the navigation.\n * Allowed objects are: `Link`, `Divider`, `Section`, `LinkGroup` and `ExpandableLinkGroup`.\n *\n * You can inject extra properties (for example, an ID)\n * in order to identify the item when it's used in an event `detail`\n * (for more information, see the events section below).\n *\n * #### Link\n * Object that represents an anchor in the navigation.\n * Links are rendered as `<a>` tags.\n * - `type` - `'link'`.\n * - `text` (string) - Specifies the link text.\n * - `href` (string) - Specifies the `href` of the link.\n * - `external` (boolean) - Determines whether to display an external link icon next to the link.\n * If set to `true`, an external link icon appears next to the link.\n * The anchor also has the attributes `target=\"_blank\"` and `rel=\"noopener\"`.\n * Additionally, the `activeHref` property won't be modified when a user chooses the link.\n * - `externalIconAriaLabel` (string) - Adds an aria-label to the external icon.\n * - `info` (ReactNode) - Enables you to display content next to the link. Although it is technically possible to insert any content,\n * our UX guidelines allow only to add a Badge and/or a \"New\" label.\n *\n * #### Divider\n * Object that represents a horizontal divider between navigation content.\n * It contains `type`: `'divider'` only.\n *\n * #### Section\n * Object that represents a section within the navigation.\n * - `type`: `'section'`.\n * - `text` (string) - Specifies the text to display as a title of the section.\n * - `defaultExpanded` (boolean) - Determines whether the section should be expanded by default. Default value is `true`.\n * - `items` (array) - Specifies the content of the section. You can use any valid item from this list.\n * Although there is no technical limitation to the nesting level,\n * our UX recommendation is to use only one level.\n *\n * #### Section Group\n * Aggregates a set of items that are conceptually related to each other, and can be displayed under a single heading to provide further organization.\n * You can nest sections, links, link groups and expandable link groups within a section group depending on your information architecture needs.\n * - `type`: `'section-group'`.\n * - `title` (string) - Specifies the text to display as a title of the section group.\n * - `items` (array) - Specifies the content of the section header group. You can use `Section`, `Link`, `LinkGroup`, `ExpandableLinkGroup`.\n *\n * #### LinkGroup\n * Object that represents a group of links.\n * - `type`: `'link-group'`.\n * - `text` (string) - Specifies the text of the group link.\n * - `href` (string) - Specifies the `href` of the group link.\n * - `items` (array) - Specifies the content of the section. You can use any valid item from this list.\n * Although there is no technical limitation to the nesting level,\n * our UX recommendation is to use only one level.\n *\n * #### ExpandableLinkGroup\n *\n * Object that represents an expandable group of links.\n * - `type`: `'expandable-link-group'`.\n * - `text` (string) - Specifies the text of the group link.\n * - `href` (string) - Specifies the `href` of the group link.\n * - `defaultExpanded` (boolean) - Specifies whether the group should be expanded by default.\n * If not explicitly set, the group is collapsed by default, unless one of the nested links is active.\n * - `items` (array) - Specifies the content of the section. You can use any valid item from this list.\n * Although there is no technical limitation to the nesting level,\n * our UX recommendation is to use only one level.\n */\n items?: ReadonlyArray<SideNavigationProps.Item>;\n\n /**\n * Fired when an anchor is clicked without any modifier (that is, CTRL, ALT, SHIFT).\n * The event `detail` contains a definition of the clicked item.\n * Use this event to prevent default browser navigation (by calling `preventDefault` method)\n * and branch your own routing.\n *\n * If the event is prevented the `activeHref` property won't be automatically set\n * to the href of the clicked item so you'll have to do it yourself.\n */\n onFollow?: CancelableEventHandler<SideNavigationProps.FollowDetail>;\n\n /**\n * Fired when the expansion state of `Section` or `ExpandablePageGroup` items changes\n * as a result of a user interaction. The event `detail` contains an object with information about the changed item.\n *\n * - `item` (object) - Specifies the item that was changed.\n * - `expanded` (boolean) - Specifies whether the item is expanded or not.\n * - `expandableParents` (array) - A list of parent items that have a type of `Section`\n * or `ExpandablePageGroup`. Use this `expandableParents` array to set their expanded\n * state to `true` if you want your data model to keep track of the current state\n * of the navigation items.\n *\n * Note: If the expansion is a result of the activation of a nested link\n * upon changing the `activeHref` property, this event isn't raised.\n */\n onChange?: NonCancelableEventHandler<SideNavigationProps.ChangeDetail>;\n}\n\nexport namespace SideNavigationProps {\n export interface Logo {\n src: string;\n alt?: string;\n }\n export interface Header {\n text?: string;\n href: string;\n logo?: Logo;\n }\n\n export interface Divider {\n type: 'divider';\n }\n\n export interface Link {\n type: 'link';\n text: string;\n href: string;\n external?: boolean;\n externalIconAriaLabel?: string;\n info?: React.ReactNode;\n }\n\n export interface Section {\n type: 'section';\n text: string;\n items: ReadonlyArray<Item>;\n defaultExpanded?: boolean;\n }\n\n export interface SectionGroup {\n type: 'section-group';\n title: string;\n items: ReadonlyArray<Section | Link | LinkGroup | ExpandableLinkGroup>;\n }\n export interface LinkGroup {\n type: 'link-group';\n text: string;\n href: string;\n items: ReadonlyArray<Item>;\n }\n\n export interface ExpandableLinkGroup {\n type: 'expandable-link-group';\n text: string;\n href: string;\n items: ReadonlyArray<Item>;\n defaultExpanded?: boolean;\n }\n\n export type Item = Divider | Link | Section | LinkGroup | ExpandableLinkGroup | SectionGroup;\n\n export interface ChangeDetail {\n item: Section | ExpandableLinkGroup;\n expanded: boolean;\n expandableParents: ReadonlyArray<Section | ExpandableLinkGroup>;\n }\n\n export interface FollowDetail extends BaseNavigationDetail {\n text?: string;\n href: string;\n type?: 'link' | 'link-group' | 'expandable-link-group' | 'section-header';\n info?: React.ReactNode;\n }\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"lib/default/","sources":["side-navigation/interfaces.tsx"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { BaseNavigationDetail, CancelableEventHandler, NonCancelableEventHandler } from '../internal/events';\n\nexport interface SideNavigationProps extends BaseComponentProps {\n /**\n * Controls the header that appears at the top of the navigation component.\n *\n * It contains the following:\n * - `text` (string) - Specifies the header text.\n * - `href` (string) - Specifies the `href` that the header links to.\n * - `logo` (object) - Specifies a logo image.\n */\n header?: SideNavigationProps.Header;\n\n /**\n * Specifies the `href` of the currently active link.\n * All items within the navigation with a matching `href` are highlighted.\n *\n * `Sections` and `Expandable Page Groups` that contain a highlighted item\n * are automatically expanded, unless their definitions have the `defaultExpanded`\n * property explicitly set to `false`.\n */\n activeHref?: string;\n\n /**\n * Specifies the items to be displayed in the navigation.\n * Allowed objects are: `Link`, `Divider`, `Section`, `LinkGroup` and `ExpandableLinkGroup`.\n *\n * You can inject extra properties (for example, an ID)\n * in order to identify the item when it's used in an event `detail`\n * (for more information, see the events section below).\n *\n * #### Link\n * Object that represents an anchor in the navigation.\n * Links are rendered as `<a>` tags.\n * - `type` - `'link'`.\n * - `text` (string) - Specifies the link text.\n * - `href` (string) - Specifies the `href` of the link.\n * - `external` (boolean) - Determines whether to display an external link icon next to the link.\n * If set to `true`, an external link icon appears next to the link.\n * The anchor also has the attributes `target=\"_blank\"` and `rel=\"noopener\"`.\n * Additionally, the `activeHref` property won't be modified when a user chooses the link.\n * - `externalIconAriaLabel` (string) - Adds an aria-label to the external icon.\n * - `info` (ReactNode) - Enables you to display content next to the link. Although it is technically possible to insert any content,\n * our UX guidelines allow only to add a Badge and/or a \"New\" label.\n *\n * #### Divider\n * Object that represents a horizontal divider between navigation content.\n * It contains `type`: `'divider'` only.\n *\n * #### Section\n * Object that represents a section within the navigation.\n * - `type`: `'section'`.\n * - `text` (string) - Specifies the text to display as a title of the section.\n * - `defaultExpanded` (boolean) - Determines whether the section should be expanded by default. Default value is `true`.\n * - `items` (array) - Specifies the content of the section. You can use any valid item from this list.\n * Although there is no technical limitation to the nesting level,\n * our UX recommendation is to use only one level.\n *\n * #### Section Group\n * Aggregates a set of items that are conceptually related to each other, and can be displayed under a single heading to provide further organization.\n * You can nest sections, links, link groups and expandable link groups within a section group depending on your information architecture needs.\n * - `type`: `'section-group'`.\n * - `title` (string) - Specifies the text to display as a title of the section group.\n * - `items` (array) - Specifies the content of the section header group. You can use `Section`, `Link`, `LinkGroup`, `ExpandableLinkGroup`.\n *\n * #### LinkGroup\n * Object that represents a group of links.\n * - `type`: `'link-group'`.\n * - `text` (string) - Specifies the text of the group link.\n * - `href` (string) - Specifies the `href` of the group link.\n * - `info` (ReactNode) - Enables you to display content next to the link. Although it is technically possible to insert any content,\n * our UX guidelines allow only to add a Badge and/or a \"New\" label.\n * - `items` (array) - Specifies the content of the section. You can use any valid item from this list.\n * Although there is no technical limitation to the nesting level,\n * our UX recommendation is to use only one level.\n *\n * #### ExpandableLinkGroup\n *\n * Object that represents an expandable group of links.\n * - `type`: `'expandable-link-group'`.\n * - `text` (string) - Specifies the text of the group link.\n * - `href` (string) - Specifies the `href` of the group link.\n * - `defaultExpanded` (boolean) - Specifies whether the group should be expanded by default.\n * If not explicitly set, the group is collapsed by default, unless one of the nested links is active.\n * - `items` (array) - Specifies the content of the section. You can use any valid item from this list.\n * Although there is no technical limitation to the nesting level,\n * our UX recommendation is to use only one level.\n */\n items?: ReadonlyArray<SideNavigationProps.Item>;\n\n /**\n * Fired when an anchor is clicked without any modifier (that is, CTRL, ALT, SHIFT).\n * The event `detail` contains a definition of the clicked item.\n * Use this event to prevent default browser navigation (by calling `preventDefault` method)\n * and branch your own routing.\n *\n * If the event is prevented the `activeHref` property won't be automatically set\n * to the href of the clicked item so you'll have to do it yourself.\n */\n onFollow?: CancelableEventHandler<SideNavigationProps.FollowDetail>;\n\n /**\n * Fired when the expansion state of `Section` or `ExpandablePageGroup` items changes\n * as a result of a user interaction. The event `detail` contains an object with information about the changed item.\n *\n * - `item` (object) - Specifies the item that was changed.\n * - `expanded` (boolean) - Specifies whether the item is expanded or not.\n * - `expandableParents` (array) - A list of parent items that have a type of `Section`\n * or `ExpandablePageGroup`. Use this `expandableParents` array to set their expanded\n * state to `true` if you want your data model to keep track of the current state\n * of the navigation items.\n *\n * Note: If the expansion is a result of the activation of a nested link\n * upon changing the `activeHref` property, this event isn't raised.\n */\n onChange?: NonCancelableEventHandler<SideNavigationProps.ChangeDetail>;\n}\n\nexport namespace SideNavigationProps {\n export interface Logo {\n src: string;\n alt?: string;\n }\n export interface Header {\n text?: string;\n href: string;\n logo?: Logo;\n }\n\n export interface Divider {\n type: 'divider';\n }\n\n export interface Link {\n type: 'link';\n text: string;\n href: string;\n external?: boolean;\n externalIconAriaLabel?: string;\n info?: React.ReactNode;\n }\n\n export interface Section {\n type: 'section';\n text: string;\n items: ReadonlyArray<Item>;\n defaultExpanded?: boolean;\n }\n\n export interface SectionGroup {\n type: 'section-group';\n title: string;\n items: ReadonlyArray<Section | Link | LinkGroup | ExpandableLinkGroup>;\n }\n export interface LinkGroup {\n type: 'link-group';\n text: string;\n href: string;\n info?: React.ReactNode;\n items: ReadonlyArray<Item>;\n }\n\n export interface ExpandableLinkGroup {\n type: 'expandable-link-group';\n text: string;\n href: string;\n items: ReadonlyArray<Item>;\n defaultExpanded?: boolean;\n }\n\n export type Item = Divider | Link | Section | LinkGroup | ExpandableLinkGroup | SectionGroup;\n\n export interface ChangeDetail {\n item: Section | ExpandableLinkGroup;\n expanded: boolean;\n expandableParents: ReadonlyArray<Section | ExpandableLinkGroup>;\n }\n\n export interface FollowDetail extends BaseNavigationDetail {\n text?: string;\n href: string;\n type?: 'link' | 'link-group' | 'expandable-link-group' | 'section-header';\n info?: React.ReactNode;\n }\n}\n"]}
@@ -142,7 +142,7 @@ function SectionGroup({ definition, activeHref, fireFollow, fireChange }) {
142
142
  function LinkGroup({ definition, activeHref, fireFollow, fireChange }) {
143
143
  checkSafeUrl('SideNavigation', definition.href);
144
144
  return (React.createElement(React.Fragment, null,
145
- React.createElement(Link, { definition: { type: 'link', href: definition.href, text: definition.text }, fireFollow: (_, event) => fireFollow(definition, event), fireChange: fireChange, activeHref: activeHref }),
145
+ React.createElement(Link, { definition: { type: 'link', href: definition.href, text: definition.text, info: definition.info }, fireFollow: (_, event) => fireFollow(definition, event), fireChange: fireChange, activeHref: activeHref }),
146
146
  React.createElement(NavigationItemsList, { variant: "link-group", items: definition.items, fireFollow: fireFollow, fireChange: fireChange, activeHref: activeHref })));
147
147
  }
148
148
  function ExpandableLinkGroup({ definition, fireFollow, fireChange, activeHref, variant }) {
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js","sourceRoot":"lib/default/","sources":["side-navigation/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAa,MAAM,OAAO,CAAC;AACpF,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,yBAAyB,MAAM,gCAAgC,CAAC;AACvE,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAC5C,OAAO,WAAW,MAA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EAC1E,QAAQ,EAAE,YAAY,aAAZ,YAAY,cAAZ,YAAY,GAAI,QAAQ,EAClC,UAAU,EAAE,cAAc,EAC1B,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,UAAU,GACtB;QAGJ,oBAAC,mBAAmB,IAClB,OAAO,EAAC,uBAAuB,EAC/B,KAAK,EAAE,UAAU,CAAC,KAAK,EACvB,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,UAAU,GACtB,CACwB,CAC7B,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useCallback, useState, useEffect, useMemo, ReactNode } from 'react';\nimport clsx from 'clsx';\nimport { ExpandableSectionProps } from '../expandable-section/interfaces';\nimport InternalExpandableSection from '../expandable-section/internal';\nimport InternalIcon from '../icon/internal';\nimport InternalBox from '../box/internal';\nimport { SideNavigationProps } from './interfaces';\nimport styles from './styles.css.js';\nimport { NonCancelableCustomEvent, isPlainLeftClick } from '../internal/events';\nimport { hasActiveLink } from './util';\nimport { checkSafeUrl } from '../internal/utils/check-safe-url';\n\ninterface BaseItemComponentProps {\n activeHref?: string;\n fireChange: (item: SideNavigationProps.Section | SideNavigationProps.ExpandableLinkGroup, expanded: boolean) => void;\n fireFollow: (\n item:\n | SideNavigationProps.Link\n | SideNavigationProps.Header\n | SideNavigationProps.LinkGroup\n | SideNavigationProps.ExpandableLinkGroup,\n event: React.SyntheticEvent | Event\n ) => void;\n}\n\nexport interface HeaderProps extends BaseItemComponentProps {\n definition: SideNavigationProps.Header;\n}\n\nexport function Header({ definition, activeHref, fireFollow }: HeaderProps) {\n checkSafeUrl('SideNavigation', definition.href);\n const onClick = useCallback(\n (event: React.MouseEvent) => {\n if (isPlainLeftClick(event)) {\n fireFollow(definition, event);\n }\n },\n [fireFollow, definition]\n );\n\n return (\n <>\n <h2 className={styles.header}>\n <a\n href={definition.href}\n className={clsx(styles['header-link'], { [styles['header-link--has-logo']]: !!definition.logo })}\n aria-current={definition.href === activeHref ? 'page' : undefined}\n onClick={onClick}\n >\n {definition.logo && (\n <img\n className={clsx(styles['header-logo'], {\n [styles['header-logo--stretched']]: !definition.text,\n })}\n {...definition.logo}\n />\n )}\n <span className={styles['header-link-text']}>{definition.text}</span>\n </a>\n </h2>\n <Divider isPresentational={true} variant=\"header\" />\n </>\n );\n}\n\nexport interface NavigationItemsListProps extends BaseItemComponentProps {\n items: ReadonlyArray<SideNavigationProps.Item>;\n variant: 'section' | 'section-group' | 'link-group' | 'expandable-link-group' | 'root';\n}\n\ninterface Item {\n element?: ReactNode;\n listVariant?: 'section' | 'section-group' | 'link-group' | 'expandable-link-group' | 'root';\n items?: Array<Item>;\n}\n\nexport function NavigationItemsList({ items, variant, activeHref, fireChange, fireFollow }: NavigationItemsListProps) {\n const lists: Array<Item> = [];\n let currentListIndex = 0;\n lists[currentListIndex] = {\n listVariant: variant,\n items: [],\n };\n\n items.forEach((item, index) => {\n const itemid = index + 1;\n switch (item.type) {\n case 'divider': {\n const dividerIndex = lists.length;\n lists[dividerIndex] = {\n element: (\n <div data-itemid={`item-${itemid}`}>\n <Divider variant=\"default\" />\n </div>\n ),\n };\n currentListIndex = lists.length;\n lists[currentListIndex] = {\n listVariant: variant,\n items: [],\n };\n return;\n }\n case 'link': {\n lists[currentListIndex].items?.push({\n element: (\n <li key={index} data-itemid={`item-${itemid}`} className={styles['list-item']}>\n <Link definition={item} activeHref={activeHref} fireChange={fireChange} fireFollow={fireFollow} />\n </li>\n ),\n });\n return;\n }\n case 'section': {\n lists[currentListIndex].items?.push({\n element: (\n <li key={index} data-itemid={`item-${itemid}`} className={styles['list-item']}>\n <Section\n definition={item}\n activeHref={activeHref}\n variant={variant}\n fireChange={fireChange}\n fireFollow={fireFollow}\n />\n </li>\n ),\n });\n return;\n }\n case 'section-group': {\n lists[currentListIndex].items?.push({\n element: (\n <li key={index} data-itemid={`item-${itemid}`} className={styles['list-item']}>\n <SectionGroup definition={item} activeHref={activeHref} fireChange={fireChange} fireFollow={fireFollow} />\n </li>\n ),\n });\n return;\n }\n case 'link-group': {\n lists[currentListIndex].items?.push({\n element: (\n <li key={index} data-itemid={`item-${itemid}`} className={styles['list-item']}>\n <LinkGroup definition={item} activeHref={activeHref} fireChange={fireChange} fireFollow={fireFollow} />\n </li>\n ),\n });\n return;\n }\n case 'expandable-link-group': {\n lists[currentListIndex].items?.push({\n element: (\n <li key={index} data-itemid={`item-${itemid}`} className={styles['list-item']}>\n <ExpandableLinkGroup\n definition={item}\n activeHref={activeHref}\n fireChange={fireChange}\n fireFollow={fireFollow}\n variant={variant}\n />\n </li>\n ),\n });\n return;\n }\n }\n });\n\n const lastListIndex = lists.length - 1;\n\n return (\n <>\n {lists.map((list, index) => {\n if (!list.items || list.items.length === 0) {\n return (\n <div\n key={`hr-${index}`}\n className={clsx(styles.list, styles[`list-variant-${variant}`], {\n [styles['list-variant-root--last']]: list.listVariant === 'root' && index === lastListIndex,\n })}\n >\n {list.element}\n </div>\n );\n } else {\n return (\n <ul\n key={`list-${index}`}\n className={clsx(styles.list, styles[`list-variant-${list.listVariant}`], {\n [styles['list-variant-root--last']]: list.listVariant === 'root' && index === lastListIndex,\n })}\n >\n {list.items.map(item => item.element)}\n </ul>\n );\n }\n })}\n </>\n );\n}\n\ninterface DividerProps {\n variant: 'default' | 'header';\n isPresentational?: boolean;\n}\n\nfunction Divider({ variant = 'default', isPresentational = false }: DividerProps) {\n return (\n <hr\n className={clsx(styles.divider, styles[`divider-${variant}`])}\n role={isPresentational ? 'presentation' : undefined}\n />\n );\n}\n\ninterface LinkProps extends BaseItemComponentProps {\n definition: SideNavigationProps.Link;\n expanded?: boolean;\n}\n\nfunction Link({ definition, expanded, activeHref, fireFollow }: LinkProps) {\n checkSafeUrl('SideNavigation', definition.href);\n const isActive = definition.href === activeHref;\n\n const onClick = useCallback(\n (event: React.MouseEvent) => {\n // Prevent the click event from toggling outer expandable sections.\n event.stopPropagation();\n\n if (isPlainLeftClick(event)) {\n fireFollow(definition, event);\n }\n },\n [fireFollow, definition]\n );\n\n return (\n <>\n <a\n href={definition.href}\n className={clsx(styles.link, { [styles['link-active']]: isActive })}\n target={definition.external ? '_blank' : undefined}\n rel={definition.external ? 'noopener noreferrer' : undefined}\n aria-expanded={expanded}\n aria-current={definition.href === activeHref ? 'page' : undefined}\n onClick={onClick}\n >\n {definition.text}\n {definition.external && (\n <span\n aria-label={definition.externalIconAriaLabel}\n role={definition.externalIconAriaLabel ? 'img' : undefined}\n >\n <InternalIcon name=\"external\" className={styles['external-icon']} />\n </span>\n )}\n </a>\n {definition.info && <span className={styles.info}>{definition.info}</span>}\n </>\n );\n}\n\ninterface SectionProps extends BaseItemComponentProps {\n definition: SideNavigationProps.Section;\n variant: 'section' | 'section-group' | 'link-group' | 'expandable-link-group' | 'root';\n}\n\nfunction Section({ definition, activeHref, fireFollow, fireChange, variant }: SectionProps) {\n const [expanded, setExpanded] = useState<boolean>(definition.defaultExpanded ?? true);\n\n const onExpandedChange = useCallback(\n (e: NonCancelableCustomEvent<ExpandableSectionProps.ChangeDetail>) => {\n fireChange(definition, e.detail.expanded);\n setExpanded(e.detail.expanded);\n },\n [definition, fireChange]\n );\n\n useEffect(() => {\n setExpanded(definition.defaultExpanded ?? true);\n }, [definition]);\n\n return (\n <InternalExpandableSection\n variant=\"footer\"\n expanded={expanded}\n onChange={onExpandedChange}\n className={clsx(styles.section, variant === 'section-group' && styles['section--no-ident'])}\n headerText={definition.text}\n >\n <NavigationItemsList\n variant=\"section\"\n items={definition.items}\n fireFollow={fireFollow}\n fireChange={fireChange}\n activeHref={activeHref}\n />\n </InternalExpandableSection>\n );\n}\n\ninterface SectionGroupProps extends BaseItemComponentProps {\n definition: SideNavigationProps.SectionGroup;\n}\n\nfunction SectionGroup({ definition, activeHref, fireFollow, fireChange }: SectionGroupProps) {\n return (\n <div className={styles['section-group']}>\n <InternalBox className={styles['section-group-title']} variant=\"h3\">\n {definition.title}\n </InternalBox>\n <NavigationItemsList\n variant=\"section-group\"\n items={definition.items}\n fireFollow={fireFollow}\n fireChange={fireChange}\n activeHref={activeHref}\n />\n </div>\n );\n}\n\ninterface LinkGroupProps extends BaseItemComponentProps {\n definition: SideNavigationProps.LinkGroup;\n}\n\nfunction LinkGroup({ definition, activeHref, fireFollow, fireChange }: LinkGroupProps) {\n checkSafeUrl('SideNavigation', definition.href);\n\n return (\n <>\n <Link\n definition={{ type: 'link', href: definition.href, text: definition.text }}\n fireFollow={(_, event) => fireFollow(definition, event)}\n fireChange={fireChange}\n activeHref={activeHref}\n />\n <NavigationItemsList\n variant=\"link-group\"\n items={definition.items}\n fireFollow={fireFollow}\n fireChange={fireChange}\n activeHref={activeHref}\n />\n </>\n );\n}\n\ninterface ExpandableLinkGroupProps extends BaseItemComponentProps {\n definition: SideNavigationProps.ExpandableLinkGroup;\n variant: 'section' | 'section-group' | 'link-group' | 'expandable-link-group' | 'root';\n}\n\nfunction ExpandableLinkGroup({ definition, fireFollow, fireChange, activeHref, variant }: ExpandableLinkGroupProps) {\n // Check whether the definition contains an active link and memoize it to avoid\n // rechecking every time.\n const containsActiveLink = useMemo(() => {\n return activeHref ? hasActiveLink(definition.items, activeHref) : false;\n }, [activeHref, definition.items]);\n\n const [expanded, setExpanded] = useState<boolean>(() => {\n return definition.defaultExpanded ?? (definition.href === activeHref || containsActiveLink);\n });\n\n const [userExpanded, setUserExpanded] = useState<boolean | undefined>();\n\n // Reset user expansion status when the items property is updated.\n useEffect(() => setUserExpanded(undefined), [definition]);\n\n // By default, the expandable section is open when there's an active link inside.\n useEffect(() => {\n setExpanded(definition.href === activeHref || containsActiveLink);\n }, [definition.href, containsActiveLink, activeHref]);\n\n // If the definition object itself is updated, reset the expansion state to default.\n useEffect(() => {\n if (definition.defaultExpanded !== undefined) {\n setExpanded(definition.defaultExpanded);\n }\n }, [definition]);\n\n const onExpandedChange = useCallback(\n (e: NonCancelableCustomEvent<ExpandableSectionProps.ChangeDetail>) => {\n fireChange(definition, e.detail.expanded);\n setUserExpanded(e.detail.expanded);\n },\n [definition, fireChange]\n );\n\n const onHeaderFollow: LinkProps['fireFollow'] = (_, event) => {\n fireFollow(definition, event);\n setUserExpanded(true);\n if (!expanded) {\n fireChange(definition, true);\n }\n };\n\n return (\n <InternalExpandableSection\n className={clsx(\n styles['expandable-link-group'],\n variant === 'section-group' && styles['expandable-link-group--no-ident']\n )}\n variant=\"navigation\"\n expanded={userExpanded ?? expanded}\n onChange={onExpandedChange}\n headerText={\n <Link\n definition={{ type: 'link', href: definition.href, text: definition.text }}\n expanded={userExpanded ?? expanded}\n fireFollow={onHeaderFollow}\n fireChange={fireChange}\n activeHref={activeHref}\n />\n }\n >\n <NavigationItemsList\n variant=\"expandable-link-group\"\n items={definition.items}\n fireFollow={fireFollow}\n fireChange={fireChange}\n activeHref={activeHref}\n />\n </InternalExpandableSection>\n );\n}\n"]}
1
+ {"version":3,"file":"internal.js","sourceRoot":"lib/default/","sources":["side-navigation/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAa,MAAM,OAAO,CAAC;AACpF,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,yBAAyB,MAAM,gCAAgC,CAAC;AACvE,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAC5C,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAE1C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAA4B,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAmBhE,MAAM,UAAU,MAAM,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAe;IACxE,YAAY,CAAC,gBAAgB,EAAE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ACtB,UAAU,EAAE,UAAU,GACtB,CACwB,CAC7B,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useCallback, useState, useEffect, useMemo, ReactNode } from 'react';\nimport clsx from 'clsx';\nimport { ExpandableSectionProps } from '../expandable-section/interfaces';\nimport InternalExpandableSection from '../expandable-section/internal';\nimport InternalIcon from '../icon/internal';\nimport InternalBox from '../box/internal';\nimport { SideNavigationProps } from './interfaces';\nimport styles from './styles.css.js';\nimport { NonCancelableCustomEvent, isPlainLeftClick } from '../internal/events';\nimport { hasActiveLink } from './util';\nimport { checkSafeUrl } from '../internal/utils/check-safe-url';\n\ninterface BaseItemComponentProps {\n activeHref?: string;\n fireChange: (item: SideNavigationProps.Section | SideNavigationProps.ExpandableLinkGroup, expanded: boolean) => void;\n fireFollow: (\n item:\n | SideNavigationProps.Link\n | SideNavigationProps.Header\n | SideNavigationProps.LinkGroup\n | SideNavigationProps.ExpandableLinkGroup,\n event: React.SyntheticEvent | Event\n ) => void;\n}\n\nexport interface HeaderProps extends BaseItemComponentProps {\n definition: SideNavigationProps.Header;\n}\n\nexport function Header({ definition, activeHref, fireFollow }: HeaderProps) {\n checkSafeUrl('SideNavigation', definition.href);\n const onClick = useCallback(\n (event: React.MouseEvent) => {\n if (isPlainLeftClick(event)) {\n fireFollow(definition, event);\n }\n },\n [fireFollow, definition]\n );\n\n return (\n <>\n <h2 className={styles.header}>\n <a\n href={definition.href}\n className={clsx(styles['header-link'], { [styles['header-link--has-logo']]: !!definition.logo })}\n aria-current={definition.href === activeHref ? 'page' : undefined}\n onClick={onClick}\n >\n {definition.logo && (\n <img\n className={clsx(styles['header-logo'], {\n [styles['header-logo--stretched']]: !definition.text,\n })}\n {...definition.logo}\n />\n )}\n <span className={styles['header-link-text']}>{definition.text}</span>\n </a>\n </h2>\n <Divider isPresentational={true} variant=\"header\" />\n </>\n );\n}\n\nexport interface NavigationItemsListProps extends BaseItemComponentProps {\n items: ReadonlyArray<SideNavigationProps.Item>;\n variant: 'section' | 'section-group' | 'link-group' | 'expandable-link-group' | 'root';\n}\n\ninterface Item {\n element?: ReactNode;\n listVariant?: 'section' | 'section-group' | 'link-group' | 'expandable-link-group' | 'root';\n items?: Array<Item>;\n}\n\nexport function NavigationItemsList({ items, variant, activeHref, fireChange, fireFollow }: NavigationItemsListProps) {\n const lists: Array<Item> = [];\n let currentListIndex = 0;\n lists[currentListIndex] = {\n listVariant: variant,\n items: [],\n };\n\n items.forEach((item, index) => {\n const itemid = index + 1;\n switch (item.type) {\n case 'divider': {\n const dividerIndex = lists.length;\n lists[dividerIndex] = {\n element: (\n <div data-itemid={`item-${itemid}`}>\n <Divider variant=\"default\" />\n </div>\n ),\n };\n currentListIndex = lists.length;\n lists[currentListIndex] = {\n listVariant: variant,\n items: [],\n };\n return;\n }\n case 'link': {\n lists[currentListIndex].items?.push({\n element: (\n <li key={index} data-itemid={`item-${itemid}`} className={styles['list-item']}>\n <Link definition={item} activeHref={activeHref} fireChange={fireChange} fireFollow={fireFollow} />\n </li>\n ),\n });\n return;\n }\n case 'section': {\n lists[currentListIndex].items?.push({\n element: (\n <li key={index} data-itemid={`item-${itemid}`} className={styles['list-item']}>\n <Section\n definition={item}\n activeHref={activeHref}\n variant={variant}\n fireChange={fireChange}\n fireFollow={fireFollow}\n />\n </li>\n ),\n });\n return;\n }\n case 'section-group': {\n lists[currentListIndex].items?.push({\n element: (\n <li key={index} data-itemid={`item-${itemid}`} className={styles['list-item']}>\n <SectionGroup definition={item} activeHref={activeHref} fireChange={fireChange} fireFollow={fireFollow} />\n </li>\n ),\n });\n return;\n }\n case 'link-group': {\n lists[currentListIndex].items?.push({\n element: (\n <li key={index} data-itemid={`item-${itemid}`} className={styles['list-item']}>\n <LinkGroup definition={item} activeHref={activeHref} fireChange={fireChange} fireFollow={fireFollow} />\n </li>\n ),\n });\n return;\n }\n case 'expandable-link-group': {\n lists[currentListIndex].items?.push({\n element: (\n <li key={index} data-itemid={`item-${itemid}`} className={styles['list-item']}>\n <ExpandableLinkGroup\n definition={item}\n activeHref={activeHref}\n fireChange={fireChange}\n fireFollow={fireFollow}\n variant={variant}\n />\n </li>\n ),\n });\n return;\n }\n }\n });\n\n const lastListIndex = lists.length - 1;\n\n return (\n <>\n {lists.map((list, index) => {\n if (!list.items || list.items.length === 0) {\n return (\n <div\n key={`hr-${index}`}\n className={clsx(styles.list, styles[`list-variant-${variant}`], {\n [styles['list-variant-root--last']]: list.listVariant === 'root' && index === lastListIndex,\n })}\n >\n {list.element}\n </div>\n );\n } else {\n return (\n <ul\n key={`list-${index}`}\n className={clsx(styles.list, styles[`list-variant-${list.listVariant}`], {\n [styles['list-variant-root--last']]: list.listVariant === 'root' && index === lastListIndex,\n })}\n >\n {list.items.map(item => item.element)}\n </ul>\n );\n }\n })}\n </>\n );\n}\n\ninterface DividerProps {\n variant: 'default' | 'header';\n isPresentational?: boolean;\n}\n\nfunction Divider({ variant = 'default', isPresentational = false }: DividerProps) {\n return (\n <hr\n className={clsx(styles.divider, styles[`divider-${variant}`])}\n role={isPresentational ? 'presentation' : undefined}\n />\n );\n}\n\ninterface LinkProps extends BaseItemComponentProps {\n definition: SideNavigationProps.Link;\n expanded?: boolean;\n}\n\nfunction Link({ definition, expanded, activeHref, fireFollow }: LinkProps) {\n checkSafeUrl('SideNavigation', definition.href);\n const isActive = definition.href === activeHref;\n\n const onClick = useCallback(\n (event: React.MouseEvent) => {\n // Prevent the click event from toggling outer expandable sections.\n event.stopPropagation();\n\n if (isPlainLeftClick(event)) {\n fireFollow(definition, event);\n }\n },\n [fireFollow, definition]\n );\n\n return (\n <>\n <a\n href={definition.href}\n className={clsx(styles.link, { [styles['link-active']]: isActive })}\n target={definition.external ? '_blank' : undefined}\n rel={definition.external ? 'noopener noreferrer' : undefined}\n aria-expanded={expanded}\n aria-current={definition.href === activeHref ? 'page' : undefined}\n onClick={onClick}\n >\n {definition.text}\n {definition.external && (\n <span\n aria-label={definition.externalIconAriaLabel}\n role={definition.externalIconAriaLabel ? 'img' : undefined}\n >\n <InternalIcon name=\"external\" className={styles['external-icon']} />\n </span>\n )}\n </a>\n {definition.info && <span className={styles.info}>{definition.info}</span>}\n </>\n );\n}\n\ninterface SectionProps extends BaseItemComponentProps {\n definition: SideNavigationProps.Section;\n variant: 'section' | 'section-group' | 'link-group' | 'expandable-link-group' | 'root';\n}\n\nfunction Section({ definition, activeHref, fireFollow, fireChange, variant }: SectionProps) {\n const [expanded, setExpanded] = useState<boolean>(definition.defaultExpanded ?? true);\n\n const onExpandedChange = useCallback(\n (e: NonCancelableCustomEvent<ExpandableSectionProps.ChangeDetail>) => {\n fireChange(definition, e.detail.expanded);\n setExpanded(e.detail.expanded);\n },\n [definition, fireChange]\n );\n\n useEffect(() => {\n setExpanded(definition.defaultExpanded ?? true);\n }, [definition]);\n\n return (\n <InternalExpandableSection\n variant=\"footer\"\n expanded={expanded}\n onChange={onExpandedChange}\n className={clsx(styles.section, variant === 'section-group' && styles['section--no-ident'])}\n headerText={definition.text}\n >\n <NavigationItemsList\n variant=\"section\"\n items={definition.items}\n fireFollow={fireFollow}\n fireChange={fireChange}\n activeHref={activeHref}\n />\n </InternalExpandableSection>\n );\n}\n\ninterface SectionGroupProps extends BaseItemComponentProps {\n definition: SideNavigationProps.SectionGroup;\n}\n\nfunction SectionGroup({ definition, activeHref, fireFollow, fireChange }: SectionGroupProps) {\n return (\n <div className={styles['section-group']}>\n <InternalBox className={styles['section-group-title']} variant=\"h3\">\n {definition.title}\n </InternalBox>\n <NavigationItemsList\n variant=\"section-group\"\n items={definition.items}\n fireFollow={fireFollow}\n fireChange={fireChange}\n activeHref={activeHref}\n />\n </div>\n );\n}\n\ninterface LinkGroupProps extends BaseItemComponentProps {\n definition: SideNavigationProps.LinkGroup;\n}\n\nfunction LinkGroup({ definition, activeHref, fireFollow, fireChange }: LinkGroupProps) {\n checkSafeUrl('SideNavigation', definition.href);\n\n return (\n <>\n <Link\n definition={{ type: 'link', href: definition.href, text: definition.text, info: definition.info }}\n fireFollow={(_, event) => fireFollow(definition, event)}\n fireChange={fireChange}\n activeHref={activeHref}\n />\n <NavigationItemsList\n variant=\"link-group\"\n items={definition.items}\n fireFollow={fireFollow}\n fireChange={fireChange}\n activeHref={activeHref}\n />\n </>\n );\n}\n\ninterface ExpandableLinkGroupProps extends BaseItemComponentProps {\n definition: SideNavigationProps.ExpandableLinkGroup;\n variant: 'section' | 'section-group' | 'link-group' | 'expandable-link-group' | 'root';\n}\n\nfunction ExpandableLinkGroup({ definition, fireFollow, fireChange, activeHref, variant }: ExpandableLinkGroupProps) {\n // Check whether the definition contains an active link and memoize it to avoid\n // rechecking every time.\n const containsActiveLink = useMemo(() => {\n return activeHref ? hasActiveLink(definition.items, activeHref) : false;\n }, [activeHref, definition.items]);\n\n const [expanded, setExpanded] = useState<boolean>(() => {\n return definition.defaultExpanded ?? (definition.href === activeHref || containsActiveLink);\n });\n\n const [userExpanded, setUserExpanded] = useState<boolean | undefined>();\n\n // Reset user expansion status when the items property is updated.\n useEffect(() => setUserExpanded(undefined), [definition]);\n\n // By default, the expandable section is open when there's an active link inside.\n useEffect(() => {\n setExpanded(definition.href === activeHref || containsActiveLink);\n }, [definition.href, containsActiveLink, activeHref]);\n\n // If the definition object itself is updated, reset the expansion state to default.\n useEffect(() => {\n if (definition.defaultExpanded !== undefined) {\n setExpanded(definition.defaultExpanded);\n }\n }, [definition]);\n\n const onExpandedChange = useCallback(\n (e: NonCancelableCustomEvent<ExpandableSectionProps.ChangeDetail>) => {\n fireChange(definition, e.detail.expanded);\n setUserExpanded(e.detail.expanded);\n },\n [definition, fireChange]\n );\n\n const onHeaderFollow: LinkProps['fireFollow'] = (_, event) => {\n fireFollow(definition, event);\n setUserExpanded(true);\n if (!expanded) {\n fireChange(definition, true);\n }\n };\n\n return (\n <InternalExpandableSection\n className={clsx(\n styles['expandable-link-group'],\n variant === 'section-group' && styles['expandable-link-group--no-ident']\n )}\n variant=\"navigation\"\n expanded={userExpanded ?? expanded}\n onChange={onExpandedChange}\n headerText={\n <Link\n definition={{ type: 'link', href: definition.href, text: definition.text }}\n expanded={userExpanded ?? expanded}\n fireFollow={onHeaderFollow}\n fireChange={fireChange}\n activeHref={activeHref}\n />\n }\n >\n <NavigationItemsList\n variant=\"expandable-link-group\"\n items={definition.items}\n fireFollow={fireFollow}\n fireChange={fireChange}\n activeHref={activeHref}\n />\n </InternalExpandableSection>\n );\n}\n"]}
@@ -1,24 +1,24 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "header-cell": "awsui_header-cell_1spae_f15ng_93",
5
- "header-cell-sticky": "awsui_header-cell-sticky_1spae_f15ng_105",
6
- "header-cell-stuck": "awsui_header-cell-stuck_1spae_f15ng_108",
7
- "header-cell-variant-full-page": "awsui_header-cell-variant-full-page_1spae_f15ng_108",
8
- "header-cell-hidden": "awsui_header-cell-hidden_1spae_f15ng_111",
9
- "header-cell-sortable": "awsui_header-cell-sortable_1spae_f15ng_114",
10
- "header-cell-resizable": "awsui_header-cell-resizable_1spae_f15ng_129",
11
- "sorting-icon": "awsui_sorting-icon_1spae_f15ng_133",
12
- "edit-icon": "awsui_edit-icon_1spae_f15ng_141",
13
- "header-cell-content": "awsui_header-cell-content_1spae_f15ng_147",
14
- "header-cell-fake-focus": "awsui_header-cell-fake-focus_1spae_f15ng_176",
15
- "header-cell-disabled": "awsui_header-cell-disabled_1spae_f15ng_194",
16
- "header-cell-sorted": "awsui_header-cell-sorted_1spae_f15ng_194",
17
- "header-cell-text": "awsui_header-cell-text_1spae_f15ng_208",
18
- "header-cell-text-wrap": "awsui_header-cell-text-wrap_1spae_f15ng_213",
19
- "header-cell-ascending": "awsui_header-cell-ascending_1spae_f15ng_219",
20
- "header-cell-descending": "awsui_header-cell-descending_1spae_f15ng_220",
21
- "is-visual-refresh": "awsui_is-visual-refresh_1spae_f15ng_230",
22
- "has-striped-rows": "awsui_has-striped-rows_1spae_f15ng_241"
4
+ "header-cell": "awsui_header-cell_1spae_12dot_93",
5
+ "header-cell-sticky": "awsui_header-cell-sticky_1spae_12dot_105",
6
+ "header-cell-stuck": "awsui_header-cell-stuck_1spae_12dot_108",
7
+ "header-cell-variant-full-page": "awsui_header-cell-variant-full-page_1spae_12dot_108",
8
+ "header-cell-hidden": "awsui_header-cell-hidden_1spae_12dot_111",
9
+ "header-cell-sortable": "awsui_header-cell-sortable_1spae_12dot_114",
10
+ "header-cell-resizable": "awsui_header-cell-resizable_1spae_12dot_129",
11
+ "sorting-icon": "awsui_sorting-icon_1spae_12dot_133",
12
+ "edit-icon": "awsui_edit-icon_1spae_12dot_141",
13
+ "header-cell-content": "awsui_header-cell-content_1spae_12dot_147",
14
+ "header-cell-fake-focus": "awsui_header-cell-fake-focus_1spae_12dot_176",
15
+ "header-cell-disabled": "awsui_header-cell-disabled_1spae_12dot_194",
16
+ "header-cell-sorted": "awsui_header-cell-sorted_1spae_12dot_194",
17
+ "header-cell-text": "awsui_header-cell-text_1spae_12dot_208",
18
+ "header-cell-text-wrap": "awsui_header-cell-text-wrap_1spae_12dot_213",
19
+ "header-cell-ascending": "awsui_header-cell-ascending_1spae_12dot_219",
20
+ "header-cell-descending": "awsui_header-cell-descending_1spae_12dot_220",
21
+ "is-visual-refresh": "awsui_is-visual-refresh_1spae_12dot_230",
22
+ "has-striped-rows": "awsui_has-striped-rows_1spae_12dot_241"
23
23
  };
24
24
 
@@ -90,7 +90,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
90
90
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
91
91
  SPDX-License-Identifier: Apache-2.0
92
92
  */
93
- .awsui_header-cell_1spae_f15ng_93:not(#\9) {
93
+ .awsui_header-cell_1spae_12dot_93:not(#\9) {
94
94
  position: relative;
95
95
  text-align: left;
96
96
  box-sizing: border-box;
@@ -102,19 +102,19 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
102
102
  -moz-osx-font-smoothing: var(--font-smoothing-moz-osx-nkh1jb, grayscale);
103
103
  padding: var(--space-scaled-xxs-95dhkm, 4px) var(--space-scaled-xs-6859qs, 8px);
104
104
  }
105
- .awsui_header-cell-sticky_1spae_f15ng_105:not(#\9) {
105
+ .awsui_header-cell-sticky_1spae_12dot_105:not(#\9) {
106
106
  border-bottom: var(--border-table-sticky-width-h1tlxy, 2px) solid var(--color-border-divider-default-7s2wjw, #e9ebed);
107
107
  }
108
- .awsui_header-cell-stuck_1spae_f15ng_108:not(#\9):not(.awsui_header-cell-variant-full-page_1spae_f15ng_108) {
108
+ .awsui_header-cell-stuck_1spae_12dot_108:not(#\9):not(.awsui_header-cell-variant-full-page_1spae_12dot_108) {
109
109
  border-bottom-color: transparent;
110
110
  }
111
- .awsui_header-cell-variant-full-page_1spae_f15ng_108.awsui_header-cell-hidden_1spae_f15ng_111:not(#\9) {
111
+ .awsui_header-cell-variant-full-page_1spae_12dot_108.awsui_header-cell-hidden_1spae_12dot_111:not(#\9) {
112
112
  border-bottom-color: transparent;
113
113
  }
114
- .awsui_header-cell_1spae_f15ng_93:not(#\9):last-child, .awsui_header-cell_1spae_f15ng_93.awsui_header-cell-sortable_1spae_f15ng_114:not(#\9) {
114
+ .awsui_header-cell_1spae_12dot_93:not(#\9):last-child, .awsui_header-cell_1spae_12dot_93.awsui_header-cell-sortable_1spae_12dot_114:not(#\9) {
115
115
  padding-right: var(--space-xs-rsr2qu, 8px);
116
116
  }
117
- .awsui_header-cell_1spae_f15ng_93:not(#\9):not(:last-child):before {
117
+ .awsui_header-cell_1spae_12dot_93:not(#\9):not(:last-child):before {
118
118
  content: "";
119
119
  position: absolute;
120
120
  right: 0;
@@ -126,11 +126,11 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
126
126
  border-left: var(--border-divider-section-width-4wm2it, 2px) solid var(--color-border-divider-default-7s2wjw, #e9ebed);
127
127
  box-sizing: border-box;
128
128
  }
129
- .awsui_header-cell-resizable_1spae_f15ng_129:not(#\9):not(:last-child):before {
130
- border-left-color: var(--color-border-divider-interactive-default-0hdcst, #414d5c);
129
+ .awsui_header-cell-resizable_1spae_12dot_129:not(#\9):not(:last-child):before {
130
+ border-left-color: var(--color-border-divider-interactive-default-4pf6ra, #7d8998);
131
131
  }
132
132
 
133
- .awsui_sorting-icon_1spae_f15ng_133:not(#\9) {
133
+ .awsui_sorting-icon_1spae_12dot_133:not(#\9) {
134
134
  position: absolute;
135
135
  top: 50%;
136
136
  transform: translateY(-50%);
@@ -138,31 +138,31 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
138
138
  color: var(--color-text-column-sorting-icon-q5sr09, #414d5c);
139
139
  }
140
140
 
141
- .awsui_edit-icon_1spae_f15ng_141:not(#\9) {
141
+ .awsui_edit-icon_1spae_12dot_141:not(#\9) {
142
142
  margin-left: var(--space-xxs-ynfts5, 4px);
143
143
  margin-top: var(--space-scaled-xxs-95dhkm, 4px);
144
144
  color: inherit;
145
145
  }
146
146
 
147
- .awsui_header-cell-content_1spae_f15ng_147:not(#\9) {
147
+ .awsui_header-cell-content_1spae_12dot_147:not(#\9) {
148
148
  position: relative;
149
149
  padding: var(--space-scaled-xxs-95dhkm, 4px) var(--space-s-hv8c1d, 12px);
150
150
  }
151
- .awsui_header-cell-sortable_1spae_f15ng_114 > .awsui_header-cell-content_1spae_f15ng_147:not(#\9) {
151
+ .awsui_header-cell-sortable_1spae_12dot_114 > .awsui_header-cell-content_1spae_12dot_147:not(#\9) {
152
152
  padding-right: calc(var(--space-xl-a39hup, 24px) + var(--space-xxs-ynfts5, 4px));
153
153
  }
154
- .awsui_header-cell-content_1spae_f15ng_147:not(#\9):focus {
154
+ .awsui_header-cell-content_1spae_12dot_147:not(#\9):focus {
155
155
  outline: none;
156
156
  text-decoration: none;
157
157
  }
158
- body[data-awsui-focus-visible=true] .awsui_header-cell-content_1spae_f15ng_147:not(#\9):focus {
158
+ body[data-awsui-focus-visible=true] .awsui_header-cell-content_1spae_12dot_147:not(#\9):focus {
159
159
  position: relative;
160
160
  }
161
- body[data-awsui-focus-visible=true] .awsui_header-cell-content_1spae_f15ng_147:not(#\9):focus {
161
+ body[data-awsui-focus-visible=true] .awsui_header-cell-content_1spae_12dot_147:not(#\9):focus {
162
162
  outline: 2px dotted transparent;
163
163
  outline-offset: calc(var(--space-table-header-focus-outline-gutter-rbx7m7, 0px) - 1px);
164
164
  }
165
- body[data-awsui-focus-visible=true] .awsui_header-cell-content_1spae_f15ng_147:not(#\9):focus::before {
165
+ body[data-awsui-focus-visible=true] .awsui_header-cell-content_1spae_12dot_147:not(#\9):focus::before {
166
166
  content: " ";
167
167
  display: block;
168
168
  position: absolute;
@@ -173,14 +173,14 @@ body[data-awsui-focus-visible=true] .awsui_header-cell-content_1spae_f15ng_147:n
173
173
  border-radius: var(--border-radius-control-default-focus-ring-7661kz, 4px);
174
174
  box-shadow: 0 0 0 2px var(--color-border-item-focused-ap3b6s, #0972d3);
175
175
  }
176
- body[data-awsui-focus-visible=true] .awsui_header-cell-content_1spae_f15ng_147.awsui_header-cell-fake-focus_1spae_f15ng_176:not(#\9) {
176
+ body[data-awsui-focus-visible=true] .awsui_header-cell-content_1spae_12dot_147.awsui_header-cell-fake-focus_1spae_12dot_176:not(#\9) {
177
177
  position: relative;
178
178
  }
179
- body[data-awsui-focus-visible=true] .awsui_header-cell-content_1spae_f15ng_147.awsui_header-cell-fake-focus_1spae_f15ng_176:not(#\9) {
179
+ body[data-awsui-focus-visible=true] .awsui_header-cell-content_1spae_12dot_147.awsui_header-cell-fake-focus_1spae_12dot_176:not(#\9) {
180
180
  outline: 2px dotted transparent;
181
181
  outline-offset: calc(var(--space-table-header-focus-outline-gutter-rbx7m7, 0px) - 1px);
182
182
  }
183
- body[data-awsui-focus-visible=true] .awsui_header-cell-content_1spae_f15ng_147.awsui_header-cell-fake-focus_1spae_f15ng_176:not(#\9)::before {
183
+ body[data-awsui-focus-visible=true] .awsui_header-cell-content_1spae_12dot_147.awsui_header-cell-fake-focus_1spae_12dot_176:not(#\9)::before {
184
184
  content: " ";
185
185
  display: block;
186
186
  position: absolute;
@@ -191,33 +191,33 @@ body[data-awsui-focus-visible=true] .awsui_header-cell-content_1spae_f15ng_147.a
191
191
  border-radius: var(--border-radius-control-default-focus-ring-7661kz, 4px);
192
192
  box-shadow: 0 0 0 2px var(--color-border-item-focused-ap3b6s, #0972d3);
193
193
  }
194
- .awsui_header-cell-disabled_1spae_f15ng_194.awsui_header-cell-sorted_1spae_f15ng_194 > .awsui_header-cell-content_1spae_f15ng_147 > .awsui_sorting-icon_1spae_f15ng_133:not(#\9) {
194
+ .awsui_header-cell-disabled_1spae_12dot_194.awsui_header-cell-sorted_1spae_12dot_194 > .awsui_header-cell-content_1spae_12dot_147 > .awsui_sorting-icon_1spae_12dot_133:not(#\9) {
195
195
  color: var(--color-text-interactive-disabled-3pbb07, #9ba7b6);
196
196
  }
197
197
 
198
- .awsui_header-cell-sortable_1spae_f15ng_114:not(#\9):not(.awsui_header-cell-disabled_1spae_f15ng_194) > .awsui_header-cell-content_1spae_f15ng_147 {
198
+ .awsui_header-cell-sortable_1spae_12dot_114:not(#\9):not(.awsui_header-cell-disabled_1spae_12dot_194) > .awsui_header-cell-content_1spae_12dot_147 {
199
199
  cursor: pointer;
200
200
  }
201
- .awsui_header-cell-sortable_1spae_f15ng_114:not(#\9):not(.awsui_header-cell-disabled_1spae_f15ng_194) > .awsui_header-cell-content_1spae_f15ng_147:hover, .awsui_header-cell-sortable_1spae_f15ng_114:not(#\9):not(.awsui_header-cell-disabled_1spae_f15ng_194).awsui_header-cell-sorted_1spae_f15ng_194 > .awsui_header-cell-content_1spae_f15ng_147 {
201
+ .awsui_header-cell-sortable_1spae_12dot_114:not(#\9):not(.awsui_header-cell-disabled_1spae_12dot_194) > .awsui_header-cell-content_1spae_12dot_147:hover, .awsui_header-cell-sortable_1spae_12dot_114:not(#\9):not(.awsui_header-cell-disabled_1spae_12dot_194).awsui_header-cell-sorted_1spae_12dot_194 > .awsui_header-cell-content_1spae_12dot_147 {
202
202
  color: var(--color-text-interactive-active-vol84d, #000716);
203
203
  }
204
- .awsui_header-cell-sortable_1spae_f15ng_114:not(#\9):not(.awsui_header-cell-disabled_1spae_f15ng_194) > .awsui_header-cell-content_1spae_f15ng_147:hover > .awsui_sorting-icon_1spae_f15ng_133, .awsui_header-cell-sortable_1spae_f15ng_114:not(#\9):not(.awsui_header-cell-disabled_1spae_f15ng_194).awsui_header-cell-sorted_1spae_f15ng_194 > .awsui_header-cell-content_1spae_f15ng_147 > .awsui_sorting-icon_1spae_f15ng_133 {
204
+ .awsui_header-cell-sortable_1spae_12dot_114:not(#\9):not(.awsui_header-cell-disabled_1spae_12dot_194) > .awsui_header-cell-content_1spae_12dot_147:hover > .awsui_sorting-icon_1spae_12dot_133, .awsui_header-cell-sortable_1spae_12dot_114:not(#\9):not(.awsui_header-cell-disabled_1spae_12dot_194).awsui_header-cell-sorted_1spae_12dot_194 > .awsui_header-cell-content_1spae_12dot_147 > .awsui_sorting-icon_1spae_12dot_133 {
205
205
  color: var(--color-text-interactive-active-vol84d, #000716);
206
206
  }
207
207
 
208
- .awsui_header-cell-text_1spae_f15ng_208:not(#\9) {
208
+ .awsui_header-cell-text_1spae_12dot_208:not(#\9) {
209
209
  line-height: var(--font-heading-xs-line-height-5x131j, 18px);
210
210
  padding-top: calc(var(--space-xxxs-k2w98v, 2px) / 2);
211
211
  padding-bottom: calc(var(--space-xxxs-k2w98v, 2px) / 2);
212
212
  }
213
- .awsui_header-cell-text_1spae_f15ng_208:not(#\9):not(.awsui_header-cell-text-wrap_1spae_f15ng_213) {
213
+ .awsui_header-cell-text_1spae_12dot_208:not(#\9):not(.awsui_header-cell-text-wrap_1spae_12dot_213) {
214
214
  white-space: nowrap;
215
215
  overflow: hidden;
216
216
  text-overflow: ellipsis;
217
217
  }
218
218
 
219
- .awsui_header-cell-ascending_1spae_f15ng_219:not(#\9),
220
- .awsui_header-cell-descending_1spae_f15ng_220:not(#\9) {
219
+ .awsui_header-cell-ascending_1spae_12dot_219:not(#\9),
220
+ .awsui_header-cell-descending_1spae_12dot_220:not(#\9) {
221
221
  /* used in test-utils */
222
222
  }
223
223
 
@@ -227,26 +227,26 @@ with the left edge of the table as closely as possible. If the
227
227
  last header cell is sortable the sort icon should align with the
228
228
  settings icon in the pagination slot.
229
229
  */
230
- .awsui_header-cell_1spae_f15ng_93:not(#\9):not(.awsui_is-visual-refresh_1spae_f15ng_230):first-child {
230
+ .awsui_header-cell_1spae_12dot_93:not(#\9):not(.awsui_is-visual-refresh_1spae_12dot_230):first-child {
231
231
  padding-left: var(--space-xs-rsr2qu, 8px);
232
232
  }
233
233
 
234
- .awsui_header-cell_1spae_f15ng_93.awsui_is-visual-refresh_1spae_f15ng_230:not(#\9) {
234
+ .awsui_header-cell_1spae_12dot_93.awsui_is-visual-refresh_1spae_12dot_230:not(#\9) {
235
235
  /*
236
236
  Striped rows requires additional left padding because the
237
237
  shaded background makes the child content appear too close
238
238
  to the table edge.
239
239
  */
240
240
  }
241
- .awsui_header-cell_1spae_f15ng_93.awsui_is-visual-refresh_1spae_f15ng_230:not(#\9):first-child:not(.awsui_has-striped-rows_1spae_f15ng_241) {
241
+ .awsui_header-cell_1spae_12dot_93.awsui_is-visual-refresh_1spae_12dot_230:not(#\9):first-child:not(.awsui_has-striped-rows_1spae_12dot_241) {
242
242
  padding-left: var(--space-xxxs-k2w98v, 2px);
243
243
  }
244
- .awsui_header-cell_1spae_f15ng_93.awsui_is-visual-refresh_1spae_f15ng_230:not(#\9):first-child.awsui_has-striped-rows_1spae_f15ng_241 {
244
+ .awsui_header-cell_1spae_12dot_93.awsui_is-visual-refresh_1spae_12dot_230:not(#\9):first-child.awsui_has-striped-rows_1spae_12dot_241 {
245
245
  padding-left: var(--space-xxs-ynfts5, 4px);
246
246
  }
247
- .awsui_header-cell_1spae_f15ng_93.awsui_is-visual-refresh_1spae_f15ng_230:not(#\9):first-child > .awsui_header-cell-content_1spae_f15ng_147 {
247
+ .awsui_header-cell_1spae_12dot_93.awsui_is-visual-refresh_1spae_12dot_230:not(#\9):first-child > .awsui_header-cell-content_1spae_12dot_147 {
248
248
  padding-left: 0;
249
249
  }
250
- .awsui_header-cell_1spae_f15ng_93.awsui_is-visual-refresh_1spae_f15ng_230:not(#\9):last-child.awsui_header-cell-sortable_1spae_f15ng_114 {
250
+ .awsui_header-cell_1spae_12dot_93.awsui_is-visual-refresh_1spae_12dot_230:not(#\9):last-child.awsui_header-cell-sortable_1spae_12dot_114 {
251
251
  padding-right: var(--space-xxxs-k2w98v, 2px);
252
252
  }
@@ -2,24 +2,24 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "header-cell": "awsui_header-cell_1spae_f15ng_93",
6
- "header-cell-sticky": "awsui_header-cell-sticky_1spae_f15ng_105",
7
- "header-cell-stuck": "awsui_header-cell-stuck_1spae_f15ng_108",
8
- "header-cell-variant-full-page": "awsui_header-cell-variant-full-page_1spae_f15ng_108",
9
- "header-cell-hidden": "awsui_header-cell-hidden_1spae_f15ng_111",
10
- "header-cell-sortable": "awsui_header-cell-sortable_1spae_f15ng_114",
11
- "header-cell-resizable": "awsui_header-cell-resizable_1spae_f15ng_129",
12
- "sorting-icon": "awsui_sorting-icon_1spae_f15ng_133",
13
- "edit-icon": "awsui_edit-icon_1spae_f15ng_141",
14
- "header-cell-content": "awsui_header-cell-content_1spae_f15ng_147",
15
- "header-cell-fake-focus": "awsui_header-cell-fake-focus_1spae_f15ng_176",
16
- "header-cell-disabled": "awsui_header-cell-disabled_1spae_f15ng_194",
17
- "header-cell-sorted": "awsui_header-cell-sorted_1spae_f15ng_194",
18
- "header-cell-text": "awsui_header-cell-text_1spae_f15ng_208",
19
- "header-cell-text-wrap": "awsui_header-cell-text-wrap_1spae_f15ng_213",
20
- "header-cell-ascending": "awsui_header-cell-ascending_1spae_f15ng_219",
21
- "header-cell-descending": "awsui_header-cell-descending_1spae_f15ng_220",
22
- "is-visual-refresh": "awsui_is-visual-refresh_1spae_f15ng_230",
23
- "has-striped-rows": "awsui_has-striped-rows_1spae_f15ng_241"
5
+ "header-cell": "awsui_header-cell_1spae_12dot_93",
6
+ "header-cell-sticky": "awsui_header-cell-sticky_1spae_12dot_105",
7
+ "header-cell-stuck": "awsui_header-cell-stuck_1spae_12dot_108",
8
+ "header-cell-variant-full-page": "awsui_header-cell-variant-full-page_1spae_12dot_108",
9
+ "header-cell-hidden": "awsui_header-cell-hidden_1spae_12dot_111",
10
+ "header-cell-sortable": "awsui_header-cell-sortable_1spae_12dot_114",
11
+ "header-cell-resizable": "awsui_header-cell-resizable_1spae_12dot_129",
12
+ "sorting-icon": "awsui_sorting-icon_1spae_12dot_133",
13
+ "edit-icon": "awsui_edit-icon_1spae_12dot_141",
14
+ "header-cell-content": "awsui_header-cell-content_1spae_12dot_147",
15
+ "header-cell-fake-focus": "awsui_header-cell-fake-focus_1spae_12dot_176",
16
+ "header-cell-disabled": "awsui_header-cell-disabled_1spae_12dot_194",
17
+ "header-cell-sorted": "awsui_header-cell-sorted_1spae_12dot_194",
18
+ "header-cell-text": "awsui_header-cell-text_1spae_12dot_208",
19
+ "header-cell-text-wrap": "awsui_header-cell-text-wrap_1spae_12dot_213",
20
+ "header-cell-ascending": "awsui_header-cell-ascending_1spae_12dot_219",
21
+ "header-cell-descending": "awsui_header-cell-descending_1spae_12dot_220",
22
+ "is-visual-refresh": "awsui_is-visual-refresh_1spae_12dot_230",
23
+ "has-striped-rows": "awsui_has-striped-rows_1spae_12dot_241"
24
24
  };
25
25
 
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"lib/default/","sources":["table/internal.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAc,MAAM,cAAc,CAAC;AAkC/D,QAAA,MAAM,aAAa,qBAiZK,CAAC;AAEzB,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"lib/default/","sources":["table/internal.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAc,MAAM,cAAc,CAAC;AAoC/D,QAAA,MAAM,aAAa,qBA4ZK,CAAC;AAEzB,eAAe,aAAa,CAAC"}
package/table/internal.js CHANGED
@@ -31,9 +31,12 @@ import { useDynamicOverlap } from '../internal/hooks/use-dynamic-overlap';
31
31
  import LiveRegion from '../internal/components/live-region';
32
32
  import useTableFocusNavigation from './use-table-focus-navigation';
33
33
  import { TableTdElement } from './body-cell/td-element';
34
+ import { useMobile } from '../internal/hooks/use-mobile';
34
35
  const InternalTable = React.forwardRef((_a, ref) => {
36
+ var _b, _c;
35
37
  var { header, footer, empty, filter, pagination, preferences, items, columnDefinitions, trackBy, loading, loadingText, selectionType, selectedItems, isItemDisabled, ariaLabels, onSelectionChange, onSortingChange, sortingColumn, sortingDescending, sortingDisabled, visibleColumns, stickyHeader, stickyHeaderVerticalOffset, onRowClick, onRowContextMenu, wrapLines, stripedRows, contentDensity, submitEdit, onEditCancel, resizableColumns, onColumnWidthsChange, variant, __internalRootRef, totalItemsCount, firstIndex, renderAriaLive, columnDisplay } = _a, rest = __rest(_a, ["header", "footer", "empty", "filter", "pagination", "preferences", "items", "columnDefinitions", "trackBy", "loading", "loadingText", "selectionType", "selectedItems", "isItemDisabled", "ariaLabels", "onSelectionChange", "onSortingChange", "sortingColumn", "sortingDescending", "sortingDisabled", "visibleColumns", "stickyHeader", "stickyHeaderVerticalOffset", "onRowClick", "onRowContextMenu", "wrapLines", "stripedRows", "contentDensity", "submitEdit", "onEditCancel", "resizableColumns", "onColumnWidthsChange", "variant", "__internalRootRef", "totalItemsCount", "firstIndex", "renderAriaLive", "columnDisplay"]);
36
38
  const baseProps = getBaseProps(rest);
39
+ const isMobile = useMobile();
37
40
  stickyHeader = stickyHeader && supportsStickyPosition();
38
41
  const [containerWidth, wrapperMeasureRef] = useContainerQuery(({ width }) => width);
39
42
  const wrapperRefObject = useRef(null);
@@ -136,13 +139,16 @@ const InternalTable = React.forwardRef((_a, ref) => {
136
139
  const hasDynamicHeight = computedVariant === 'full-page';
137
140
  const overlapElement = useDynamicOverlap({ disabled: !hasDynamicHeight });
138
141
  useTableFocusNavigation(selectionType, tableRefObject, visibleColumnDefinitions, items === null || items === void 0 ? void 0 : items.length);
142
+ const toolsHeaderWrapper = useRef(null);
143
+ // If is mobile we subtract the tools wrapper height so only the table header is sticky
144
+ const mobileStickyOffset = (_c = (_b = toolsHeaderWrapper === null || toolsHeaderWrapper === void 0 ? void 0 : toolsHeaderWrapper.current) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect().height) !== null && _c !== void 0 ? _c : 0;
139
145
  return (React.createElement(ColumnWidthsProvider, { tableRef: tableRefObject, visibleColumnDefinitions: visibleColumnDefinitions, resizableColumns: resizableColumns, hasSelection: hasSelection },
140
146
  React.createElement(InternalContainer, Object.assign({}, baseProps, { __internalRootRef: __internalRootRef, className: clsx(baseProps.className, styles.root), header: React.createElement(React.Fragment, null,
141
147
  hasHeader && (React.createElement("div", { ref: overlapElement, className: clsx(hasDynamicHeight && [styles['dark-header'], 'awsui-context-content-header']) },
142
- React.createElement("div", { className: clsx(styles['header-controls'], styles[`variant-${computedVariant}`]) },
148
+ React.createElement("div", { ref: toolsHeaderWrapper, className: clsx(styles['header-controls'], styles[`variant-${computedVariant}`]) },
143
149
  React.createElement(ToolsHeader, { header: header, filter: filter, pagination: pagination, preferences: preferences })))),
144
- stickyHeader && (React.createElement(StickyHeader, { ref: stickyHeaderRef, variant: computedVariant, theadProps: theadProps, wrapperRef: wrapperRefObject, theadRef: theadRef, secondaryWrapperRef: secondaryWrapperRef, tableRef: tableRefObject, onScroll: handleScroll, tableHasHeader: hasHeader, contentDensity: contentDensity }))), disableHeaderPaddings: true, disableContentPaddings: true, variant: toContainerVariant(computedVariant), __disableFooterPaddings: true, __disableFooterDivider: true, footer: footer && (React.createElement("div", { className: clsx(styles['footer-wrapper'], styles[`variant-${computedVariant}`]) },
145
- React.createElement("div", { className: styles.footer }, footer))), __stickyHeader: stickyHeader, __stickyOffset: stickyHeaderVerticalOffset }, focusMarkers.root),
150
+ stickyHeader && (React.createElement(StickyHeader, { ref: stickyHeaderRef, variant: computedVariant, theadProps: theadProps, wrapperRef: wrapperRefObject, theadRef: theadRef, secondaryWrapperRef: secondaryWrapperRef, tableRef: tableRefObject, onScroll: handleScroll, tableHasHeader: hasHeader, contentDensity: contentDensity }))), disableHeaderPaddings: true, disableContentPaddings: true, variant: toContainerVariant(computedVariant), __disableFooterPaddings: true, __disableFooterDivider: true, __disableStickyMobile: false, footer: footer && (React.createElement("div", { className: clsx(styles['footer-wrapper'], styles[`variant-${computedVariant}`]) },
151
+ React.createElement("div", { className: styles.footer }, footer))), __stickyHeader: stickyHeader, __stickyOffset: isMobile ? (stickyHeaderVerticalOffset !== null && stickyHeaderVerticalOffset !== void 0 ? stickyHeaderVerticalOffset : 0) - mobileStickyOffset : stickyHeaderVerticalOffset }, focusMarkers.root),
146
152
  React.createElement("div", Object.assign({ ref: wrapperRef, className: clsx(styles.wrapper, styles[`variant-${computedVariant}`], {
147
153
  [styles['has-footer']]: hasFooter,
148
154
  [styles['has-header']]: hasHeader,