@cloudscape-design/components-themeable 3.0.400 → 3.0.402

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 (197) hide show
  1. package/lib/internal/manifest.json +1 -1
  2. package/lib/internal/scss/anchor-navigation/styles.scss +113 -0
  3. package/lib/internal/scss/anchor-navigation/test-classes/styles.scss +28 -0
  4. package/lib/internal/scss/internal/components/dropdown/styles.scss +2 -0
  5. package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +40 -39
  6. package/lib/internal/scss/internal/styles/utils/mixins.scss +2 -8
  7. package/lib/internal/scss/status-indicator/styles.scss +11 -7
  8. package/lib/internal/template/anchor-navigation/index.d.ts +5 -0
  9. package/lib/internal/template/anchor-navigation/index.d.ts.map +1 -0
  10. package/lib/internal/template/anchor-navigation/index.js +14 -0
  11. package/lib/internal/template/anchor-navigation/index.js.map +1 -0
  12. package/lib/internal/template/anchor-navigation/interfaces.d.ts +67 -0
  13. package/lib/internal/template/anchor-navigation/interfaces.d.ts.map +1 -0
  14. package/lib/internal/template/anchor-navigation/interfaces.js +4 -0
  15. package/lib/internal/template/anchor-navigation/interfaces.js.map +1 -0
  16. package/lib/internal/template/anchor-navigation/internal.d.ts +5 -0
  17. package/lib/internal/template/anchor-navigation/internal.d.ts.map +1 -0
  18. package/lib/internal/template/anchor-navigation/internal.js +48 -0
  19. package/lib/internal/template/anchor-navigation/internal.js.map +1 -0
  20. package/lib/internal/template/anchor-navigation/styles.css.js +13 -0
  21. package/lib/internal/template/anchor-navigation/styles.scoped.css +243 -0
  22. package/lib/internal/template/anchor-navigation/styles.selectors.js +14 -0
  23. package/lib/internal/template/anchor-navigation/test-classes/styles.css.js +11 -0
  24. package/lib/internal/template/anchor-navigation/test-classes/styles.scoped.css +27 -0
  25. package/lib/internal/template/anchor-navigation/test-classes/styles.selectors.js +12 -0
  26. package/lib/internal/template/anchor-navigation/use-scroll-spy.d.ts +18 -0
  27. package/lib/internal/template/anchor-navigation/use-scroll-spy.d.ts.map +1 -0
  28. package/lib/internal/template/anchor-navigation/use-scroll-spy.js +74 -0
  29. package/lib/internal/template/anchor-navigation/use-scroll-spy.js.map +1 -0
  30. package/lib/internal/template/annotation-context/annotation/styles.css.js +24 -24
  31. package/lib/internal/template/annotation-context/annotation/styles.scoped.css +30 -30
  32. package/lib/internal/template/annotation-context/annotation/styles.selectors.js +24 -24
  33. package/lib/internal/template/app-layout/notifications/styles.css.js +3 -3
  34. package/lib/internal/template/app-layout/notifications/styles.scoped.css +7 -7
  35. package/lib/internal/template/app-layout/notifications/styles.selectors.js +3 -3
  36. package/lib/internal/template/app-layout/visual-refresh/styles.css.js +75 -75
  37. package/lib/internal/template/app-layout/visual-refresh/styles.scoped.css +295 -295
  38. package/lib/internal/template/app-layout/visual-refresh/styles.selectors.js +75 -75
  39. package/lib/internal/template/button/styles.css.js +20 -20
  40. package/lib/internal/template/button/styles.scoped.css +151 -152
  41. package/lib/internal/template/button/styles.selectors.js +20 -20
  42. package/lib/internal/template/button-dropdown/item-element/styles.css.js +15 -15
  43. package/lib/internal/template/button-dropdown/item-element/styles.scoped.css +18 -19
  44. package/lib/internal/template/button-dropdown/item-element/styles.selectors.js +15 -15
  45. package/lib/internal/template/cards/index.js +2 -2
  46. package/lib/internal/template/cards/index.js.map +1 -1
  47. package/lib/internal/template/code-editor/styles.css.js +32 -32
  48. package/lib/internal/template/code-editor/styles.scoped.css +177 -179
  49. package/lib/internal/template/code-editor/styles.selectors.js +32 -32
  50. package/lib/internal/template/collection-preferences/content-display/styles.css.js +11 -11
  51. package/lib/internal/template/collection-preferences/content-display/styles.scoped.css +17 -18
  52. package/lib/internal/template/collection-preferences/content-display/styles.selectors.js +11 -11
  53. package/lib/internal/template/collection-preferences/styles.css.js +37 -37
  54. package/lib/internal/template/collection-preferences/styles.scoped.css +44 -45
  55. package/lib/internal/template/collection-preferences/styles.selectors.js +37 -37
  56. package/lib/internal/template/container/index.d.ts.map +1 -1
  57. package/lib/internal/template/container/index.js +2 -2
  58. package/lib/internal/template/container/index.js.map +1 -1
  59. package/lib/internal/template/container/internal.d.ts +5 -1
  60. package/lib/internal/template/container/internal.d.ts.map +1 -1
  61. package/lib/internal/template/container/internal.js +7 -4
  62. package/lib/internal/template/container/internal.js.map +1 -1
  63. package/lib/internal/template/content-layout/styles.css.js +7 -7
  64. package/lib/internal/template/content-layout/styles.scoped.css +13 -13
  65. package/lib/internal/template/content-layout/styles.selectors.js +7 -7
  66. package/lib/internal/template/expandable-section/expandable-section-container.d.ts +5 -3
  67. package/lib/internal/template/expandable-section/expandable-section-container.d.ts.map +1 -1
  68. package/lib/internal/template/expandable-section/expandable-section-container.js +2 -2
  69. package/lib/internal/template/expandable-section/expandable-section-container.js.map +1 -1
  70. package/lib/internal/template/expandable-section/index.d.ts.map +1 -1
  71. package/lib/internal/template/expandable-section/index.js +8 -3
  72. package/lib/internal/template/expandable-section/index.js.map +1 -1
  73. package/lib/internal/template/expandable-section/internal.d.ts +3 -3
  74. package/lib/internal/template/expandable-section/internal.d.ts.map +1 -1
  75. package/lib/internal/template/expandable-section/internal.js +2 -2
  76. package/lib/internal/template/expandable-section/internal.js.map +1 -1
  77. package/lib/internal/template/expandable-section/styles.css.js +29 -29
  78. package/lib/internal/template/expandable-section/styles.scoped.css +58 -59
  79. package/lib/internal/template/expandable-section/styles.selectors.js +29 -29
  80. package/lib/internal/template/flashbar/styles.css.js +47 -47
  81. package/lib/internal/template/flashbar/styles.scoped.css +171 -172
  82. package/lib/internal/template/flashbar/styles.selectors.js +47 -47
  83. package/lib/internal/template/form-field/styles.css.js +19 -19
  84. package/lib/internal/template/form-field/styles.scoped.css +29 -30
  85. package/lib/internal/template/form-field/styles.selectors.js +19 -19
  86. package/lib/internal/template/header/styles.css.js +32 -32
  87. package/lib/internal/template/header/styles.scoped.css +48 -49
  88. package/lib/internal/template/header/styles.selectors.js +32 -32
  89. package/lib/internal/template/index.d.ts +1 -0
  90. package/lib/internal/template/index.d.ts.map +1 -1
  91. package/lib/internal/template/index.js +1 -0
  92. package/lib/internal/template/index.js.map +1 -1
  93. package/lib/internal/template/internal/analytics/components/analytics-funnel.d.ts +3 -2
  94. package/lib/internal/template/internal/analytics/components/analytics-funnel.d.ts.map +1 -1
  95. package/lib/internal/template/internal/analytics/components/analytics-funnel.js +20 -5
  96. package/lib/internal/template/internal/analytics/components/analytics-funnel.js.map +1 -1
  97. package/lib/internal/template/internal/analytics/hooks/use-funnel.d.ts.map +1 -1
  98. package/lib/internal/template/internal/analytics/hooks/use-funnel.js +2 -1
  99. package/lib/internal/template/internal/analytics/hooks/use-funnel.js.map +1 -1
  100. package/lib/internal/template/internal/components/abstract-switch/styles.css.js +13 -13
  101. package/lib/internal/template/internal/components/abstract-switch/styles.scoped.css +19 -21
  102. package/lib/internal/template/internal/components/abstract-switch/styles.selectors.js +13 -13
  103. package/lib/internal/template/internal/components/dropdown/dropdown-fit-handler.d.ts +31 -2
  104. package/lib/internal/template/internal/components/dropdown/dropdown-fit-handler.d.ts.map +1 -1
  105. package/lib/internal/template/internal/components/dropdown/dropdown-fit-handler.js +49 -7
  106. package/lib/internal/template/internal/components/dropdown/dropdown-fit-handler.js.map +1 -1
  107. package/lib/internal/template/internal/components/dropdown/index.d.ts.map +1 -1
  108. package/lib/internal/template/internal/components/dropdown/index.js +20 -2
  109. package/lib/internal/template/internal/components/dropdown/index.js.map +1 -1
  110. package/lib/internal/template/internal/components/dropdown/styles.css.js +21 -21
  111. package/lib/internal/template/internal/components/dropdown/styles.scoped.css +37 -36
  112. package/lib/internal/template/internal/components/dropdown/styles.selectors.js +21 -21
  113. package/lib/internal/template/internal/components/menu-dropdown/styles.css.js +7 -7
  114. package/lib/internal/template/internal/components/menu-dropdown/styles.scoped.css +13 -14
  115. package/lib/internal/template/internal/components/menu-dropdown/styles.selectors.js +7 -7
  116. package/lib/internal/template/internal/components/option/styles.css.js +17 -17
  117. package/lib/internal/template/internal/components/option/styles.scoped.css +29 -30
  118. package/lib/internal/template/internal/components/option/styles.selectors.js +17 -17
  119. package/lib/internal/template/internal/environment.js +1 -1
  120. package/lib/internal/template/internal/environment.json +1 -1
  121. package/lib/internal/template/internal/generated/custom-css-properties/index.d.ts.map +1 -1
  122. package/lib/internal/template/internal/generated/custom-css-properties/index.js +40 -39
  123. package/lib/internal/template/internal/generated/custom-css-properties/index.js.map +1 -1
  124. package/lib/internal/template/internal/utils/scrollable-containers.d.ts +6 -1
  125. package/lib/internal/template/internal/utils/scrollable-containers.d.ts.map +1 -1
  126. package/lib/internal/template/internal/utils/scrollable-containers.js +1 -1
  127. package/lib/internal/template/internal/utils/scrollable-containers.js.map +1 -1
  128. package/lib/internal/template/modal/internal.d.ts.map +1 -1
  129. package/lib/internal/template/modal/internal.js +6 -4
  130. package/lib/internal/template/modal/internal.js.map +1 -1
  131. package/lib/internal/template/package.json +1 -0
  132. package/lib/internal/template/progress-bar/styles.css.js +18 -18
  133. package/lib/internal/template/progress-bar/styles.scoped.css +32 -33
  134. package/lib/internal/template/progress-bar/styles.selectors.js +18 -18
  135. package/lib/internal/template/property-filter/styles.css.js +30 -30
  136. package/lib/internal/template/property-filter/styles.scoped.css +32 -33
  137. package/lib/internal/template/property-filter/styles.selectors.js +30 -30
  138. package/lib/internal/template/side-navigation/styles.css.js +28 -28
  139. package/lib/internal/template/side-navigation/styles.scoped.css +38 -39
  140. package/lib/internal/template/side-navigation/styles.selectors.js +28 -28
  141. package/lib/internal/template/split-panel/styles.css.js +56 -56
  142. package/lib/internal/template/split-panel/styles.scoped.css +77 -78
  143. package/lib/internal/template/split-panel/styles.selectors.js +56 -56
  144. package/lib/internal/template/status-indicator/internal.d.ts.map +1 -1
  145. package/lib/internal/template/status-indicator/internal.js +3 -1
  146. package/lib/internal/template/status-indicator/internal.js.map +1 -1
  147. package/lib/internal/template/status-indicator/styles.css.js +22 -22
  148. package/lib/internal/template/status-indicator/styles.scoped.css +36 -34
  149. package/lib/internal/template/status-indicator/styles.selectors.js +22 -22
  150. package/lib/internal/template/table/header-cell/index.d.ts +1 -4
  151. package/lib/internal/template/table/header-cell/index.d.ts.map +1 -1
  152. package/lib/internal/template/table/header-cell/index.js +2 -2
  153. package/lib/internal/template/table/header-cell/index.js.map +1 -1
  154. package/lib/internal/template/table/index.d.ts.map +1 -1
  155. package/lib/internal/template/table/index.js +8 -4
  156. package/lib/internal/template/table/index.js.map +1 -1
  157. package/lib/internal/template/table/internal.d.ts +1 -0
  158. package/lib/internal/template/table/internal.d.ts.map +1 -1
  159. package/lib/internal/template/table/internal.js +9 -10
  160. package/lib/internal/template/table/internal.js.map +1 -1
  161. package/lib/internal/template/table/resizer/index.d.ts +3 -6
  162. package/lib/internal/template/table/resizer/index.d.ts.map +1 -1
  163. package/lib/internal/template/table/resizer/index.js +59 -119
  164. package/lib/internal/template/table/resizer/index.js.map +1 -1
  165. package/lib/internal/template/table/resizer/resizer-lookup.d.ts +8 -0
  166. package/lib/internal/template/table/resizer/resizer-lookup.d.ts.map +1 -0
  167. package/lib/internal/template/table/resizer/resizer-lookup.js +39 -0
  168. package/lib/internal/template/table/resizer/resizer-lookup.js.map +1 -0
  169. package/lib/internal/template/table/sticky-columns/utils.js +2 -2
  170. package/lib/internal/template/table/sticky-columns/utils.js.map +1 -1
  171. package/lib/internal/template/table/thead.d.ts +0 -1
  172. package/lib/internal/template/table/thead.d.ts.map +1 -1
  173. package/lib/internal/template/table/thead.js +2 -2
  174. package/lib/internal/template/table/thead.js.map +1 -1
  175. package/lib/internal/template/tabs/styles.css.js +21 -21
  176. package/lib/internal/template/tabs/styles.scoped.css +39 -40
  177. package/lib/internal/template/tabs/styles.selectors.js +21 -21
  178. package/lib/internal/template/test-utils/dom/anchor-navigation/index.d.ts +16 -0
  179. package/lib/internal/template/test-utils/dom/anchor-navigation/index.js +58 -0
  180. package/lib/internal/template/test-utils/dom/anchor-navigation/index.js.map +1 -0
  181. package/lib/internal/template/test-utils/dom/index.d.ts +3 -0
  182. package/lib/internal/template/test-utils/dom/index.js +10 -2
  183. package/lib/internal/template/test-utils/dom/index.js.map +1 -1
  184. package/lib/internal/template/test-utils/selectors/anchor-navigation/index.d.ts +15 -0
  185. package/lib/internal/template/test-utils/selectors/anchor-navigation/index.js +45 -0
  186. package/lib/internal/template/test-utils/selectors/anchor-navigation/index.js.map +1 -0
  187. package/lib/internal/template/test-utils/selectors/index.d.ts +3 -0
  188. package/lib/internal/template/test-utils/selectors/index.js +10 -2
  189. package/lib/internal/template/test-utils/selectors/index.js.map +1 -1
  190. package/lib/internal/template/test-utils/tsconfig.tsbuildinfo +1 -1
  191. package/lib/internal/template/tiles/styles.css.js +29 -29
  192. package/lib/internal/template/tiles/styles.scoped.css +70 -71
  193. package/lib/internal/template/tiles/styles.selectors.js +29 -29
  194. package/lib/internal/template/wizard/styles.css.js +31 -31
  195. package/lib/internal/template/wizard/styles.scoped.css +64 -68
  196. package/lib/internal/template/wizard/styles.selectors.js +31 -31
  197. package/package.json +1 -1
