@cloudscape-design/components-themeable 3.0.639 → 3.0.641

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 (181) hide show
  1. package/lib/internal/manifest.json +1 -1
  2. package/lib/internal/scss/button/styles.scss +12 -0
  3. package/lib/internal/scss/drawer/styles.scss +5 -5
  4. package/lib/internal/scss/form-field/motion.scss +5 -2
  5. package/lib/internal/scss/form-field/styles.scss +11 -2
  6. package/lib/internal/scss/help-panel/styles.scss +8 -8
  7. package/lib/internal/scss/input/styles.scss +9 -0
  8. package/lib/internal/scss/internal/components/button-trigger/styles.scss +5 -0
  9. package/lib/internal/scss/internal/styles/forms/mixins.scss +11 -0
  10. package/lib/internal/scss/side-navigation/styles.scss +6 -5
  11. package/lib/internal/scss/slider/mixins.scss +9 -4
  12. package/lib/internal/scss/table/body-cell/styles.scss +7 -2
  13. package/lib/internal/scss/textarea/styles.scss +4 -0
  14. package/lib/internal/scss/token-group/styles.scss +9 -2
  15. package/lib/internal/template/alert/index.d.ts.map +1 -1
  16. package/lib/internal/template/alert/index.js +9 -5
  17. package/lib/internal/template/alert/index.js.map +1 -1
  18. package/lib/internal/template/attribute-editor/interfaces.d.ts +4 -0
  19. package/lib/internal/template/attribute-editor/interfaces.d.ts.map +1 -1
  20. package/lib/internal/template/attribute-editor/interfaces.js.map +1 -1
  21. package/lib/internal/template/attribute-editor/row.d.ts.map +1 -1
  22. package/lib/internal/template/attribute-editor/row.js +4 -1
  23. package/lib/internal/template/attribute-editor/row.js.map +1 -1
  24. package/lib/internal/template/button/styles.css.js +19 -19
  25. package/lib/internal/template/button/styles.scoped.css +159 -151
  26. package/lib/internal/template/button/styles.selectors.js +19 -19
  27. package/lib/internal/template/container/index.js +1 -1
  28. package/lib/internal/template/container/index.js.map +1 -1
  29. package/lib/internal/template/date-picker/index.d.ts.map +1 -1
  30. package/lib/internal/template/date-picker/index.js +2 -2
  31. package/lib/internal/template/date-picker/index.js.map +1 -1
  32. package/lib/internal/template/date-range-picker/index.d.ts.map +1 -1
  33. package/lib/internal/template/date-range-picker/index.js +2 -2
  34. package/lib/internal/template/date-range-picker/index.js.map +1 -1
  35. package/lib/internal/template/drawer/styles.css.js +3 -3
  36. package/lib/internal/template/drawer/styles.scoped.css +13 -13
  37. package/lib/internal/template/drawer/styles.selectors.js +3 -3
  38. package/lib/internal/template/file-upload/interfaces.d.ts +14 -4
  39. package/lib/internal/template/file-upload/interfaces.d.ts.map +1 -1
  40. package/lib/internal/template/file-upload/interfaces.js.map +1 -1
  41. package/lib/internal/template/file-upload/internal.js +13 -7
  42. package/lib/internal/template/file-upload/internal.js.map +1 -1
  43. package/lib/internal/template/form/index.d.ts.map +1 -1
  44. package/lib/internal/template/form/index.js +17 -6
  45. package/lib/internal/template/form/index.js.map +1 -1
  46. package/lib/internal/template/form/internal.d.ts.map +1 -1
  47. package/lib/internal/template/form/internal.js +1 -14
  48. package/lib/internal/template/form/internal.js.map +1 -1
  49. package/lib/internal/template/form-field/index.d.ts.map +1 -1
  50. package/lib/internal/template/form-field/index.js +3 -2
  51. package/lib/internal/template/form-field/index.js.map +1 -1
  52. package/lib/internal/template/form-field/interfaces.d.ts +12 -1
  53. package/lib/internal/template/form-field/interfaces.d.ts.map +1 -1
  54. package/lib/internal/template/form-field/interfaces.js.map +1 -1
  55. package/lib/internal/template/form-field/internal.d.ts +9 -3
  56. package/lib/internal/template/form-field/internal.d.ts.map +1 -1
  57. package/lib/internal/template/form-field/internal.js +36 -11
  58. package/lib/internal/template/form-field/internal.js.map +1 -1
  59. package/lib/internal/template/form-field/styles.css.js +23 -19
  60. package/lib/internal/template/form-field/styles.scoped.css +45 -29
  61. package/lib/internal/template/form-field/styles.selectors.js +23 -19
  62. package/lib/internal/template/form-field/util.d.ts +3 -2
  63. package/lib/internal/template/form-field/util.d.ts.map +1 -1
  64. package/lib/internal/template/form-field/util.js +4 -3
  65. package/lib/internal/template/form-field/util.js.map +1 -1
  66. package/lib/internal/template/help-panel/styles.css.js +4 -4
  67. package/lib/internal/template/help-panel/styles.scoped.css +71 -71
  68. package/lib/internal/template/help-panel/styles.selectors.js +4 -4
  69. package/lib/internal/template/input/index.d.ts.map +1 -1
  70. package/lib/internal/template/input/index.js +2 -1
  71. package/lib/internal/template/input/index.js.map +1 -1
  72. package/lib/internal/template/input/internal.d.ts.map +1 -1
  73. package/lib/internal/template/input/internal.js +4 -1
  74. package/lib/internal/template/input/internal.js.map +1 -1
  75. package/lib/internal/template/input/styles.css.js +13 -12
  76. package/lib/internal/template/input/styles.scoped.css +46 -30
  77. package/lib/internal/template/input/styles.selectors.js +13 -12
  78. package/lib/internal/template/internal/analytics/components/analytics-funnel.d.ts +12 -12
  79. package/lib/internal/template/internal/analytics/components/analytics-funnel.d.ts.map +1 -1
  80. package/lib/internal/template/internal/analytics/components/analytics-funnel.js +38 -25
  81. package/lib/internal/template/internal/analytics/components/analytics-funnel.js.map +1 -1
  82. package/lib/internal/template/internal/analytics/context/analytics-context.d.ts +7 -2
  83. package/lib/internal/template/internal/analytics/context/analytics-context.d.ts.map +1 -1
  84. package/lib/internal/template/internal/analytics/context/analytics-context.js.map +1 -1
  85. package/lib/internal/template/internal/analytics/hooks/use-funnel.d.ts +5 -1
  86. package/lib/internal/template/internal/analytics/hooks/use-funnel.d.ts.map +1 -1
  87. package/lib/internal/template/internal/analytics/hooks/use-funnel.js +9 -5
  88. package/lib/internal/template/internal/analytics/hooks/use-funnel.js.map +1 -1
  89. package/lib/internal/template/internal/analytics/interfaces.d.ts +23 -37
  90. package/lib/internal/template/internal/analytics/interfaces.d.ts.map +1 -1
  91. package/lib/internal/template/internal/analytics/interfaces.js.map +1 -1
  92. package/lib/internal/template/internal/base-component/index.d.ts +1 -1
  93. package/lib/internal/template/internal/base-component/index.d.ts.map +1 -1
  94. package/lib/internal/template/internal/base-component/index.js +1 -1
  95. package/lib/internal/template/internal/base-component/index.js.map +1 -1
  96. package/lib/internal/template/internal/base-component/styles.scoped.css +35 -0
  97. package/lib/internal/template/internal/components/button-trigger/index.d.ts +1 -0
  98. package/lib/internal/template/internal/components/button-trigger/index.d.ts.map +1 -1
  99. package/lib/internal/template/internal/components/button-trigger/index.js +2 -2
  100. package/lib/internal/template/internal/components/button-trigger/index.js.map +1 -1
  101. package/lib/internal/template/internal/components/button-trigger/styles.css.js +11 -10
  102. package/lib/internal/template/internal/components/button-trigger/styles.scoped.css +35 -24
  103. package/lib/internal/template/internal/components/button-trigger/styles.selectors.js +11 -10
  104. package/lib/internal/template/internal/context/form-field-context.d.ts +14 -1
  105. package/lib/internal/template/internal/context/form-field-context.d.ts.map +1 -1
  106. package/lib/internal/template/internal/context/form-field-context.js +1 -1
  107. package/lib/internal/template/internal/context/form-field-context.js.map +1 -1
  108. package/lib/internal/template/internal/environment.js +1 -1
  109. package/lib/internal/template/internal/environment.json +1 -1
  110. package/lib/internal/template/internal/generated/styles/tokens.d.ts +5 -0
  111. package/lib/internal/template/internal/generated/styles/tokens.js +5 -0
  112. package/lib/internal/template/internal/generated/theming/index.cjs +75 -0
  113. package/lib/internal/template/internal/generated/theming/index.js +75 -0
  114. package/lib/internal/template/link/internal.d.ts.map +1 -1
  115. package/lib/internal/template/link/internal.js +9 -3
  116. package/lib/internal/template/link/internal.js.map +1 -1
  117. package/lib/internal/template/modal/body-scroll.d.ts.map +1 -1
  118. package/lib/internal/template/modal/body-scroll.js +5 -0
  119. package/lib/internal/template/modal/body-scroll.js.map +1 -1
  120. package/lib/internal/template/select/parts/filter.d.ts +1 -1
  121. package/lib/internal/template/select/parts/filter.d.ts.map +1 -1
  122. package/lib/internal/template/select/parts/trigger.d.ts.map +1 -1
  123. package/lib/internal/template/select/parts/trigger.js +2 -2
  124. package/lib/internal/template/select/parts/trigger.js.map +1 -1
  125. package/lib/internal/template/side-navigation/styles.css.js +28 -28
  126. package/lib/internal/template/side-navigation/styles.scoped.css +44 -43
  127. package/lib/internal/template/side-navigation/styles.selectors.js +28 -28
  128. package/lib/internal/template/table/body-cell/disabled-inline-editor.d.ts +1 -1
  129. package/lib/internal/template/table/body-cell/disabled-inline-editor.d.ts.map +1 -1
  130. package/lib/internal/template/table/body-cell/disabled-inline-editor.js +2 -2
  131. package/lib/internal/template/table/body-cell/disabled-inline-editor.js.map +1 -1
  132. package/lib/internal/template/table/body-cell/index.d.ts +1 -0
  133. package/lib/internal/template/table/body-cell/index.d.ts.map +1 -1
  134. package/lib/internal/template/table/body-cell/index.js +2 -2
  135. package/lib/internal/template/table/body-cell/index.js.map +1 -1
  136. package/lib/internal/template/table/body-cell/styles.css.js +44 -43
  137. package/lib/internal/template/table/body-cell/styles.scoped.css +167 -165
  138. package/lib/internal/template/table/body-cell/styles.selectors.js +44 -43
  139. package/lib/internal/template/table/internal.d.ts.map +1 -1
  140. package/lib/internal/template/table/internal.js +1 -1
  141. package/lib/internal/template/table/internal.js.map +1 -1
  142. package/lib/internal/template/test-utils/dom/file-upload/index.d.ts +2 -0
  143. package/lib/internal/template/test-utils/dom/file-upload/index.js +6 -0
  144. package/lib/internal/template/test-utils/dom/file-upload/index.js.map +1 -1
  145. package/lib/internal/template/test-utils/dom/form-field/index.d.ts +1 -0
  146. package/lib/internal/template/test-utils/dom/form-field/index.js +3 -0
  147. package/lib/internal/template/test-utils/dom/form-field/index.js.map +1 -1
  148. package/lib/internal/template/test-utils/selectors/file-upload/index.d.ts +2 -0
  149. package/lib/internal/template/test-utils/selectors/file-upload/index.js +6 -0
  150. package/lib/internal/template/test-utils/selectors/file-upload/index.js.map +1 -1
  151. package/lib/internal/template/test-utils/selectors/form-field/index.d.ts +1 -0
  152. package/lib/internal/template/test-utils/selectors/form-field/index.js +3 -0
  153. package/lib/internal/template/test-utils/selectors/form-field/index.js.map +1 -1
  154. package/lib/internal/template/test-utils/tsconfig.tsbuildinfo +1 -1
  155. package/lib/internal/template/textarea/index.d.ts.map +1 -1
  156. package/lib/internal/template/textarea/index.js +2 -1
  157. package/lib/internal/template/textarea/index.js.map +1 -1
  158. package/lib/internal/template/textarea/styles.css.js +5 -4
  159. package/lib/internal/template/textarea/styles.scoped.css +23 -12
  160. package/lib/internal/template/textarea/styles.selectors.js +5 -4
  161. package/lib/internal/template/token-group/styles.css.js +9 -8
  162. package/lib/internal/template/token-group/styles.scoped.css +27 -16
  163. package/lib/internal/template/token-group/styles.selectors.js +9 -8
  164. package/lib/internal/template/token-group/token.d.ts +3 -1
  165. package/lib/internal/template/token-group/token.d.ts.map +1 -1
  166. package/lib/internal/template/token-group/token.js +8 -5
  167. package/lib/internal/template/token-group/token.js.map +1 -1
  168. package/lib/internal/template/wizard/analytics.d.ts +2 -1
  169. package/lib/internal/template/wizard/analytics.d.ts.map +1 -1
  170. package/lib/internal/template/wizard/analytics.js +7 -3
  171. package/lib/internal/template/wizard/analytics.js.map +1 -1
  172. package/lib/internal/template/wizard/index.js +1 -1
  173. package/lib/internal/template/wizard/index.js.map +1 -1
  174. package/lib/internal/template/wizard/internal.d.ts.map +1 -1
  175. package/lib/internal/template/wizard/internal.js +2 -2
  176. package/lib/internal/template/wizard/internal.js.map +1 -1
  177. package/lib/internal/template/wizard/wizard-form.d.ts +4 -2
  178. package/lib/internal/template/wizard/wizard-form.d.ts.map +1 -1
  179. package/lib/internal/template/wizard/wizard-form.js +31 -19
  180. package/lib/internal/template/wizard/wizard-form.js.map +1 -1
  181. package/package.json +1 -1