@@ -1,3 +1,3 @@
1
1
  {
2
- "commit": "11090e446c62a52522d936bccb902117cfd8d245"
2
+ "commit": "c3fe8ad71dd7908b19ab2417efe027e38f55a960"
3
3
  }
@@ -0,0 +1,113 @@
1
+ /*
2
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ @use '../internal/styles/tokens' as awsui;
6
+ @use '../internal/styles' as styles;
7
+ @use '../internal/hooks/focus-visible' as focus-visible;
8
+ @use '../internal/styles/typography/constants.scss' as typography;
9
+
10
+ $guide-line-width: 2px;
11
+ $guide-line-offset: -2px; // Negative to expand 2px beyond the element
12
+
13
+ .root {
14
+ @include styles.styles-reset;
15
+ }
16
+
17
+ .anchor-list {
18
+ list-style: none;
19
+ margin: 0;
20
+ padding: 0;
21
+ position: relative;
22
+ text-indent: 0;
23
+
24
+ &::before {
25
+ content: '';
26
+ background-color: awsui.$color-border-divider-default;
27
+ border-radius: awsui.$border-radius-tabs-focus-ring;
28
+ bottom: $guide-line-offset;
29
+ pointer-events: none;
30
+ position: absolute;
31
+ top: $guide-line-offset;
32
+ width: $guide-line-width;
33
+ }
34
+ }
35
+
36
+ .anchor-item {
37
+ @include styles.with-motion {
38
+ transition: awsui.$motion-duration-slow;
39
+ transition-property: all;
40
+ }
41
+ @include styles.font-body-m;
42
+
43
+ color: awsui.$color-text-body-secondary;
44
+ font-weight: styles.$font-weight-normal;
45
+ margin: awsui.$space-scaled-xxs 0;
46
+
47
+ &--active {
48
+ position: relative;
49
+
50
+ &::before {
51
+ content: '';
52
+ background-color: awsui.$color-text-accent;
53
+ border-radius: awsui.$border-radius-tabs-focus-ring;
54
+ bottom: $guide-line-offset;
55
+ pointer-events: none;
56
+ position: absolute;
57
+ top: $guide-line-offset;
58
+ width: $guide-line-width;
59
+ }
60
+ }
61
+ }
62
+
63
+ .anchor-link {
64
+ @include styles.with-motion {
65
+ transition: awsui.$motion-duration-slow;
66
+ transition-property: all;
67
+ }
68
+
69
+ @include focus-visible.when-visible {
70
+ @include styles.link-focus;
71
+ }
72
+
73
+ @include styles.font-body-m;
74
+
75
+ align-items: baseline;
76
+ color: awsui.$color-text-body-secondary;
77
+ display: flex;
78
+ flex-direction: row;
79
+ font-weight: styles.$font-weight-normal;
80
+ text-decoration: none;
81
+
82
+ &:hover {
83
+ color: awsui.$color-text-accent;
84
+ }
85
+
86
+ &:focus {
87
+ outline: none;
88
+ }
89
+
90
+ &:hover,
91
+ &:focus {
92
+ text-decoration: none;
93
+ }
94
+
95
+ &--active {
96
+ font-weight: awsui.$font-wayfinding-link-active-weight;
97
+ @include styles.font-smoothing;
98
+ color: awsui.$color-text-accent;
99
+ }
100
+ }
101
+
102
+ .anchor-link-text {
103
+ display: block;
104
+ }
105
+
106
+ .anchor-link-info {
107
+ margin-left: awsui.$space-xs;
108
+ @include styles.font-body-s;
109
+ @include styles.font-smoothing;
110
+ font-weight: awsui.$font-button-weight;
111
+ letter-spacing: typography.$letter-spacing-bold-link;
112
+ color: awsui.$color-text-link-default;
113
+ }
@@ -0,0 +1,28 @@
1
+ /*
2
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ SPDX-License-Identifier: Apache-2.0
4
+ */
5
+
6
+ .root {
7
+ /* used in test-utils */
8
+ }
9
+
10
+ .anchor-list {
11
+ /* used in test-utils */
12
+ }
13
+
14
+ .anchor-item--active {
15
+ /* used in test-utils */
16
+ }
17
+
18
+ .anchor-link {
19
+ /* used in test-utils */
20
+ }
21
+
22
+ .anchor-link-text {
23
+ /* used in test-utils */
24
+ }
25
+
26
+ .anchor-link-info {
27
+ /* used in test-utils */
28
+ }
@@ -6,6 +6,7 @@
6
6
  @use '../../styles' as styles;
7
7
  @use '../../styles/tokens' as awsui;
8
8
  @use './motion';
9
+ @use '../../generated/custom-css-properties/index' as custom-props;
9
10
 
10
11
  .root {
11
12
  @include styles.styles-reset;
@@ -72,6 +73,7 @@
72
73
  }
73
74
  &.stretch-beyond-trigger-width {
74
75
  width: max-content;
76
+ max-width: var(#{custom-props.$dropdownDefaultMaxWidth}, 100%);
75
77
  }
76
78
  &.hide-upper-border > .dropdown-content-wrapper {
77
79
  border-top: none;
@@ -1,41 +1,42 @@
1
1
 
2
- $breadcrumbsGap: --awsui-breadcrumbs-gap-zw2xxa;
3
- $contentGapLeft: --awsui-content-gap-left-zw2xxa;
4
- $contentGapRight: --awsui-content-gap-right-zw2xxa;
5
- $contentHeight: --awsui-content-height-zw2xxa;
6
- $containerFirstGap: --awsui-container-first-gap-zw2xxa;
7
- $containerFirstOverlapExtension: --awsui-container-first-overlap-extension-zw2xxa;
8
- $defaultMaxContentWidth: --awsui-default-max-content-width-zw2xxa;
9
- $defaultMinContentWidth: --awsui-default-min-content-width-zw2xxa;
10
- $drawerSize: --awsui-drawer-size-zw2xxa;
11
- $footerHeight: --awsui-footer-height-zw2xxa;
12
- $headerGap: --awsui-header-gap-zw2xxa;
13
- $headerHeight: --awsui-header-height-zw2xxa;
14
- $layoutWidth: --awsui-layout-width-zw2xxa;
15
- $mainGap: --awsui-main-gap-zw2xxa;
16
- $mainOffsetLeft: --awsui-main-offset-left-zw2xxa;
17
- $mainTemplateRows: --awsui-main-template-rows-zw2xxa;
18
- $maxContentWidth: --awsui-max-content-width-zw2xxa;
19
- $minContentWidth: --awsui-min-content-width-zw2xxa;
20
- $mobileBarHeight: --awsui-mobile-bar-height-zw2xxa;
21
- $notificationsGap: --awsui-notifications-gap-zw2xxa;
22
- $notificationsHeight: --awsui-notifications-height-zw2xxa;
23
- $offsetTop: --awsui-offset-top-zw2xxa;
24
- $offsetTopWithNotifications: --awsui-offset-top-with-notifications-zw2xxa;
25
- $overlapHeight: --awsui-overlap-height-zw2xxa;
26
- $navigationWidth: --awsui-navigation-width-zw2xxa;
27
- $splitPanelReportedHeaderSize: --awsui-split-panel-reported-header-size-zw2xxa;
28
- $splitPanelReportedSize: --awsui-split-panel-reported-size-zw2xxa;
29
- $splitPanelHeight: --awsui-split-panel-height-zw2xxa;
30
- $splitPanelMinWidth: --awsui-split-panel-min-width-zw2xxa;
31
- $splitPanelMaxWidth: --awsui-split-panel-max-width-zw2xxa;
32
- $toolsMaxWidth: --awsui-tools-max-width-zw2xxa;
33
- $toolsWidth: --awsui-tools-width-zw2xxa;
34
- $toolsAnimationStartingOpacity: --awsui-tools-animation-starting-opacity-zw2xxa;
35
- $contentScrollMargin: --awsui-content-scroll-margin-zw2xxa;
36
- $flashbarStackDepth: --awsui-flashbar-stack-depth-zw2xxa;
37
- $flashbarStackIndex: --awsui-flashbar-stack-index-zw2xxa;
38
- $flashbarStickyBottomMargin: --awsui-flashbar-sticky-bottom-margin-zw2xxa;
39
- $stackedNotificationsBottomMargin: --awsui-stacked-notifications-bottom-margin-zw2xxa;
40
- $stackedNotificationsDefaultBottomMargin: --awsui-stacked-notifications-default-bottom-margin-zw2xxa;
2
+ $breadcrumbsGap: --awsui-breadcrumbs-gap-y98gph;
3
+ $contentGapLeft: --awsui-content-gap-left-y98gph;
4
+ $contentGapRight: --awsui-content-gap-right-y98gph;
5
+ $contentHeight: --awsui-content-height-y98gph;
6
+ $containerFirstGap: --awsui-container-first-gap-y98gph;
7
+ $containerFirstOverlapExtension: --awsui-container-first-overlap-extension-y98gph;
8
+ $defaultMaxContentWidth: --awsui-default-max-content-width-y98gph;
9
+ $defaultMinContentWidth: --awsui-default-min-content-width-y98gph;
10
+ $drawerSize: --awsui-drawer-size-y98gph;
11
+ $footerHeight: --awsui-footer-height-y98gph;
12
+ $headerGap: --awsui-header-gap-y98gph;
13
+ $headerHeight: --awsui-header-height-y98gph;
14
+ $layoutWidth: --awsui-layout-width-y98gph;
15
+ $mainGap: --awsui-main-gap-y98gph;
16
+ $mainOffsetLeft: --awsui-main-offset-left-y98gph;
17
+ $mainTemplateRows: --awsui-main-template-rows-y98gph;
18
+ $maxContentWidth: --awsui-max-content-width-y98gph;
19
+ $minContentWidth: --awsui-min-content-width-y98gph;
20
+ $mobileBarHeight: --awsui-mobile-bar-height-y98gph;
21
+ $notificationsGap: --awsui-notifications-gap-y98gph;
22
+ $notificationsHeight: --awsui-notifications-height-y98gph;
23
+ $offsetTop: --awsui-offset-top-y98gph;
24
+ $offsetTopWithNotifications: --awsui-offset-top-with-notifications-y98gph;
25
+ $overlapHeight: --awsui-overlap-height-y98gph;
26
+ $navigationWidth: --awsui-navigation-width-y98gph;
27
+ $splitPanelReportedHeaderSize: --awsui-split-panel-reported-header-size-y98gph;
28
+ $splitPanelReportedSize: --awsui-split-panel-reported-size-y98gph;
29
+ $splitPanelHeight: --awsui-split-panel-height-y98gph;
30
+ $splitPanelMinWidth: --awsui-split-panel-min-width-y98gph;
31
+ $splitPanelMaxWidth: --awsui-split-panel-max-width-y98gph;
32
+ $toolsMaxWidth: --awsui-tools-max-width-y98gph;
33
+ $toolsWidth: --awsui-tools-width-y98gph;
34
+ $toolsAnimationStartingOpacity: --awsui-tools-animation-starting-opacity-y98gph;
35
+ $contentScrollMargin: --awsui-content-scroll-margin-y98gph;
36
+ $flashbarStackDepth: --awsui-flashbar-stack-depth-y98gph;
37
+ $flashbarStackIndex: --awsui-flashbar-stack-index-y98gph;
38
+ $flashbarStickyBottomMargin: --awsui-flashbar-sticky-bottom-margin-y98gph;
39
+ $stackedNotificationsBottomMargin: --awsui-stacked-notifications-bottom-margin-y98gph;
40
+ $stackedNotificationsDefaultBottomMargin: --awsui-stacked-notifications-default-bottom-margin-y98gph;
41
+ $dropdownDefaultMaxWidth: --awsui-dropdown-default-max-width-y98gph;
41
42
 
@@ -17,14 +17,8 @@
17
17
  // prevents the text wrapping. We need to override the min-width by setting it to "0"
18
18
  min-width: 0;
19
19
 
20
- // IE does not support `word-break: break-word`.
21
- // We use `-ms-word-break: break-all` as a compromise for IE.
22
- -ms-word-break: break-all;
23
-
24
- // From docs:
25
- // > To prevent overflow, an otherwise unbreakable string of characters — like a long word or URL — may be broken at
26
- // > any point if there are no otherwise-acceptable break points in the line.
27
- // Also, this overrides any usage of `overflow-wrap` (and its alias `word-wrap`). Therefore, such rule is not used.
20
+ // `word-break: break-word` is deprecated.
21
+ // But its replacement, `overflow-wrap: anywhere`, is not supported in Safari 14.0 and 15.0.
28
22
  word-break: break-word;
29
23
  }
30
24
 
@@ -41,20 +41,24 @@ $_color-overrides: (
41
41
  }
42
42
  }