@@ -1,3 +1,3 @@
1
1
  {
2
- "commit": "94ca71b8aef86bf77b0ea1b7d4c27a55fe3616cb"
2
+ "commit": "069cda1560c7b5eb251bc13786f9d8a572e882fe"
3
3
  }
@@ -147,6 +147,18 @@
147
147
  margin-inline-start: awsui.$space-xxs;
148
148
  }
149
149
 
150
+ &.variant-inline-link {
151
+ > .icon-left {
152
+ inset-inline-start: 0;
153
+ margin-inline-end: awsui.$space-xs;
154
+ }
155
+
156
+ > .icon-right {
157
+ inset-inline-end: 0;
158
+ margin-inline-start: awsui.$space-xs;
159
+ }
160
+ }
161
+
150
162
  &.button-no-text > .icon {
151
163
  margin-inline-start: auto;
152
164
  margin-inline-end: auto;
@@ -10,8 +10,8 @@
10
10
  .drawer {
11
11
  @include styles.styles-reset;
12
12
  word-wrap: break-word;
13
- padding-block-start: awsui.$space-scaled-l;
14
- padding-block-end: awsui.$space-scaled-xxxl;
13
+ padding-block-start: awsui.$space-panel-header-vertical;
14
+ padding-block-end: awsui.$space-panel-content-bottom;
15
15
  padding-inline-start: awsui.$space-panel-side-left;
16
16
  padding-inline-end: awsui.$space-panel-side-right;
17
17
  }
@@ -19,12 +19,12 @@
19
19
  .header {
20
20
  @include styles.font-panel-header;
21
21
  color: awsui.$color-text-heading-default;
22
- padding-block-end: awsui.$space-scaled-l;
22
+ padding-block-end: awsui.$space-panel-header-vertical;
23
23
  padding-inline: awsui.$space-panel-side-left calc(#{awsui.$space-xl} + #{awsui.$space-scaled-xxl});
24
24
  // padding to make sure the header doesn't overlap with the close icon
25
- border-block-end: awsui.$border-divider-section-width solid awsui.$color-border-divider-default;
25
+ border-block-end: awsui.$border-divider-section-width solid awsui.$color-border-panel-header;
26
26
  margin-block-start: 0;
27
- margin-block-end: awsui.$space-scaled-l;
27
+ margin-block-end: awsui.$space-panel-content-top;
28
28
  margin-inline-end: calc(-1 * #{awsui.$space-panel-side-right});
29
29
  margin-inline-start: calc(-1 * #{awsui.$space-panel-side-left});
30
30
 
@@ -3,19 +3,22 @@
3
3
  SPDX-License-Identifier: Apache-2.0
4
4
  */
5
5
 
6
- .error-icon-shake-wrapper {
6
+ .error-icon-shake-wrapper,
7
+ .warning-icon-shake-wrapper {
7
8
  @include styles.with-motion {
8
9
  @include styles.animation-shake-horizontally;
9
10
  animation: awsui-motion-shake-horizontally awsui.$motion-duration-refresh-only-medium;
10
11
  }
11
12
  }
12
- .error-icon-scale-wrapper {
13
+ .error-icon-scale-wrapper,
14
+ .warning-icon-scale-wrapper {
13
15
  @include styles.with-motion {
14
16
  @include styles.animation-scale-popup;
15
17
  animation: awsui-motion-scale-popup awsui.$motion-duration-refresh-only-medium awsui.$motion-easing-refresh-only-a;
16
18
  }
17
19
  }
18
20
 
21
+ .warning,
19
22
  .error {
20
23
  @include styles.with-motion {
21
24
  @include styles.animation-fade-in-0;
@@ -34,7 +34,7 @@
34
34
  }
35
35
 
36
36
  .hints,
37
- .constraint-has-error {
37
+ .constraint-has-validation-text {
38
38
  padding-block-start: awsui.$space-xxs;
39
39
  }
40
40
 
@@ -60,7 +60,16 @@
60
60
  align-items: flex-start;
61
61
  }
62
62
 
63
- .error__message {
63
+ .warning {
64
+ color: awsui.$color-text-status-warning;
65
+ @include styles.font-body-s;
66
+
67
+ display: flex;
68
+ align-items: flex-start;
69
+ }
70
+
71
+ .error__message,
72
+ .warning__message {
64
73
  margin-inline-start: awsui.$space-xxs;
65
74
  }
66
75
 
@@ -10,7 +10,7 @@
10
10
  .help-panel {
11
11
  @include styles.styles-reset;
12
12
  word-wrap: break-word;
13
- padding-block-start: awsui.$space-scaled-l;
13
+ padding-block-start: awsui.$space-panel-header-vertical;
14
14
  padding-block-end: 0;
15
15
  padding-inline-end: awsui.$space-panel-side-right;
16
16
  padding-inline-start: awsui.$space-panel-side-left;
@@ -20,7 +20,7 @@
20
20
  border-inline: none;
21
21
  border-block-start: awsui.$border-divider-section-width solid awsui.$color-border-divider-default;
22
22
  margin-block: awsui.$space-scaled-xl;
23
- margin-inline: calc(-1 * #{awsui.$space-xs});
23
+ margin-inline: calc(-1 * #{awsui.$space-panel-divider-margin-horizontal});
24
24
  }
25
25
 
26
26
  ol,
@@ -85,7 +85,7 @@
85
85
  }
86
86
  // sets padding at the bottom of the panel
87
87
  & > :last-child {
88
- margin-block-end: awsui.$space-scaled-xxxl;
88
+ margin-block-end: awsui.$space-panel-content-bottom;
89
89
  }
90
90
 
91
91
  // add basic font-sizes
@@ -118,14 +118,14 @@
118
118
  .header {
119
119
  @include styles.font-panel-header;
120
120
  color: awsui.$color-text-heading-default;
121
- padding-block-end: awsui.$space-scaled-l;
121
+ padding-block-end: awsui.$space-panel-header-vertical;
122
122
  padding-inline: awsui.$space-panel-side-left calc(#{awsui.$space-xl} + #{awsui.$space-scaled-xxl});
123
123
  // padding to make sure the header doesn't overlap with the close icon
124
124
  border-block: none;
125
125
  border-inline: none;
126
- border-block-end: awsui.$border-divider-section-width solid awsui.$color-border-divider-default;
126
+ border-block-end: awsui.$border-divider-section-width solid awsui.$color-border-panel-header;
127
127
  margin-block-start: 0;
128
- margin-block-end: awsui.$space-scaled-l;
128
+ margin-block-end: awsui.$space-panel-content-top;
129
129
  margin-inline-end: calc(-1 * #{awsui.$space-panel-side-right});
130
130
  margin-inline-start: calc(-1 * #{awsui.$space-panel-side-left});
131
131
 
@@ -161,9 +161,9 @@
161
161
  color: awsui.$color-text-body-secondary;
162
162
  border-block-start: awsui.$border-divider-section-width solid awsui.$color-border-divider-default;
163
163
  margin-block: awsui.$space-scaled-xl;
164
- margin-inline: calc(-1 * #{awsui.$space-xs});
164
+ margin-inline: calc(-1 * #{awsui.$space-panel-divider-margin-horizontal});
165
165
  padding-block: 0;
166
- padding-inline: awsui.$space-s;
166
+ padding-inline: awsui.$space-panel-divider-margin-horizontal;
167
167
  > :first-child {
168
168
  margin-block-start: awsui.$space-scaled-xl;
169
169
  }
@@ -90,6 +90,15 @@
90
90
  }
91
91
  }
92
92
 
93
+ &.input-warning {
94
+ @include styles.form-warning-control();
95
+ &.input-has-icon-left {
96
+ padding-inline-start: calc(
97
+ #{styles.$control-icon-horizontal-padding} - (#{styles.$invalid-control-left-border} - #{styles.$control-border-width})
98
+ );
99
+ }
100
+ }
101
+
93
102
  &.input-type-search {
94
103
  box-sizing: border-box; // Overrides the [type='search'] CSS from normalize
95
104
  -webkit-appearance: none; /* stylelint-disable-line plugin/no-unsupported-browser-features */
@@ -92,6 +92,11 @@
92
92
  &.invalid:focus {
93
93
  @include styles.form-invalid-control();
94
94
  }
95
+
96
+ &.warning,
97
+ &.warning:focus {
98
+ @include styles.form-warning-control();
99
+ }
95
100
  }
96
101
 
97
102
  &.in-filtering-token {
@@ -149,6 +149,17 @@
149
149
  @content;
150
150
  }
151
151
 
152
+ @mixin form-warning-control {
153
+ color: awsui.$color-text-status-warning;
154
+ border-color: awsui.$color-text-status-warning;
155
+ padding-inline-start: constants.$invalid-control-left-padding;
156
+ border-inline-start-width: constants.$invalid-control-left-border;
157
+ &:focus {
158
+ box-shadow: foundation.$box-shadow-focused-light-invalid;
159
+ }
160
+ @content;
161
+ }
162
+
152
163
  @mixin label-info-link {
153
164
  margin-inline-start: typography.$base-size;
154
165
  }
@@ -16,7 +16,7 @@
16
16
  @include styles.font-panel-header;
17
17
  margin-block: 0;
18
18
  margin-inline: 0;
19
- padding-block: awsui.$space-scaled-l;
19
+ padding-block: awsui.$space-panel-header-vertical;
20
20
  padding-inline-start: awsui.$space-panel-nav-left;
21
21
  // Additional xl space to prevent text from overlapping the close button.
22
22
  padding-inline-end: calc(#{awsui.$space-scaled-xxl} + #{awsui.$space-xl});
@@ -50,7 +50,7 @@
50
50
  }
51
51
 
52
52
  .list-container {
53
- margin-block-start: awsui.$space-scaled-l;
53
+ margin-block-start: awsui.$space-panel-content-top;
54
54
  }
55
55
 
56
56
  .list {
@@ -69,7 +69,7 @@
69
69
  padding-inline-end: awsui.$space-panel-side-right;
70
70
 
71
71
  &--last {
72
- margin-block-end: awsui.$space-scaled-xxxl;
72
+ margin-block-end: awsui.$space-panel-content-bottom;
73
73
  }
74
74
  }
75
75
 
@@ -172,14 +172,15 @@
172
172
  .divider {
173
173
  border-block: none;
174
174
  border-inline: none;
175
- border-block-start: awsui.$border-divider-section-width solid awsui.$color-border-divider-default;
176
175
  }
177
176
 
178
177
  .divider-default {
179
178
  margin-block: awsui.$space-scaled-2x-xl;
180
- margin-inline: calc(-1 * #{awsui.$space-s});
179
+ margin-inline: calc(-1 * #{awsui.$space-panel-divider-margin-horizontal});
180
+ border-block-start: awsui.$border-divider-section-width solid awsui.$color-border-divider-default;
181
181
  }
182
182
 
183
183
  .divider-header {
184
184
  margin-block-start: 0;
185
+ border-block-start: awsui.$border-divider-section-width solid awsui.$color-border-panel-header;
185
186
  }
@@ -28,14 +28,16 @@ $border-radius-slider-thumb: 50%;
28
28
  }
29
29
 
30
30
  @mixin base-thumb-hover-styles {
31
- box-shadow: 0px 0 0 2px awsui.$color-background-slider-handle-ring,
31
+ box-shadow:
32
+ 0px 0 0 2px awsui.$color-background-slider-handle-ring,
32
33
  0 0 0 4px awsui.$color-background-slider-handle-default;
33
34
  }
34
35
 
35
36
  @mixin base-thumb-focus-styles {
36
37
  block-size: 20px;
37
38
  inline-size: 20px;
38
- box-shadow: 0px 0 0 2px awsui.$color-background-slider-handle-ring,
39
+ box-shadow:
40
+ 0px 0 0 2px awsui.$color-background-slider-handle-ring,
39
41
  0 0 0 4px awsui.$color-background-slider-handle-active;
40
42
  background: awsui.$color-background-slider-handle-active;
41
43
 
@@ -57,11 +59,14 @@ $border-radius-slider-thumb: 50%;
57
59
  border-inline-width: 2px;
58
60
  border-color: awsui.$color-background-slider-error-pressed;
59
61
 
60
- box-shadow: 0px 0 0 2px awsui.$color-background-slider-handle-ring,
62
+ box-shadow:
63
+ 0px 0 0 2px awsui.$color-background-slider-handle-ring,
61
64
  0 0 0 4px awsui.$color-background-slider-error-pressed;
62
65
  }
63
66
 
64
67
  @mixin error-thumb-hover-styles {
65
68
  background-color: awsui.$color-text-status-error;
66
- box-shadow: 0px 0 0 2px awsui.$color-background-slider-handle-ring, 0 0 0 4px awsui.$color-text-status-error;
69
+ box-shadow:
70
+ 0px 0 0 2px awsui.$color-background-slider-handle-ring,
71
+ 0 0 0 4px awsui.$color-text-status-error;
67
72
  }
@@ -25,6 +25,7 @@ $edit-button-padding-right: calc(
25
25
  #{awsui.$space-xs} + #{awsui.$space-xxs}
26
26
  ); // Cell vertical padding + xxs space that would normally come from the button.
27
27
  $success-icon-padding-right: calc(#{$edit-button-padding-right} + #{$icon-width-with-spacing});
28
+ $interactive-column-padding-inline-end: calc(#{$cell-horizontal-padding} + #{awsui.$space-l});
28
29
 
29
30
  @mixin cell-focus-outline {
30
31
  @include styles.focus-highlight(calc(-1 * #{awsui.$space-scaled-xxs}));
@@ -357,10 +358,15 @@ $success-icon-padding-right: calc(#{$edit-button-padding-right} + #{$icon-width-
357
358
  &:not(.body-cell-edit-active) {
358
359
  &.body-cell-interactive {
359
360
  cursor: pointer;
361
+
362
+ // Include interactive padding even when a cell is not hovered to prevent jittering when resizableColumns=false.
363
+ &:not(.resizable-columns) {
364
+ padding-inline-end: $interactive-column-padding-inline-end;
365
+ }
360
366
  }
361
367
 
362
368
  @mixin focused-editor-styles {
363
- padding-inline-end: calc(#{$cell-horizontal-padding} + #{awsui.$space-l});
369
+ padding-inline-end: $interactive-column-padding-inline-end;
364
370
  & > .body-cell-editor-wrapper,
365
371
  & > .expandable-cell-content > .body-cell-editor-wrapper {
366
372
  opacity: 1;
@@ -393,7 +399,6 @@ $success-icon-padding-right: calc(#{$edit-button-padding-right} + #{$icon-width-
393
399
  &:not(.body-cell-interactive),
394
400
  &:focus-within:focus-within,
395
401
  &.body-cell-edit-disabled-popover {
396
- padding-inline-end: calc(#{$cell-horizontal-padding} + #{awsui.$space-l});
397
402
  &.body-cell-has-success {
398
403
  // After a successful edit, we display the success icon next to the edit button and need additional padding to not let the text overflow the success icon.
399
404
  padding-inline-end: calc(#{$cell-horizontal-padding} + #{awsui.$space-l} + #{$icon-width-with-spacing});
@@ -75,4 +75,8 @@
75
75
  &.textarea-invalid {
76
76
  @include styles.form-invalid-control();
77
77
  }
78
+
79
+ &.textarea-warning {
80
+ @include styles.form-warning-control();
81
+ }
78
82
  }
@@ -68,8 +68,7 @@
68
68
  color: awsui.$color-text-body-default;
69
69
  box-sizing: border-box;
70
70
  }
71
- .token-box-error {
72
- border-color: awsui.$color-border-status-error;
71
+ @mixin token-box-validation {
73
72
  border-inline-start-width: awsui.$border-invalid-width;
74
73
 
75
74
  > .dismiss-button {
@@ -79,6 +78,14 @@
79
78
  }
80
79
  }
81
80
  }
81
+ .token-box-error {
82
+ border-color: awsui.$color-border-status-error;
83
+ @include token-box-validation;
84
+ }
85
+ .token-box-warning {
86
+ border-color: awsui.$color-border-status-warning;
87
+ @include token-box-validation;
88
+ }
82
89
  .token-box-disabled.token-box-disabled {
83
90
  border-color: awsui.$color-border-control-disabled;
84
91
  background-color: awsui.$color-background-container-content;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/alert/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAQ1C,OAAO,EAAE,UAAU,EAAE,CAAC;AAEtB,QAAA,MAAM,KAAK,mFAyDV,CAAC;AAGF,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/alert/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAQ1C,OAAO,EAAE,UAAU,EAAE,CAAC;AAEtB,QAAA,MAAM,KAAK,mFA8DV,CAAC;AAGF,eAAe,KAAK,CAAC"}
@@ -15,9 +15,9 @@ const Alert = React.forwardRef((_a, ref) => {
15
15
  const baseComponentProps = useBaseComponent('Alert', {
16
16
  props: { type, visible, dismissible: props.dismissible },
17
17
  }, analyticsMetadata);
18
- const { funnelInteractionId, submissionAttempt, funnelState, errorCount } = useFunnel();
19
- const { stepNumber, stepNameSelector } = useFunnelStep();
20
- const { subStepSelector, subStepNameSelector } = useFunnelSubStep();
18
+ const { funnelIdentifier, funnelInteractionId, funnelErrorContext, submissionAttempt, funnelState, errorCount } = useFunnel();
19
+ const { stepNumber, stepNameSelector, stepIdentifier } = useFunnelStep();
20
+ const { subStepSelector, subStepNameSelector, subStepIdentifier, subStepErrorContext } = useFunnelSubStep();
21
21
  useEffect(() => {
22
22
  var _a, _b, _c;
23
23
  if (funnelInteractionId && visible && type === 'error' && funnelState.current !== 'complete') {
@@ -30,6 +30,8 @@ const Alert = React.forwardRef((_a, ref) => {
30
30
  if (subStepSelector) {
31
31
  FunnelMetrics.funnelSubStepError({
32
32
  funnelInteractionId,
33
+ funnelIdentifier,
34
+ stepIdentifier,
33
35
  subStepSelector,
34
36
  subStepName,
35
37
  subStepNameSelector,
@@ -37,13 +39,15 @@ const Alert = React.forwardRef((_a, ref) => {
37
39
  stepName,
38
40
  stepNameSelector,
39
41
  subStepAllSelector: getSubStepAllSelector(),
40
- instanceIdentifier: analyticsMetadata === null || analyticsMetadata === void 0 ? void 0 : analyticsMetadata.instanceIdentifier,
41
- errorContext: analyticsMetadata === null || analyticsMetadata === void 0 ? void 0 : analyticsMetadata.errorContext,
42
+ subStepIdentifier,
43
+ subStepErrorContext,
42
44
  });
43
45
  }
44
46
  else {
45
47
  FunnelMetrics.funnelError({
48
+ funnelIdentifier,
46
49
  funnelInteractionId,
50
+ funnelErrorContext,
47
51
  });
48
52
  }
49
53
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/alert/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAExE,OAAO,aAAa,MAAM,YAAY,CAAC;AACvC,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AACpG,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAC7F,OAAO,EAAkC,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAIvG,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAC5B,CAAC,EAAuD,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BAAkB,EAAE,qBAAqB,EAAE;wBAC3C,kBAAkB,EAAE,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAE,kBAAkB;wBACzD,YAAY,EAAE,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAE,YAAY;qBAC9C,CAAC,CAAC;iBACJ;qBAAM;oBACL,aAAa,CAAC,WAAW,CAAC;wBACxB,mBAAmB;qBACpB,CAAC,CAAC;iBACJ;aACF;YAED,OAAO,GAAG,EAAE;gBACV,uDAAuD;gBACvD,UAAU,CAAC,OAAO,EAAE,CAAC;YACvB,CAAC,CAAC;SACH;QAED,uDAAuD;IACzD,CAAC,EAAE,CAAC,mBAAmB,EAAE,OAAO,EAAE,iBAAiB,EAAE,UAAU,CAAC,CAAC,CAAC;IAElE,OAAO,oBAAC,aAAa,kBAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,IAAM,KAAK,EAAM,kBAAkB,IAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AACtG,CAAC,CACF,CAAC;AAEF,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AACjC,eAAe,KAAK,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect } from 'react';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { AlertProps } from './interfaces';\nimport InternalAlert from './internal';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { FunnelMetrics } from '../internal/analytics';\nimport { useFunnel, useFunnelStep, useFunnelSubStep } from '../internal/analytics/hooks/use-funnel';\nimport { getNameFromSelector, getSubStepAllSelector } from '../internal/analytics/selectors';\nimport { BasePropsWithAnalyticsMetadata, getAnalyticsMetadataProps } from '../internal/base-component';\n\nexport { AlertProps };\n\nconst Alert = React.forwardRef(\n ({ type = 'info', visible = true, ...props }: AlertProps, ref: React.Ref<AlertProps.Ref>) => {\n const analyticsMetadata = getAnalyticsMetadataProps(props as BasePropsWithAnalyticsMetadata);\n const baseComponentProps = useBaseComponent<HTMLDivElement>(\n 'Alert',\n {\n props: { type, visible, dismissible: props.dismissible },\n },\n analyticsMetadata\n );\n\n const { funnelInteractionId, submissionAttempt, funnelState, errorCount } = useFunnel();\n const { stepNumber, stepNameSelector } = useFunnelStep();\n const { subStepSelector, subStepNameSelector } = useFunnelSubStep();\n\n useEffect(() => {\n if (funnelInteractionId && visible && type === 'error' && funnelState.current !== 'complete') {\n const stepName = getNameFromSelector(stepNameSelector);\n const subStepName = getNameFromSelector(subStepNameSelector);\n\n errorCount.current++;\n\n // We don't want to report an error if it is hidden, e.g. inside an Expandable Section.\n const errorIsVisible = (baseComponentProps.__internalRootRef.current?.getBoundingClientRect()?.width ?? 0) > 0;\n\n if (errorIsVisible) {\n if (subStepSelector) {\n FunnelMetrics.funnelSubStepError({\n funnelInteractionId,\n subStepSelector,\n subStepName,\n subStepNameSelector,\n stepNumber,\n stepName,\n stepNameSelector,\n subStepAllSelector: getSubStepAllSelector(),\n instanceIdentifier: analyticsMetadata?.instanceIdentifier,\n errorContext: analyticsMetadata?.errorContext,\n });\n } else {\n FunnelMetrics.funnelError({\n funnelInteractionId,\n });\n }\n }\n\n return () => {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n errorCount.current--;\n };\n }\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [funnelInteractionId, visible, submissionAttempt, errorCount]);\n\n return <InternalAlert type={type} visible={visible} {...props} {...baseComponentProps} ref={ref} />;\n }\n);\n\napplyDisplayName(Alert, 'Alert');\nexport default Alert;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/alert/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAExE,OAAO,aAAa,MA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W,GAAG,mBAAmB,CAAC,mBAAmB,CAAC,CAAC;YAE7D,UAAU,CAAC,OAAO,EAAE,CAAC;YAErB,uFAAuF;YACvF,MAAM,cAAc,GAAG,CAAC,MAAA,MAAA,MAAA,kBAAkB,CAAC,iBAAiB,CAAC,OAAO,0CAAE,qBAAqB,EAAE,0CAAE,KAAK,mCAAI,CAAC,CAAC,GAAG,CAAC,CAAC;YAE/G,IAAI,cAAc,EAAE;gBAClB,IAAI,eAAe,EAAE;oBACnB,aAAa,CAAC,kBAAkB,CAAC;wBAC/B,mBAAmB;wBACnB,gBAAgB;wBAChB,cAAc;wBACd,eAAe;wBACf,WAAW;wBACX,mBAAmB;wBACnB,UAAU;wBACV,QAAQ;wBACR,gBAAgB;wBAChB,kBAAkB,EAAE,qBAAqB,EAAE;wBAC3C,iBAAiB;wBACjB,mBAAmB;qBACpB,CAAC,CAAC;iBACJ;qBAAM;oBACL,aAAa,CAAC,WAAW,CAAC;wBACxB,gBAAgB;wBAChB,mBAAmB;wBACnB,kBAAkB;qBACnB,CAAC,CAAC;iBACJ;aACF;YAED,OAAO,GAAG,EAAE;gBACV,uDAAuD;gBACvD,UAAU,CAAC,OAAO,EAAE,CAAC;YACvB,CAAC,CAAC;SACH;QAED,uDAAuD;IACzD,CAAC,EAAE,CAAC,mBAAmB,EAAE,OAAO,EAAE,iBAAiB,EAAE,UAAU,CAAC,CAAC,CAAC;IAElE,OAAO,oBAAC,aAAa,kBAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,IAAM,KAAK,EAAM,kBAAkB,IAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AACtG,CAAC,CACF,CAAC;AAEF,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AACjC,eAAe,KAAK,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect } from 'react';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { AlertProps } from './interfaces';\nimport InternalAlert from './internal';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { FunnelMetrics } from '../internal/analytics';\nimport { useFunnel, useFunnelStep, useFunnelSubStep } from '../internal/analytics/hooks/use-funnel';\nimport { getNameFromSelector, getSubStepAllSelector } from '../internal/analytics/selectors';\nimport { BasePropsWithAnalyticsMetadata, getAnalyticsMetadataProps } from '../internal/base-component';\n\nexport { AlertProps };\n\nconst Alert = React.forwardRef(\n ({ type = 'info', visible = true, ...props }: AlertProps, ref: React.Ref<AlertProps.Ref>) => {\n const analyticsMetadata = getAnalyticsMetadataProps(props as BasePropsWithAnalyticsMetadata);\n const baseComponentProps = useBaseComponent<HTMLDivElement>(\n 'Alert',\n {\n props: { type, visible, dismissible: props.dismissible },\n },\n analyticsMetadata\n );\n\n const { funnelIdentifier, funnelInteractionId, funnelErrorContext, submissionAttempt, funnelState, errorCount } =\n useFunnel();\n const { stepNumber, stepNameSelector, stepIdentifier } = useFunnelStep();\n const { subStepSelector, subStepNameSelector, subStepIdentifier, subStepErrorContext } = useFunnelSubStep();\n\n useEffect(() => {\n if (funnelInteractionId && visible && type === 'error' && funnelState.current !== 'complete') {\n const stepName = getNameFromSelector(stepNameSelector);\n const subStepName = getNameFromSelector(subStepNameSelector);\n\n errorCount.current++;\n\n // We don't want to report an error if it is hidden, e.g. inside an Expandable Section.\n const errorIsVisible = (baseComponentProps.__internalRootRef.current?.getBoundingClientRect()?.width ?? 0) > 0;\n\n if (errorIsVisible) {\n if (subStepSelector) {\n FunnelMetrics.funnelSubStepError({\n funnelInteractionId,\n funnelIdentifier,\n stepIdentifier,\n subStepSelector,\n subStepName,\n subStepNameSelector,\n stepNumber,\n stepName,\n stepNameSelector,\n subStepAllSelector: getSubStepAllSelector(),\n subStepIdentifier,\n subStepErrorContext,\n });\n } else {\n FunnelMetrics.funnelError({\n funnelIdentifier,\n funnelInteractionId,\n funnelErrorContext,\n });\n }\n }\n\n return () => {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n errorCount.current--;\n };\n }\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [funnelInteractionId, visible, submissionAttempt, errorCount]);\n\n return <InternalAlert type={type} visible={visible} {...props} {...baseComponentProps} ref={ref} />;\n }\n);\n\napplyDisplayName(Alert, 'Alert');\nexport default Alert;\n"]}
@@ -16,6 +16,7 @@ export declare namespace AttributeEditorProps {
16
16
  info?: React.ReactNode;
17
17
  control?: FieldRenderable<T> | React.ReactNode;
18
18
  errorText?: FieldRenderable<T> | React.ReactNode;
19
+ warningText?: FieldRenderable<T> | React.ReactNode;
19
20
  constraintText?: FieldRenderable<T> | React.ReactNode;
20
21
  }
21
22
  interface RemoveButtonClickDetail {
@@ -33,6 +34,7 @@ export declare namespace AttributeEditorProps {
33
34
  }
34
35
  interface I18nStrings<T = any> {
35
36
  errorIconAriaLabel?: string;
37
+ warningIconAriaLabel?: string;
36
38
  itemRemovedAriaLive?: string;
37
39
  /**
38
40
  * @deprecated Use `removeButtonAriaLabel` on the component instead.
@@ -84,6 +86,8 @@ export interface AttributeEditorProps<T> extends BaseComponentProps {
84
86
  * * `info` (ReactNode) - Info link for the form field.
85
87
  * * `errorText` ((item, itemIndex) => ReactNode) - Error message text to display as a control validation message.
86
88
  * It renders the form field as invalid if the returned value is not `null` or `undefined`.
89
+ * * `warningText` ((item, itemIndex) => ReactNode) - Warning message text to display as a control validation message.
90
+ * It renders the form field in a warning state if the returned value is not `null` or `undefined`.
87
91
  * * `constraintText` ((item, itemIndex) => ReactNode) - Text to display as a constraint message below the field.
88
92
  * * `control` ((item, itemIndex) => ReactNode) - A control to use as the input for the field.
89
93
  *
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/attribute-editor/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,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,EAAE,CAAC,KAAK,MAAM,CAAC;KAC7C;CACF;AAED,MAAM,WAAW,oBAAoB,CAAC,CAAC,CAAE,SAAQ,kBAAkB;IACjE;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAExB;;OAEG;IACH,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAEjC;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,qBAAqB,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,CAAC;IAE5C;;;OAGG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IAEzB;;;;OAIG;IACH,eAAe,CAAC,EAAE,oBAAoB,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC;IAElE;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;;;;;;;;;;;;OAaG;IACH,UAAU,EAAE,aAAa,CAAC,oBAAoB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;IAEnE;;OAEG;IACH,gBAAgB,CAAC,EAAE,yBAAyB,CAAC;IAE7C;;;OAGG;IACH,mBAAmB,CAAC,EAAE,yBAAyB,CAAC,oBAAoB,CAAC,uBAAuB,CAAC,CAAC;IAE9F;;OAEG;IACH,WAAW,CAAC,EAAE,oBAAoB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;CACnD"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/attribute-editor/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\n\n/*\n * HACK: Cast the component to a named parametrized interface.\n *\n * This lets us use React.forwardRef and still let the component have type\n * parameters, and the naming convention lets the documenter know that this is\n * a forwardRef-wrapped component.\n *\n * We don't need to expose this type to customers because it's just a simple\n * function type.\n */\nexport interface AttributeEditorForwardRefType {\n <T>(props: AttributeEditorProps<T> & { ref?: React.Ref<AttributeEditorProps.Ref> }): JSX.Element;\n}\n\nexport namespace AttributeEditorProps {\n export interface IsItemRemovableFunction<T> {\n (item: T): boolean;\n }\n\n export type FieldRenderable<T> = (item: T, itemIndex: number) => React.ReactNode;\n export interface FieldDefinition<T> {\n label?: React.ReactNode;\n info?: React.ReactNode;\n control?: FieldRenderable<T> | React.ReactNode;\n errorText?: FieldRenderable<T> | React.ReactNode;\n constraintText?: FieldRenderable<T> | React.ReactNode;\n }\n\n export interface RemoveButtonClickDetail {\n itemIndex: number;\n }\n\n export interface Ref {\n /**\n * Focuses the 'remove' button for the given row index.\n */\n focusRemoveButton(itemIndex: number): void;\n /**\n * Focuses the 'add' button. Use this, for example, after a user removes the last row.\n */\n focusAddButton(): void;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n export interface I18nStrings<T = any> {\n errorIconAriaLabel?: string;\n itemRemovedAriaLive?: string;\n\n /**\n * @deprecated Use `removeButtonAriaLabel` on the component instead.\n */\n removeButtonAriaLabel?: (item: T) => string;\n }\n}\n\nexport interface AttributeEditorProps<T> extends BaseComponentProps {\n /**\n * Displayed when there are no items to display.\n */\n empty?: React.ReactNode;\n\n /**\n * Displayed below the add button. Use it for additional information related to the attribute editor.\n */\n additionalInfo?: React.ReactNode;\n\n /**\n * Specifies the text that's displayed in the add button.\n */\n addButtonText: string;\n\n /**\n * Specifies the text that's displayed in the remove button.\n * @i18n\n */\n removeButtonText?: string;\n\n /**\n * Adds an `aria-label` to the remove button.\n */\n removeButtonAriaLabel?: (item: T) => string;\n\n /**\n * Specifies the items that serve as the data source for all rows.\n * The display of a row is handled by the `definition` property.\n */\n items?: ReadonlyArray<T>;\n\n /**\n * Function that determines whether an item is removable. When this function returns `false`, the remove\n * button is not rendered and the user can't remove the item.\n * By default, all items are removable.\n */\n isItemRemovable?: AttributeEditorProps.IsItemRemovableFunction<T>;\n\n /**\n * Determines whether the add button is disabled.\n */\n disableAddButton?: boolean;\n\n /**\n * Defines the editor configuration. Each object in the array represents one form field in the row.\n *\n * * `label` (ReactNode) - Text label for the form field.\n * * `info` (ReactNode) - Info link for the form field.\n * * `errorText` ((item, itemIndex) => ReactNode) - Error message text to display as a control validation message.\n * It renders the form field as invalid if the returned value is not `null` or `undefined`.\n * * `constraintText` ((item, itemIndex) => ReactNode) - Text to display as a constraint message below the field.\n * * `control` ((item, itemIndex) => ReactNode) - A control to use as the input for the field.\n *\n * A maximum of four fields are supported.\n */\n definition: ReadonlyArray<AttributeEditorProps.FieldDefinition<T>>;\n\n /**\n * Called when add button is clicked.\n */\n onAddButtonClick?: NonCancelableEventHandler;\n\n /**\n * Called when remove button is clicked.\n * The event `detail` contains the index of the corresponding item.\n */\n onRemoveButtonClick?: NonCancelableEventHandler<AttributeEditorProps.RemoveButtonClickDetail>;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n */\n i18nStrings?: AttributeEditorProps.I18nStrings<T>;\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/attribute-editor/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\n\n/*\n * HACK: Cast the component to a named parametrized interface.\n *\n * This lets us use React.forwardRef and still let the component have type\n * parameters, and the naming convention lets the documenter know that this is\n * a forwardRef-wrapped component.\n *\n * We don't need to expose this type to customers because it's just a simple\n * function type.\n */\nexport interface AttributeEditorForwardRefType {\n <T>(props: AttributeEditorProps<T> & { ref?: React.Ref<AttributeEditorProps.Ref> }): JSX.Element;\n}\n\nexport namespace AttributeEditorProps {\n export interface IsItemRemovableFunction<T> {\n (item: T): boolean;\n }\n\n export type FieldRenderable<T> = (item: T, itemIndex: number) => React.ReactNode;\n export interface FieldDefinition<T> {\n label?: React.ReactNode;\n info?: React.ReactNode;\n control?: FieldRenderable<T> | React.ReactNode;\n errorText?: FieldRenderable<T> | React.ReactNode;\n warningText?: FieldRenderable<T> | React.ReactNode;\n constraintText?: FieldRenderable<T> | React.ReactNode;\n }\n\n export interface RemoveButtonClickDetail {\n itemIndex: number;\n }\n\n export interface Ref {\n /**\n * Focuses the 'remove' button for the given row index.\n */\n focusRemoveButton(itemIndex: number): void;\n /**\n * Focuses the 'add' button. Use this, for example, after a user removes the last row.\n */\n focusAddButton(): void;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n export interface I18nStrings<T = any> {\n errorIconAriaLabel?: string;\n warningIconAriaLabel?: string;\n itemRemovedAriaLive?: string;\n\n /**\n * @deprecated Use `removeButtonAriaLabel` on the component instead.\n */\n removeButtonAriaLabel?: (item: T) => string;\n }\n}\n\nexport interface AttributeEditorProps<T> extends BaseComponentProps {\n /**\n * Displayed when there are no items to display.\n */\n empty?: React.ReactNode;\n\n /**\n * Displayed below the add button. Use it for additional information related to the attribute editor.\n */\n additionalInfo?: React.ReactNode;\n\n /**\n * Specifies the text that's displayed in the add button.\n */\n addButtonText: string;\n\n /**\n * Specifies the text that's displayed in the remove button.\n * @i18n\n */\n removeButtonText?: string;\n\n /**\n * Adds an `aria-label` to the remove button.\n */\n removeButtonAriaLabel?: (item: T) => string;\n\n /**\n * Specifies the items that serve as the data source for all rows.\n * The display of a row is handled by the `definition` property.\n */\n items?: ReadonlyArray<T>;\n\n /**\n * Function that determines whether an item is removable. When this function returns `false`, the remove\n * button is not rendered and the user can't remove the item.\n * By default, all items are removable.\n */\n isItemRemovable?: AttributeEditorProps.IsItemRemovableFunction<T>;\n\n /**\n * Determines whether the add button is disabled.\n */\n disableAddButton?: boolean;\n\n /**\n * Defines the editor configuration. Each object in the array represents one form field in the row.\n *\n * * `label` (ReactNode) - Text label for the form field.\n * * `info` (ReactNode) - Info link for the form field.\n * * `errorText` ((item, itemIndex) => ReactNode) - Error message text to display as a control validation message.\n * It renders the form field as invalid if the returned value is not `null` or `undefined`.\n * * `warningText` ((item, itemIndex) => ReactNode) - Warning message text to display as a control validation message.\n * It renders the form field in a warning state if the returned value is not `null` or `undefined`.\n * * `constraintText` ((item, itemIndex) => ReactNode) - Text to display as a constraint message below the field.\n * * `control` ((item, itemIndex) => ReactNode) - A control to use as the input for the field.\n *\n * A maximum of four fields are supported.\n */\n definition: ReadonlyArray<AttributeEditorProps.FieldDefinition<T>>;\n\n /**\n * Called when add button is clicked.\n */\n onAddButtonClick?: NonCancelableEventHandler;\n\n /**\n * Called when remove button is clicked.\n * The event `detail` contains the index of the corresponding item.\n */\n onRemoveButtonClick?: NonCancelableEventHandler<AttributeEditorProps.RemoveButtonClickDetail>;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n */\n i18nStrings?: AttributeEditorProps.I18nStrings<T>;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"row.d.ts","sourceRoot":"","sources":["../../../src/attribute-editor/row.tsx"],"names":[],"mappings":";AAMA,OAA6B,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACzF,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAA0B,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AASvF,MAAM,WAAW,QAAQ,CAAC,CAAC;IACzB,UAAU,EAAE,sBAAsB,GAAG,IAAI,CAAC;IAC1C,IAAI,EAAE,CAAC,CAAC;IACR,UAAU,EAAE,aAAa,CAAC,oBAAoB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;IACnE,WAAW,EAAE,oBAAoB,CAAC,WAAW,GAAG,SAAS,CAAC;IAC1D,KAAK,EAAE,MAAM,CAAC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G,6BAiFgB,WAAW,CAAC"}
@@ -35,7 +35,10 @@ export const Row = React.memo(({ breakpoint, item, definition, i18nStrings = {},
35
35
  return (React.createElement(InternalBox, { className: styles.row, margin: { bottom: 's' } },
36
36
  React.createElement("div", { role: "group", "aria-labelledby": `${firstControlId}-label ${firstControlId}` },
37
37
  React.createElement(InternalGrid, { __breakpoint: breakpoint, gridDefinition: removable ? REMOVABLE_GRID_DEFINITION : GRID_DEFINITION },
38
- React.createElement(InternalColumnLayout, { className: styles['row-control'], columns: definition.length, __breakpoint: breakpoint }, definition.map(({ info, label, constraintText, errorText, control }, defIndex) => (React.createElement(InternalFormField, { key: defIndex, className: styles.field, label: label, info: info, constraintText: render(item, index, constraintText), errorText: render(item, index, errorText), stretch: true, i18nStrings: { errorIconAriaLabel: i18nStrings.errorIconAriaLabel }, __hideLabel: isWideViewport && index > 0, controlId: defIndex === 0 ? firstControlId : undefined }, render(item, index, control))))),
38
+ React.createElement(InternalColumnLayout, { className: styles['row-control'], columns: definition.length, __breakpoint: breakpoint }, definition.map(({ info, label, constraintText, errorText, warningText, control }, defIndex) => (React.createElement(InternalFormField, { key: defIndex, className: styles.field, label: label, info: info, constraintText: render(item, index, constraintText), errorText: render(item, index, errorText), warningText: render(item, index, warningText), stretch: true, i18nStrings: {
39
+ errorIconAriaLabel: i18nStrings.errorIconAriaLabel,
40
+ warningIconAriaLabel: i18nStrings.warningIconAriaLabel,
41
+ }, __hideLabel: isWideViewport && index > 0, controlId: defIndex === 0 ? firstControlId : undefined }, render(item, index, control))))),
39
42
  removable && (React.createElement(ButtonContainer, { index: index, isNarrowViewport: isNarrowViewport, hasLabel: definition.some(row => row.label) },
40
43
  React.createElement(InternalButton, { className: styles['remove-button'], formAction: "none", ref: ref => {
41
44
  removeButtonRefs[index] = ref !== null && ref !== void 0 ? ref : undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"row.js","sourceRoot":"","sources":["../../../src/attribute-editor/row.tsx"],"names":[],"mappings":"AAAA,qEAA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I,oBAAC,OAAO,OAAG,CACpB,CACf,CAAC;AACJ,CAAC,CACwC,CAAC;AAS5C,MAAM,eAAe,GAAG,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAE,QAAQ,EAAmB,EAAE,EAAE,CAAC,CAC5F,6BACE,SAAS,EAAE,IAAI,CAAC;QACd,CAAC,MAAM,CAAC,2BAA2B,CAAC,CAAC,EAAE,CAAC,gBAAgB,IAAI,KAAK,KAAK,CAAC,IAAI,QAAQ;QACnF,CAAC,MAAM,CAAC,0BAA0B,CAAC,CAAC,EAAE,CAAC,gBAAgB,IAAI,KAAK,KAAK,CAAC,IAAI,CAAC,QAAQ;QACnF,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,EAAE,gBAAgB;KAC1C,CAAC,IAED,QAAQ,CACL,CACP,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport InternalBox from '../box/internal';\nimport styles from './styles.css.js';\nimport React, { useCallback } from 'react';\nimport InternalFormField from '../form-field/internal';\nimport InternalColumnLayout, { ColumnLayoutBreakpoint } from '../column-layout/internal';\nimport { AttributeEditorProps } from './interfaces';\nimport { ButtonProps } from '../button/interfaces';\nimport { fireNonCancelableEvent, NonCancelableEventHandler } from '../internal/events';\nimport InternalGrid from '../grid/internal';\nimport { InternalButton } from '../button/internal';\nimport clsx from 'clsx';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { useInternalI18n } from '../i18n/context';\n\nconst Divider = () => <InternalBox className={styles.divider} padding={{ top: 'l' }} />;\n\nexport interface RowProps<T> {\n breakpoint: ColumnLayoutBreakpoint | null;\n item: T;\n definition: ReadonlyArray<AttributeEditorProps.FieldDefinition<T>>;\n i18nStrings: AttributeEditorProps.I18nStrings | undefined;\n index: number;\n removable: boolean;\n removeButtonText?: string;\n removeButtonRefs: Array<ButtonProps.Ref | undefined>;\n onRemoveButtonClick?: NonCancelableEventHandler<AttributeEditorProps.RemoveButtonClickDetail>;\n removeButtonAriaLabel?: (item: T) => string;\n}\n\nfunction render<T>(\n item: T,\n itemIndex: number,\n slot: AttributeEditorProps.FieldRenderable<T> | React.ReactNode | undefined\n) {\n if (isSlotFunction(slot)) {\n return slot(item, itemIndex);\n }\n return slot;\n\n function isSlotFunction(slot: unknown): slot is AttributeEditorProps.FieldRenderable<T> {\n return typeof slot === 'function';\n }\n}\n\nconst GRID_DEFINITION = [{ colspan: { default: 12, xs: 9 } }];\nconst REMOVABLE_GRID_DEFINITION = [{ colspan: { default: 12, xs: 9 } }, { colspan: { default: 12, xs: 3 } }];\nexport const Row = React.memo(\n <T,>({\n breakpoint,\n item,\n definition,\n i18nStrings = {},\n index,\n removable,\n removeButtonText,\n removeButtonRefs,\n onRemoveButtonClick,\n removeButtonAriaLabel,\n }: RowProps<T>) => {\n const i18n = useInternalI18n('attribute-editor');\n const isNarrowViewport = breakpoint === 'default' || breakpoint === 'xxs';\n const isWideViewport = !isNarrowViewport;\n\n const handleRemoveClick = useCallback(() => {\n fireNonCancelableEvent(onRemoveButtonClick, { itemIndex: index });\n }, [onRemoveButtonClick, index]);\n\n const firstControlId = useUniqueId('first-control-id-');\n\n return (\n <InternalBox className={styles.row} margin={{ bottom: 's' }}>\n <div role=\"group\" aria-labelledby={`${firstControlId}-label ${firstControlId}`}>\n <InternalGrid\n __breakpoint={breakpoint}\n gridDefinition={removable ? REMOVABLE_GRID_DEFINITION : GRID_DEFINITION}\n >\n <InternalColumnLayout\n className={styles['row-control']}\n columns={definition.length}\n __breakpoint={breakpoint}\n >\n {definition.map(({ info, label, constraintText, errorText, control }, defIndex) => (\n <InternalFormField\n key={defIndex}\n className={styles.field}\n label={label}\n info={info}\n constraintText={render(item, index, constraintText)}\n errorText={render(item, index, errorText)}\n stretch={true}\n i18nStrings={{ errorIconAriaLabel: i18nStrings.errorIconAriaLabel }}\n __hideLabel={isWideViewport && index > 0}\n controlId={defIndex === 0 ? firstControlId : undefined}\n >\n {render(item, index, control)}\n </InternalFormField>\n ))}\n </InternalColumnLayout>\n {removable && (\n <ButtonContainer\n index={index}\n isNarrowViewport={isNarrowViewport}\n hasLabel={definition.some(row => row.label)}\n >\n <InternalButton\n className={styles['remove-button']}\n formAction=\"none\"\n ref={ref => {\n removeButtonRefs[index] = ref ?? undefined;\n }}\n ariaLabel={(removeButtonAriaLabel ?? i18nStrings.removeButtonAriaLabel)?.(item)}\n onClick={handleRemoveClick}\n >\n {i18n('removeButtonText', removeButtonText)}\n </InternalButton>\n </ButtonContainer>\n )}\n </InternalGrid>\n </div>\n {isNarrowViewport && <Divider />}\n </InternalBox>\n );\n }\n) as <T>(props: RowProps<T>) => JSX.Element;\n\ninterface ButtonContainer {\n index: number;\n children: React.ReactNode;\n isNarrowViewport: boolean;\n hasLabel: boolean;\n}\n\nconst ButtonContainer = ({ index, children, isNarrowViewport, hasLabel }: ButtonContainer) => (\n <div\n className={clsx({\n [styles['button-container-haslabel']]: !isNarrowViewport && index === 0 && hasLabel,\n [styles['button-container-nolabel']]: !isNarrowViewport && index === 0 && !hasLabel,\n [styles['right-align']]: isNarrowViewport,\n })}\n >\n {children}\n </div>\n);\n"]}
1
+ {"version":3,"file":"row.js","sourceRoot":"","sources":["../../../src/attribute-editor/row.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAC1C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AACvD,OAAO,oBAAgD,MAAM,2BAA2B,CAAC;AAGzF,OAAO,EAAE,sBAAsB,EAA6B,MAAM,oBAAoB,CAAC;AACvF,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,IAAI,MAAM,MAAM,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AAC,IAAI,QAAQ;QACnF,CAAC,MAAM,CAAC,0BAA0B,CAAC,CAAC,EAAE,CAAC,gBAAgB,IAAI,KAAK,KAAK,CAAC,IAAI,CAAC,QAAQ;QACnF,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,EAAE,gBAAgB;KAC1C,CAAC,IAED,QAAQ,CACL,CACP,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport InternalBox from '../box/internal';\nimport styles from './styles.css.js';\nimport React, { useCallback } from 'react';\nimport InternalFormField from '../form-field/internal';\nimport InternalColumnLayout, { ColumnLayoutBreakpoint } from '../column-layout/internal';\nimport { AttributeEditorProps } from './interfaces';\nimport { ButtonProps } from '../button/interfaces';\nimport { fireNonCancelableEvent, NonCancelableEventHandler } from '../internal/events';\nimport InternalGrid from '../grid/internal';\nimport { InternalButton } from '../button/internal';\nimport clsx from 'clsx';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { useInternalI18n } from '../i18n/context';\n\nconst Divider = () => <InternalBox className={styles.divider} padding={{ top: 'l' }} />;\n\nexport interface RowProps<T> {\n breakpoint: ColumnLayoutBreakpoint | null;\n item: T;\n definition: ReadonlyArray<AttributeEditorProps.FieldDefinition<T>>;\n i18nStrings: AttributeEditorProps.I18nStrings | undefined;\n index: number;\n removable: boolean;\n removeButtonText?: string;\n removeButtonRefs: Array<ButtonProps.Ref | undefined>;\n onRemoveButtonClick?: NonCancelableEventHandler<AttributeEditorProps.RemoveButtonClickDetail>;\n removeButtonAriaLabel?: (item: T) => string;\n}\n\nfunction render<T>(\n item: T,\n itemIndex: number,\n slot: AttributeEditorProps.FieldRenderable<T> | React.ReactNode | undefined\n) {\n if (isSlotFunction(slot)) {\n return slot(item, itemIndex);\n }\n return slot;\n\n function isSlotFunction(slot: unknown): slot is AttributeEditorProps.FieldRenderable<T> {\n return typeof slot === 'function';\n }\n}\n\nconst GRID_DEFINITION = [{ colspan: { default: 12, xs: 9 } }];\nconst REMOVABLE_GRID_DEFINITION = [{ colspan: { default: 12, xs: 9 } }, { colspan: { default: 12, xs: 3 } }];\nexport const Row = React.memo(\n <T,>({\n breakpoint,\n item,\n definition,\n i18nStrings = {},\n index,\n removable,\n removeButtonText,\n removeButtonRefs,\n onRemoveButtonClick,\n removeButtonAriaLabel,\n }: RowProps<T>) => {\n const i18n = useInternalI18n('attribute-editor');\n const isNarrowViewport = breakpoint === 'default' || breakpoint === 'xxs';\n const isWideViewport = !isNarrowViewport;\n\n const handleRemoveClick = useCallback(() => {\n fireNonCancelableEvent(onRemoveButtonClick, { itemIndex: index });\n }, [onRemoveButtonClick, index]);\n\n const firstControlId = useUniqueId('first-control-id-');\n\n return (\n <InternalBox className={styles.row} margin={{ bottom: 's' }}>\n <div role=\"group\" aria-labelledby={`${firstControlId}-label ${firstControlId}`}>\n <InternalGrid\n __breakpoint={breakpoint}\n gridDefinition={removable ? REMOVABLE_GRID_DEFINITION : GRID_DEFINITION}\n >\n <InternalColumnLayout\n className={styles['row-control']}\n columns={definition.length}\n __breakpoint={breakpoint}\n >\n {definition.map(({ info, label, constraintText, errorText, warningText, control }, defIndex) => (\n <InternalFormField\n key={defIndex}\n className={styles.field}\n label={label}\n info={info}\n constraintText={render(item, index, constraintText)}\n errorText={render(item, index, errorText)}\n warningText={render(item, index, warningText)}\n stretch={true}\n i18nStrings={{\n errorIconAriaLabel: i18nStrings.errorIconAriaLabel,\n warningIconAriaLabel: i18nStrings.warningIconAriaLabel,\n }}\n __hideLabel={isWideViewport && index > 0}\n controlId={defIndex === 0 ? firstControlId : undefined}\n >\n {render(item, index, control)}\n </InternalFormField>\n ))}\n </InternalColumnLayout>\n {removable && (\n <ButtonContainer\n index={index}\n isNarrowViewport={isNarrowViewport}\n hasLabel={definition.some(row => row.label)}\n >\n <InternalButton\n className={styles['remove-button']}\n formAction=\"none\"\n ref={ref => {\n removeButtonRefs[index] = ref ?? undefined;\n }}\n ariaLabel={(removeButtonAriaLabel ?? i18nStrings.removeButtonAriaLabel)?.(item)}\n onClick={handleRemoveClick}\n >\n {i18n('removeButtonText', removeButtonText)}\n </InternalButton>\n </ButtonContainer>\n )}\n </InternalGrid>\n </div>\n {isNarrowViewport && <Divider />}\n </InternalBox>\n );\n }\n) as <T>(props: RowProps<T>) => JSX.Element;\n\ninterface ButtonContainer {\n index: number;\n children: React.ReactNode;\n isNarrowViewport: boolean;\n hasLabel: boolean;\n}\n\nconst ButtonContainer = ({ index, children, isNarrowViewport, hasLabel }: ButtonContainer) => (\n <div\n className={clsx({\n [styles['button-container-haslabel']]: !isNarrowViewport && index === 0 && hasLabel,\n [styles['button-container-nolabel']]: !isNarrowViewport && index === 0 && !hasLabel,\n [styles['right-align']]: isNarrowViewport,\n })}\n >\n {children}\n </div>\n);\n"]}
@@ -1,24 +1,24 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "content": "awsui_content_vjswe_17wax_103",
5
- "button": "awsui_button_vjswe_17wax_107",
6
- "variant-normal": "awsui_variant-normal_vjswe_17wax_158",
7
- "variant-icon": "awsui_variant-icon_vjswe_17wax_201",
8
- "variant-modal-dismiss": "awsui_variant-modal-dismiss_vjswe_17wax_201",
9
- "variant-flashbar-icon": "awsui_variant-flashbar-icon_vjswe_17wax_201",
10
- "variant-inline-icon": "awsui_variant-inline-icon_vjswe_17wax_222",
11
- "disabled": "awsui_disabled_vjswe_17wax_243",
12
- "variant-primary": "awsui_variant-primary_vjswe_17wax_251",
13
- "variant-link": "awsui_variant-link_vjswe_17wax_344",
14
- "variant-inline-link": "awsui_variant-inline-link_vjswe_17wax_623",
15
- "variant-breadcrumb-group": "awsui_variant-breadcrumb-group_vjswe_17wax_906",
16
- "variant-menu-trigger": "awsui_variant-menu-trigger_vjswe_17wax_1004",
17
- "button-no-text": "awsui_button-no-text_vjswe_17wax_1097",
18
- "button-no-wrap": "awsui_button-no-wrap_vjswe_17wax_1101",
19
- "full-width": "awsui_full-width_vjswe_17wax_1104",
20
- "icon-left": "awsui_icon-left_vjswe_17wax_1123",
21
- "icon-right": "awsui_icon-right_vjswe_17wax_1128",
22
- "icon": "awsui_icon_vjswe_17wax_1123"
4
+ "content": "awsui_content_vjswe_1ifev_103",
5
+ "button": "awsui_button_vjswe_1ifev_107",
6
+ "variant-normal": "awsui_variant-normal_vjswe_1ifev_158",
7
+ "variant-icon": "awsui_variant-icon_vjswe_1ifev_201",
8
+ "variant-modal-dismiss": "awsui_variant-modal-dismiss_vjswe_1ifev_201",
9
+ "variant-flashbar-icon": "awsui_variant-flashbar-icon_vjswe_1ifev_201",
10
+ "variant-inline-icon": "awsui_variant-inline-icon_vjswe_1ifev_222",
11
+ "disabled": "awsui_disabled_vjswe_1ifev_243",
12
+ "variant-primary": "awsui_variant-primary_vjswe_1ifev_251",
13
+ "variant-link": "awsui_variant-link_vjswe_1ifev_344",
14
+ "variant-inline-link": "awsui_variant-inline-link_vjswe_1ifev_623",
15
+ "variant-breadcrumb-group": "awsui_variant-breadcrumb-group_vjswe_1ifev_906",
16
+ "variant-menu-trigger": "awsui_variant-menu-trigger_vjswe_1ifev_1004",
17
+ "button-no-text": "awsui_button-no-text_vjswe_1ifev_1097",
18
+ "button-no-wrap": "awsui_button-no-wrap_vjswe_1ifev_1101",
19
+ "full-width": "awsui_full-width_vjswe_1ifev_1104",
20
+ "icon-left": "awsui_icon-left_vjswe_1ifev_1123",
21
+ "icon-right": "awsui_icon-right_vjswe_1ifev_1128",
22
+ "icon": "awsui_icon_vjswe_1ifev_1123"
23
23
  };
24
24