43
43
 
44
- .icon {
45
- padding-right: awsui.$space-xxs;
46
- }
47
-
48
44
  .container {
49
- word-break: break-all;
50
- word-wrap: break-word;
51
-
52
45
  &.display-inline {
46
+ @include styles.text-wrapping;
53
47
  display: inline;
48
+
49
+ > .icon {
50
+ white-space: nowrap;
51
+ }
54
52
  }
55
53
 
56
54
  &.display-inline-block {
57
55
  display: inline-block;
56
+ word-wrap: break-word;
57
+ word-break: break-all;
58
+
59
+ > .icon {
60
+ padding-right: awsui.$space-xxs;
61
+ }
58
62
  }
59
63
  }
60
64
 
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import { AnchorNavigationProps } from './interfaces';
3
+ export { AnchorNavigationProps };
4
+ export default function AnchorNavigation({ scrollSpyOffset, ...props }: AnchorNavigationProps): JSX.Element;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["anchor-navigation/index.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAKrD,OAAO,EAAE,qBAAqB,EAAE,CAAC;AAEjC,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EAAE,eAAmB,EAAE,GAAG,KAAK,EAAE,EAAE,qBAAqB,eAGhG"}
@@ -0,0 +1,14 @@
1
+ import { __rest } from "tslib";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ import React from 'react';
5
+ import { applyDisplayName } from '../internal/utils/apply-display-name';
6
+ import InternalAnchorNavigation from './internal';
7
+ import useBaseComponent from '../internal/hooks/use-base-component';
8
+ export default function AnchorNavigation(_a) {
9
+ var { scrollSpyOffset = 0 } = _a, props = __rest(_a, ["scrollSpyOffset"]);
10
+ const baseComponentProps = useBaseComponent('AnchorNavigation');
11
+ return React.createElement(InternalAnchorNavigation, Object.assign({ scrollSpyOffset: scrollSpyOffset }, props, baseComponentProps));
12
+ }
13
+ applyDisplayName(AnchorNavigation, 'AnchorNavigation');
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["anchor-navigation/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,wBAAwB,MAAM,YAAY,CAAC;AAClD,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AAIpE,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EAAwD;QAAxD,EAAE,eAAe,GAAG,CAAC,OAAmC,EAA9B,KAAK,cAA/B,mBAAiC,CAAF;IACtE,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,kBAAkB,CAAC,CAAC;IAChE,OAAO,oBAAC,wBAAwB,kBAAC,eAAe,EAAE,eAAe,IAAM,KAAK,EAAM,kBAAkB,EAAI,CAAC;AAC3G,CAAC;AACD,gBAAgB,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { AnchorNavigationProps } from './interfaces';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport InternalAnchorNavigation from './internal';\nimport useBaseComponent from '../internal/hooks/use-base-component';\n\nexport { AnchorNavigationProps };\n\nexport default function AnchorNavigation({ scrollSpyOffset = 0, ...props }: AnchorNavigationProps) {\n const baseComponentProps = useBaseComponent('AnchorNavigation');\n return <InternalAnchorNavigation scrollSpyOffset={scrollSpyOffset} {...props} {...baseComponentProps} />;\n}\napplyDisplayName(AnchorNavigation, 'AnchorNavigation');\n"]}
@@ -0,0 +1,67 @@
1
+ import { BaseComponentProps } from '../internal/base-component';
2
+ import { CancelableEventHandler, NonCancelableEventHandler } from '../internal/events';
3
+ export interface AnchorNavigationProps extends BaseComponentProps {
4
+ /**
5
+ * Adds `aria-labelledby` to the component.
6
+ *
7
+ * Use this property for identifying the header or title that labels the anchor navigation.
8
+ * To use it correctly, define an ID for the element either as label, and set the property to that ID.
9
+ */
10
+ ariaLabelledby?: string;
11
+ /**
12
+ * List of anchors. Each anchor object has the following properties:
13
+ *
14
+ * * `text` (string) - The text for the anchor item.
15
+ * * `href` (string) - The `id` attribute of the target HTML element that the anchor refers to.
16
+ * For example: `"#section1.1"`
17
+ * * `level` (number) - Level of nesting of the anchor.
18
+ * * `info` (string | undefined) - Additional information to display next to the link, for example: "New" or "Updated".
19
+ *
20
+ * Note: The list of anchors should be sorted in the order they appear on the page.
21
+ */
22
+ anchors: AnchorNavigationProps.Anchor[];
23
+ /**
24
+ * Specifies the active anchor href. When set, the component will operate in a
25
+ * controlled manner, and internal scroll-spy will be disabled.
26
+ */
27
+ activeHref?: string;
28
+ /**
29
+ * Specifies the height (in pixels) to be considered as an offset when activating anchors.
30
+ * This is useful when you have a fixed or sticky header that might overlap with the content as you scroll.
31
+ *
32
+ * Defaults to 0.
33
+ */
34
+ scrollSpyOffset?: number;
35
+ /**
36
+ * Fired when an anchor link is clicked without any modifier keys.
37
+ */
38
+ onFollow?: CancelableEventHandler<AnchorNavigationProps.Anchor>;
39
+ /**
40
+ * Fired when an active anchor link changes.
41
+ *
42
+ * Note: This event is triggered both by the component's internal scroll-spy logic,
43
+ * or when the `activeHref` prop is manually updated.
44
+ */
45
+ onActiveHrefChange?: NonCancelableEventHandler<AnchorNavigationProps.Anchor>;
46
+ }
47
+ export declare namespace AnchorNavigationProps {
48
+ interface Anchor {
49
+ /**
50
+ * The text for the anchor item.
51
+ */
52
+ text: string;
53
+ /**
54
+ * The `href` of the anchor. For example: `"#section1.1"`".
55
+ */
56
+ href: string;
57
+ /**
58
+ * Level of nesting of the anchor.
59
+ */
60
+ level: number;
61
+ /**
62
+ * Additional information to display next to the link, for example: "New" or "Updated".
63
+ */
64
+ info?: string;
65
+ }
66
+ }
67
+ //# sourceMappingURL=interfaces.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.d.ts","sourceRoot":"lib/default/","sources":["anchor-navigation/interfaces.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAEvF,MAAM,WAAW,qBAAsB,SAAQ,kBAAkB;IAC/D;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;;;;;;;;OAUG;IACH,OAAO,EAAE,qBAAqB,CAAC,MAAM,EAAE,CAAC;IAExC;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;;OAKG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,QAAQ,CAAC,EAAE,sBAAsB,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;IAEhE;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,yBAAyB,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;CAC9E;AAED,yBAAiB,qBAAqB,CAAC;IACrC,UAAiB,MAAM;QACrB;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;QAEb;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;QAEb;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;QAEd;;WAEG;QACH,IAAI,CAAC,EAAE,MAAM,CAAC;KACf;CACF"}
@@ -0,0 +1,4 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export {};
4
+ //# sourceMappingURL=interfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"lib/default/","sources":["anchor-navigation/interfaces.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { BaseComponentProps } from '../internal/base-component';\nimport { CancelableEventHandler, NonCancelableEventHandler } from '../internal/events';\n\nexport interface AnchorNavigationProps extends BaseComponentProps {\n /**\n * Adds `aria-labelledby` to the component.\n *\n * Use this property for identifying the header or title that labels the anchor navigation.\n * To use it correctly, define an ID for the element either as label, and set the property to that ID.\n */\n ariaLabelledby?: string;\n\n /**\n * List of anchors. Each anchor object has the following properties:\n *\n * * `text` (string) - The text for the anchor item.\n * * `href` (string) - The `id` attribute of the target HTML element that the anchor refers to.\n * For example: `\"#section1.1\"`\n * * `level` (number) - Level of nesting of the anchor.\n * * `info` (string | undefined) - Additional information to display next to the link, for example: \"New\" or \"Updated\".\n *\n * Note: The list of anchors should be sorted in the order they appear on the page.\n */\n anchors: AnchorNavigationProps.Anchor[];\n\n /**\n * Specifies the active anchor href. When set, the component will operate in a\n * controlled manner, and internal scroll-spy will be disabled.\n */\n activeHref?: string;\n\n /**\n * Specifies the height (in pixels) to be considered as an offset when activating anchors.\n * This is useful when you have a fixed or sticky header that might overlap with the content as you scroll.\n *\n * Defaults to 0.\n */\n scrollSpyOffset?: number;\n\n /**\n * Fired when an anchor link is clicked without any modifier keys.\n */\n onFollow?: CancelableEventHandler<AnchorNavigationProps.Anchor>;\n\n /**\n * Fired when an active anchor link changes.\n *\n * Note: This event is triggered both by the component's internal scroll-spy logic,\n * or when the `activeHref` prop is manually updated.\n */\n onActiveHrefChange?: NonCancelableEventHandler<AnchorNavigationProps.Anchor>;\n}\n\nexport namespace AnchorNavigationProps {\n export interface Anchor {\n /**\n * The text for the anchor item.\n */\n text: string;\n\n /**\n * The `href` of the anchor. For example: `\"#section1.1\"`\".\n */\n href: string;\n\n /**\n * Level of nesting of the anchor.\n */\n level: number;\n\n /**\n * Additional information to display next to the link, for example: \"New\" or \"Updated\".\n */\n info?: string;\n }\n}\n"]}
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import { AnchorNavigationProps } from './interfaces';
3
+ import { InternalBaseComponentProps } from '../internal/hooks/use-base-component/index.js';
4
+ export default function InternalAnchorNavigation({ anchors, ariaLabelledby, onFollow, onActiveHrefChange, activeHref, __internalRootRef, scrollSpyOffset, ...props }: AnchorNavigationProps & InternalBaseComponentProps): JSX.Element;
5
+ //# sourceMappingURL=internal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"lib/default/","sources":["anchor-navigation/internal.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAIrD,OAAO,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AAG3F,MAAM,CAAC,OAAO,UAAU,wBAAwB,CAAC,EAC/C,OAAO,EACP,cAAc,EACd,QAAQ,EACR,kBAAkB,EAClB,UAAe,EACf,iBAAwB,EACxB,eAAmB,EACnB,GAAG,KAAK,EACT,EAAE,qBAAqB,GAAG,0BAA0B,eA+CpD"}
@@ -0,0 +1,48 @@
1
+ import { __rest } from "tslib";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ import React, { useCallback, useEffect, useMemo } from 'react';
5
+ import clsx from 'clsx';
6
+ import styles from './styles.css.js';
7
+ import testUtilsStyles from './test-classes/styles.css.js';
8
+ import { checkSafeUrl } from '../internal/utils/check-safe-url';
9
+ import useScrollSpy from './use-scroll-spy.js';
10
+ import { fireCancelableEvent, fireNonCancelableEvent, isPlainLeftClick } from '../internal/events/index';
11
+ import { getBaseProps } from '../internal/base-component/index.js';
12
+ export default function InternalAnchorNavigation(_a) {
13
+ var { anchors, ariaLabelledby, onFollow, onActiveHrefChange, activeHref = '', __internalRootRef = null, scrollSpyOffset = 0 } = _a, props = __rest(_a, ["anchors", "ariaLabelledby", "onFollow", "onActiveHrefChange", "activeHref", "__internalRootRef", "scrollSpyOffset"]);
14
+ const baseProps = getBaseProps(props);
15
+ const hrefs = useMemo(() => anchors.map(anchor => anchor.href), [anchors]);
16
+ const onFollowHandler = useCallback((anchor, sourceEvent) => {
17
+ fireCancelableEvent(onFollow, anchor, sourceEvent);
18
+ }, [onFollow]);
19
+ const currentActiveHref = useScrollSpy({
20
+ hrefs,
21
+ scrollSpyOffset,
22
+ activeHref,
23
+ });
24
+ useEffect(() => {
25
+ if (currentActiveHref) {
26
+ const newActiveAnchor = anchors.find(anchor => anchor.href === currentActiveHref);
27
+ fireNonCancelableEvent(onActiveHrefChange, newActiveAnchor);
28
+ }
29
+ }, [onActiveHrefChange, anchors, currentActiveHref]);
30
+ return (React.createElement("nav", Object.assign({}, baseProps, { ref: __internalRootRef, "aria-labelledby": ariaLabelledby, className: clsx(baseProps.className, styles.root, testUtilsStyles.root) }),
31
+ React.createElement("ol", { className: clsx(styles['anchor-list'], testUtilsStyles['anchor-list']) }, anchors.map((anchor, index) => {
32
+ return (React.createElement(Anchor, { onFollow: onFollowHandler, isActive: anchor.href === currentActiveHref, key: index, index: index, anchor: anchor }));
33
+ }))));
34
+ }
35
+ const Anchor = ({ anchor, onFollow, isActive, index }) => {
36
+ checkSafeUrl('SideNavigation', anchor.href);
37
+ const onClick = useCallback((event) => {
38
+ if (isPlainLeftClick(event)) {
39
+ onFollow(anchor, event);
40
+ }
41
+ }, [onFollow, anchor]);
42
+ const activeItemClasses = clsx(styles['anchor-item--active'], testUtilsStyles['anchor-item--active']);
43
+ return (React.createElement("li", { "data-itemid": `anchor-item-${index + 1}`, className: clsx(styles['anchor-item'], isActive && activeItemClasses) },
44
+ React.createElement("a", Object.assign({ onClick: onClick, className: clsx(styles['anchor-link'], testUtilsStyles['anchor-link'], isActive && styles['anchor-link--active']) }, (isActive ? { 'aria-current': true } : {}), { href: anchor.href }),
45
+ React.createElement("span", { className: clsx(styles['anchor-link-text'], testUtilsStyles['anchor-link-text']), style: { paddingLeft: `${anchor.level * 16 + 2}px` } }, anchor.text),
46
+ anchor.info && (React.createElement("span", { className: clsx(styles['anchor-link-info'], testUtilsStyles['anchor-link-info']) }, anchor.info)))));
47
+ };
48
+ //# sourceMappingURL=internal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal.js","sourceRoot":"lib/default/","sources":["anchor-navigation/internal.tsx"],"names":[],"mappings":"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","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useCallback, useEffect, useMemo } from 'react';\nimport clsx from 'clsx';\nimport styles from './styles.css.js';\nimport testUtilsStyles from './test-classes/styles.css.js';\nimport { AnchorNavigationProps } from './interfaces';\nimport { checkSafeUrl } from '../internal/utils/check-safe-url';\nimport useScrollSpy from './use-scroll-spy.js';\nimport { fireCancelableEvent, fireNonCancelableEvent, isPlainLeftClick } from '../internal/events/index';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component/index.js';\nimport { getBaseProps } from '../internal/base-component/index.js';\n\nexport default function InternalAnchorNavigation({\n anchors,\n ariaLabelledby,\n onFollow,\n onActiveHrefChange,\n activeHref = '',\n __internalRootRef = null,\n scrollSpyOffset = 0,\n ...props\n}: AnchorNavigationProps & InternalBaseComponentProps) {\n const baseProps = getBaseProps(props);\n\n const hrefs = useMemo(() => anchors.map(anchor => anchor.href), [anchors]);\n\n const onFollowHandler = useCallback(\n (anchor: AnchorNavigationProps.Anchor, sourceEvent: React.SyntheticEvent | Event) => {\n fireCancelableEvent(onFollow, anchor, sourceEvent);\n },\n [onFollow]\n );\n\n const currentActiveHref = useScrollSpy({\n hrefs,\n scrollSpyOffset,\n activeHref,\n });\n\n useEffect(() => {\n if (currentActiveHref) {\n const newActiveAnchor = anchors.find(anchor => anchor.href === currentActiveHref);\n fireNonCancelableEvent(onActiveHrefChange, newActiveAnchor);\n }\n }, [onActiveHrefChange, anchors, currentActiveHref]);\n\n return (\n <nav\n {...baseProps}\n ref={__internalRootRef}\n aria-labelledby={ariaLabelledby}\n className={clsx(baseProps.className, styles.root, testUtilsStyles.root)}\n >\n <ol className={clsx(styles['anchor-list'], testUtilsStyles['anchor-list'])}>\n {anchors.map((anchor, index) => {\n return (\n <Anchor\n onFollow={onFollowHandler}\n isActive={anchor.href === currentActiveHref}\n key={index}\n index={index}\n anchor={anchor}\n />\n );\n })}\n </ol>\n </nav>\n );\n}\n\ninterface AnchorProps {\n anchor: AnchorNavigationProps.Anchor;\n onFollow: (anchor: AnchorNavigationProps.Anchor, event: React.SyntheticEvent | Event) => void;\n isActive: boolean;\n index: number;\n}\n\nconst Anchor = ({ anchor, onFollow, isActive, index }: AnchorProps) => {\n checkSafeUrl('SideNavigation', anchor.href);\n\n const onClick = useCallback(\n (event: React.MouseEvent) => {\n if (isPlainLeftClick(event)) {\n onFollow(anchor, event);\n }\n },\n [onFollow, anchor]\n );\n\n const activeItemClasses = clsx(styles['anchor-item--active'], testUtilsStyles['anchor-item--active']);\n\n return (\n <li data-itemid={`anchor-item-${index + 1}`} className={clsx(styles['anchor-item'], isActive && activeItemClasses)}>\n <a\n onClick={onClick}\n className={clsx(\n styles['anchor-link'],\n testUtilsStyles['anchor-link'],\n isActive && styles['anchor-link--active']\n )}\n {...(isActive ? { 'aria-current': true } : {})}\n href={anchor.href}\n >\n <span\n className={clsx(styles['anchor-link-text'], testUtilsStyles['anchor-link-text'])}\n style={{ paddingLeft: `${anchor.level * 16 + 2}px` }}\n >\n {anchor.text}\n </span>\n {anchor.info && (\n <span className={clsx(styles['anchor-link-info'], testUtilsStyles['anchor-link-info'])}>{anchor.info}</span>\n )}\n </a>\n </li>\n );\n};\n"]}
@@ -0,0 +1,13 @@
1
+
2
+ import './styles.scoped.css';
3
+ export default {
4
+ "root": "awsui_root_swimc_h60aw_93",
5
+ "anchor-list": "awsui_anchor-list_swimc_h60aw_106",
6
+ "anchor-item": "awsui_anchor-item_swimc_h60aw_124",
7
+ "anchor-item--active": "awsui_anchor-item--active_swimc_h60aw_143",
8
+ "anchor-link": "awsui_anchor-link_swimc_h60aw_157",
9
+ "anchor-link--active": "awsui_anchor-link--active_swimc_h60aw_196",
10
+ "anchor-link-text": "awsui_anchor-link-text_swimc_h60aw_203",
11
+ "anchor-link-info": "awsui_anchor-link-info_swimc_h60aw_207"
12
+ };
13
+