@cloudscape-design/components 3.0.141 → 3.0.143

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 (38) hide show
  1. package/app-layout/index.d.ts.map +1 -1
  2. package/app-layout/index.js +4 -3
  3. package/app-layout/index.js.map +1 -1
  4. package/app-layout/toggles/styles.css.js +1 -3
  5. package/app-layout/toggles/styles.scoped.css +1 -50
  6. package/app-layout/toggles/styles.selectors.js +1 -3
  7. package/app-layout/tools-and-split-panel.d.ts +2 -4
  8. package/app-layout/tools-and-split-panel.d.ts.map +1 -1
  9. package/app-layout/tools-and-split-panel.js +2 -3
  10. package/app-layout/tools-and-split-panel.js.map +1 -1
  11. package/attribute-editor/internal.d.ts.map +1 -1
  12. package/attribute-editor/internal.js +3 -1
  13. package/attribute-editor/internal.js.map +1 -1
  14. package/attribute-editor/styles.css.js +14 -13
  15. package/attribute-editor/styles.scoped.css +24 -24
  16. package/attribute-editor/styles.selectors.js +14 -13
  17. package/internal/context/split-panel-context.d.ts +0 -1
  18. package/internal/context/split-panel-context.d.ts.map +1 -1
  19. package/internal/context/split-panel-context.js +0 -1
  20. package/internal/context/split-panel-context.js.map +1 -1
  21. package/internal/environment.js +1 -1
  22. package/internal/manifest.json +1 -1
  23. package/package.json +1 -1
  24. package/property-filter/utils.d.ts.map +1 -1
  25. package/property-filter/utils.js +3 -6
  26. package/property-filter/utils.js.map +1 -1
  27. package/split-panel/index.d.ts.map +1 -1
  28. package/split-panel/index.js +2 -2
  29. package/split-panel/index.js.map +1 -1
  30. package/test-utils/tsconfig.tsbuildinfo +1 -1
  31. package/app-layout/split-panel-wrapper.d.ts +0 -10
  32. package/app-layout/split-panel-wrapper.d.ts.map +0 -1
  33. package/app-layout/split-panel-wrapper.js +0 -13
  34. package/app-layout/split-panel-wrapper.js.map +0 -1
  35. package/app-layout/toggles/circular-button.d.ts +0 -8
  36. package/app-layout/toggles/circular-button.d.ts.map +0 -1
  37. package/app-layout/toggles/circular-button.js +0 -15
  38. package/app-layout/toggles/circular-button.js.map +0 -1
@@ -90,10 +90,10 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
90
90
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
91
91
  SPDX-License-Identifier: Apache-2.0
92
92
  */
93
- .awsui_empty_n4qlp_19053_93:not(#\9) {
94
- animation: awsui_awsui-motion-fade-in_n4qlp_19053_1 var(--motion-duration-transition-show-paced-ai4wlf, 180ms) var(--motion-easing-transition-show-paced-bg1hyg, ease-out);
93
+ .awsui_empty-appear_n4qlp_12hrz_93:not(#\9) {
94
+ animation: awsui_awsui-motion-fade-in_n4qlp_12hrz_1 var(--motion-duration-transition-show-paced-ai4wlf, 180ms) var(--motion-easing-transition-show-paced-bg1hyg, ease-out);
95
95
  }
96
- @keyframes awsui_awsui-motion-fade-in_n4qlp_19053_1 {
96
+ @keyframes awsui_awsui-motion-fade-in_n4qlp_12hrz_1 {
97
97
  from {
98
98
  opacity: 0.2;
99
99
  }
@@ -102,12 +102,12 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
102
102
  }
103
103
  }
104
104
  @media (prefers-reduced-motion: reduce) {
105
- .awsui_empty_n4qlp_19053_93:not(#\9) {
105
+ .awsui_empty-appear_n4qlp_12hrz_93:not(#\9) {
106
106
  animation: none;
107
107
  transition: none;
108
108
  }
109
109
  }
110
- .awsui-motion-disabled .awsui_empty_n4qlp_19053_93:not(#\9), .awsui-mode-entering .awsui_empty_n4qlp_19053_93:not(#\9) {
110
+ .awsui-motion-disabled .awsui_empty-appear_n4qlp_12hrz_93:not(#\9), .awsui-mode-entering .awsui_empty-appear_n4qlp_12hrz_93:not(#\9) {
111
111
  animation: none;
112
112
  transition: none;
113
113
  }
@@ -116,7 +116,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
116
116
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
117
117
  SPDX-License-Identifier: Apache-2.0
118
118
  */
119
- .awsui_root_n4qlp_19053_119:not(#\9) {
119
+ .awsui_root_n4qlp_12hrz_119:not(#\9) {
120
120
  /* stylelint-disable-next-line plugin/no-unsupported-browser-features */
121
121
  border-collapse: separate;
122
122
  border-spacing: 0;
@@ -154,45 +154,45 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
154
154
  display: block;
155
155
  }
156
156
 
157
- .awsui_empty_n4qlp_19053_93:not(#\9) {
157
+ .awsui_empty_n4qlp_12hrz_93:not(#\9) {
158
158
  font-size: var(--font-body-m-size-sregvd, 14px);
159
159
  line-height: var(--font-body-m-line-height-i7xxvv, 22px);
160
160
  color: var(--color-text-empty-fjv325, #5f6b7a);
161
161
  }
162
162
 
163
- .awsui_row_n4qlp_19053_137:not(#\9) {
163
+ .awsui_row_n4qlp_12hrz_137:not(#\9) {
164
164
  /* used in test-utils */
165
165
  }
166
166
 
167
- .awsui_row-control_n4qlp_19053_141:not(#\9) {
167
+ .awsui_row-control_n4qlp_12hrz_141:not(#\9) {
168
168
  /* used in test-utils */
169
169
  }
170
170
 
171
- .awsui_field_n4qlp_19053_145:not(#\9) {
171
+ .awsui_field_n4qlp_12hrz_145:not(#\9) {
172
172
  /* used in test-utils */
173
173
  }
174
174
 
175
- .awsui_add-button_n4qlp_19053_149:not(#\9) {
175
+ .awsui_add-button_n4qlp_12hrz_149:not(#\9) {
176
176
  /* used in test-utils */
177
177
  }
178
178
 
179
- .awsui_remove-button_n4qlp_19053_153:not(#\9) {
179
+ .awsui_remove-button_n4qlp_12hrz_153:not(#\9) {
180
180
  /* used in test-utils */
181
181
  }
182
182
 
183
- .awsui_button-container-haslabel_n4qlp_19053_157:not(#\9) {
183
+ .awsui_button-container-haslabel_n4qlp_12hrz_157:not(#\9) {
184
184
  padding-top: calc(var(--space-xxs-ynfts5, 4px) + var(--font-body-m-line-height-i7xxvv, 22px));
185
185
  }
186
186
 
187
- .awsui_button-container-nolabel_n4qlp_19053_161:not(#\9) {
187
+ .awsui_button-container-nolabel_n4qlp_12hrz_161:not(#\9) {
188
188
  padding-top: var(--space-xxs-ynfts5, 4px);
189
189
  }
190
190
 
191
- .awsui_divider_n4qlp_19053_165:not(#\9) {
191
+ .awsui_divider_n4qlp_12hrz_165:not(#\9) {
192
192
  border-bottom: var(--border-divider-section-width-4wm2it, 2px) solid var(--color-border-divider-default-7s2wjw, #e9ebed);
193
193
  }
194
194
 
195
- .awsui_additional-info_n4qlp_19053_169:not(#\9) {
195
+ .awsui_additional-info_n4qlp_12hrz_169:not(#\9) {
196
196
  color: var(--color-text-form-secondary-ih9x7l, #5f6b7a);
197
197
  font-size: var(--font-body-s-size-ukw2p9, 12px);
198
198
  line-height: var(--font-body-s-line-height-kdsbrl, 16px);
@@ -202,7 +202,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
202
202
  margin-top: var(--space-xxs-ynfts5, 4px);
203
203
  /* stylelint-disable-next-line selector-max-type */
204
204
  }
205
- .awsui_additional-info_n4qlp_19053_169 > a:not(#\9) {
205
+ .awsui_additional-info_n4qlp_12hrz_169 > a:not(#\9) {
206
206
  color: var(--color-text-link-default-5f186r, #0972d3);
207
207
  font-weight: var(--font-link-primary-weight-91pybi, "inherit");
208
208
  letter-spacing: var(--font-link-primary-letter-spacing-vmsgcx, "inherit");
@@ -216,31 +216,31 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
216
216
  transition-duration: var(--motion-duration-refresh-only-medium-5flen2, 165ms);
217
217
  }
218
218
  @media (prefers-reduced-motion: reduce) {
219
- .awsui_additional-info_n4qlp_19053_169 > a:not(#\9) {
219
+ .awsui_additional-info_n4qlp_12hrz_169 > a:not(#\9) {
220
220
  animation: none;
221
221
  transition: none;
222
222
  }
223
223
  }
224
- .awsui-motion-disabled .awsui_additional-info_n4qlp_19053_169 > a:not(#\9), .awsui-mode-entering .awsui_additional-info_n4qlp_19053_169 > a:not(#\9) {
224
+ .awsui-motion-disabled .awsui_additional-info_n4qlp_12hrz_169 > a:not(#\9), .awsui-mode-entering .awsui_additional-info_n4qlp_12hrz_169 > a:not(#\9) {
225
225
  animation: none;
226
226
  transition: none;
227
227
  }
228
- .awsui_additional-info_n4qlp_19053_169 > a:not(#\9):hover {
228
+ .awsui_additional-info_n4qlp_12hrz_169 > a:not(#\9):hover {
229
229
  cursor: pointer;
230
230
  color: var(--color-text-link-hover-kololx, #033160);
231
231
  }
232
- .awsui_additional-info_n4qlp_19053_169 > a:not(#\9):focus {
232
+ .awsui_additional-info_n4qlp_12hrz_169 > a:not(#\9):focus {
233
233
  outline: none;
234
234
  }
235
- .awsui_additional-info_n4qlp_19053_169 > a:not(#\9):active {
235
+ .awsui_additional-info_n4qlp_12hrz_169 > a:not(#\9):active {
236
236
  color: var(--color-text-link-hover-kololx, #033160);
237
237
  }
238
- .awsui_additional-info_n4qlp_19053_169 > a:not(#\9):active, .awsui_additional-info_n4qlp_19053_169 > a:not(#\9):focus, .awsui_additional-info_n4qlp_19053_169 > a:not(#\9):hover {
238
+ .awsui_additional-info_n4qlp_12hrz_169 > a:not(#\9):active, .awsui_additional-info_n4qlp_12hrz_169 > a:not(#\9):focus, .awsui_additional-info_n4qlp_12hrz_169 > a:not(#\9):hover {
239
239
  text-decoration: underline;
240
240
  /* stylelint-disable-next-line plugin/no-unsupported-browser-features */
241
241
  text-decoration-color: currentColor;
242
242
  }
243
243
 
244
- .awsui_right-align_n4qlp_19053_215:not(#\9) {
244
+ .awsui_right-align_n4qlp_12hrz_215:not(#\9) {
245
245
  float: right;
246
246
  }
@@ -2,18 +2,19 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "empty": "awsui_empty_n4qlp_19053_93",
6
- "awsui-motion-fade-in": "awsui_awsui-motion-fade-in_n4qlp_19053_1",
7
- "root": "awsui_root_n4qlp_19053_119",
8
- "row": "awsui_row_n4qlp_19053_137",
9
- "row-control": "awsui_row-control_n4qlp_19053_141",
10
- "field": "awsui_field_n4qlp_19053_145",
11
- "add-button": "awsui_add-button_n4qlp_19053_149",
12
- "remove-button": "awsui_remove-button_n4qlp_19053_153",
13
- "button-container-haslabel": "awsui_button-container-haslabel_n4qlp_19053_157",
14
- "button-container-nolabel": "awsui_button-container-nolabel_n4qlp_19053_161",
15
- "divider": "awsui_divider_n4qlp_19053_165",
16
- "additional-info": "awsui_additional-info_n4qlp_19053_169",
17
- "right-align": "awsui_right-align_n4qlp_19053_215"
5
+ "empty-appear": "awsui_empty-appear_n4qlp_12hrz_93",
6
+ "awsui-motion-fade-in": "awsui_awsui-motion-fade-in_n4qlp_12hrz_1",
7
+ "root": "awsui_root_n4qlp_12hrz_119",
8
+ "empty": "awsui_empty_n4qlp_12hrz_93",
9
+ "row": "awsui_row_n4qlp_12hrz_137",
10
+ "row-control": "awsui_row-control_n4qlp_12hrz_141",
11
+ "field": "awsui_field_n4qlp_12hrz_145",
12
+ "add-button": "awsui_add-button_n4qlp_12hrz_149",
13
+ "remove-button": "awsui_remove-button_n4qlp_12hrz_153",
14
+ "button-container-haslabel": "awsui_button-container-haslabel_n4qlp_12hrz_157",
15
+ "button-container-nolabel": "awsui_button-container-nolabel_n4qlp_12hrz_161",
16
+ "divider": "awsui_divider_n4qlp_12hrz_165",
17
+ "additional-info": "awsui_additional-info_n4qlp_12hrz_169",
18
+ "right-align": "awsui_right-align_n4qlp_12hrz_215"
18
19
  };
19
20
 
@@ -22,7 +22,6 @@ export interface SplitPanelContextProps {
22
22
  closedNav: boolean;
23
23
  closedTools: boolean;
24
24
  };
25
- isCopy?: boolean;
26
25
  isOpen?: boolean;
27
26
  isMobile: boolean;
28
27
  isForcedPosition: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"split-panel-context.d.ts","sourceRoot":"","sources":["../../../../src/internal/context/split-panel-context.ts"],"names":[],"mappings":"AAEA,OAAO,KAAoC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AAA;KAAE,KAAK,IAAI,CAAC;IACvE,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,sBAAsB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAClD;AAED,eAAO,MAAM,iBAAiB,uCAqB5B,CAAC;AAEH,wBAAgB,oBAAoB,2BAEnC"}
1
+ {"version":3,"file":"split-panel-context.d.ts","sourceRoot":"","sources":["../../../../src/internal/context/split-panel-context.ts"],"names":[],"mappings":"AAEA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAEzD,MAAM,MAAM,yBAAyB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC;AAEpG,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,MAAM,CAAC;IAC1B,YAAY,EAAE,MAAM,MAAM,CAAC;IAC3B,SAAS,EAAE,MAAM,WAAW,GAAG,IAAI,CAAC;IACpC,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,kBAAkB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACzC,sBAAsB,CAAC,EAAE;QACvB,SAAS,EAAE,OAAO,CAAC;QACnB,WAAW,EAAE,OAAO,CAAC;KACtB,CAAC;IACF,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,gBAAgB,EAAE,OAAO,CAAC;IAG1B,eAAe,CAAC,EAAE,yBAAyB,CAAC;IAC5C,aAAa,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC/B,mBAAmB,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACrC,QAAQ,EAAE,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAC7C,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,mBAAmB,EAAE,CAAC,MAAM,EAAE;QAAE,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAAA;KAAE,KAAK,IAAI,CAAC;IACvE,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,sBAAsB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAClD;AAED,eAAO,MAAM,iBAAiB,uCAoB5B,CAAC;AAEH,wBAAgB,oBAAoB,2BAEnC"}
@@ -11,7 +11,6 @@ export var SplitPanelContext = createContext({
11
11
  getMaxWidth: function () { return 0; },
12
12
  getMaxHeight: function () { return 0; },
13
13
  getHeader: function () { return null; },
14
- isCopy: false,
15
14
  isOpen: true,
16
15
  isMobile: false,
17
16
  isForcedPosition: false,
@@ -1 +1 @@
1
- {"version":3,"file":"split-panel-context.js","sourceRoot":"","sources":["../../../../src/internal/context/split-panel-context.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAc,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAqCzD,MAAM,CAAC,IAAM,iBAAiB,GAAG,aAAa,CAAyB;IACrE,SAAS,EAAE,CAAC;IACZ,YAAY,EAAE,CAAC;IACf,UAAU,EAAE,CAAC;IACb,WAAW,EAAE,CAAC;IACd,QAAQ,EAAE,QAAQ;IAClB,IAAI,EAAE,CAAC;IACP,WAAW,EAAE,cAAM,OAAA,CAAC,EAAD,CAAC;IACpB,YAAY,EAAE,cAAM,OAAA,CAAC,EAAD,CAAC;IACrB,SAAS,EAAE,cAAM,OAAA,IAAI,EAAJ,CAAI;IACrB,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,KAAK;IACf,gBAAgB,EAAE,KAAK;IACvB,eAAe,EAAE,SAAS;IAC1B,aAAa,EAAE,SAAS;IACxB,mBAAmB,EAAE,SAAS;IAC9B,QAAQ,EAAE,cAAO,CAAC;IAClB,QAAQ,EAAE,cAAO,CAAC;IAClB,mBAAmB,EAAE,cAAO,CAAC;IAC7B,UAAU,EAAE,cAAO,CAAC;CACrB,CAAC,CAAC;AAEH,MAAM,UAAU,oBAAoB;IAClC,OAAO,UAAU,CAAC,iBAAiB,CAAC,CAAC;AACvC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useContext, createContext } from 'react';\n\nexport type SplitPanelLastInteraction = { type: 'open' } | { type: 'close' } | { type: 'position' };\n\nexport interface SplitPanelContextProps {\n topOffset: number;\n bottomOffset: number;\n leftOffset: number;\n rightOffset: number;\n position: 'side' | 'bottom';\n size: number;\n getMaxWidth: () => number;\n getMaxHeight: () => number;\n getHeader: () => HTMLElement | null;\n disableContentPaddings?: boolean;\n contentWidthStyles?: React.CSSProperties;\n contentWrapperPaddings?: {\n closedNav: boolean;\n closedTools: boolean;\n };\n isCopy?: boolean;\n isOpen?: boolean;\n isMobile: boolean;\n isForcedPosition: boolean;\n // The lastInteraction property indicates last meaningful state transition used to trigger split-panel effects.\n // We can't observe properties in a regular way because split-panel is being mounted in several places at once.\n lastInteraction?: SplitPanelLastInteraction;\n splitPanelRef?: React.Ref<any>;\n splitPanelHeaderRef?: React.Ref<any>;\n onResize: (detail: { size: number }) => void;\n onToggle: () => void;\n onPreferencesChange: (detail: { position: 'side' | 'bottom' }) => void;\n reportSize: (pixels: number) => void;\n openButtonAriaLabel?: string;\n setOpenButtonAriaLabel?: (value: string) => void;\n}\n\nexport const SplitPanelContext = createContext<SplitPanelContextProps>({\n topOffset: 0,\n bottomOffset: 0,\n leftOffset: 0,\n rightOffset: 0,\n position: 'bottom',\n size: 0,\n getMaxWidth: () => 0,\n getMaxHeight: () => 0,\n getHeader: () => null,\n isCopy: false,\n isOpen: true,\n isMobile: false,\n isForcedPosition: false,\n lastInteraction: undefined,\n splitPanelRef: undefined,\n splitPanelHeaderRef: undefined,\n onResize: () => {},\n onToggle: () => {},\n onPreferencesChange: () => {},\n reportSize: () => {},\n});\n\nexport function useSplitPanelContext() {\n return useContext(SplitPanelContext);\n}\n"]}
1
+ {"version":3,"file":"split-panel-context.js","sourceRoot":"","sources":["../../../../src/internal/context/split-panel-context.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAc,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAoCzD,MAAM,CAAC,IAAM,iBAAiB,GAAG,aAAa,CAAyB;IACrE,SAAS,EAAE,CAAC;IACZ,YAAY,EAAE,CAAC;IACf,UAAU,EAAE,CAAC;IACb,WAAW,EAAE,CAAC;IACd,QAAQ,EAAE,QAAQ;IAClB,IAAI,EAAE,CAAC;IACP,WAAW,EAAE,cAAM,OAAA,CAAC,EAAD,CAAC;IACpB,YAAY,EAAE,cAAM,OAAA,CAAC,EAAD,CAAC;IACrB,SAAS,EAAE,cAAM,OAAA,IAAI,EAAJ,CAAI;IACrB,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,KAAK;IACf,gBAAgB,EAAE,KAAK;IACvB,eAAe,EAAE,SAAS;IAC1B,aAAa,EAAE,SAAS;IACxB,mBAAmB,EAAE,SAAS;IAC9B,QAAQ,EAAE,cAAO,CAAC;IAClB,QAAQ,EAAE,cAAO,CAAC;IAClB,mBAAmB,EAAE,cAAO,CAAC;IAC7B,UAAU,EAAE,cAAO,CAAC;CACrB,CAAC,CAAC;AAEH,MAAM,UAAU,oBAAoB;IAClC,OAAO,UAAU,CAAC,iBAAiB,CAAC,CAAC;AACvC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useContext, createContext } from 'react';\n\nexport type SplitPanelLastInteraction = { type: 'open' } | { type: 'close' } | { type: 'position' };\n\nexport interface SplitPanelContextProps {\n topOffset: number;\n bottomOffset: number;\n leftOffset: number;\n rightOffset: number;\n position: 'side' | 'bottom';\n size: number;\n getMaxWidth: () => number;\n getMaxHeight: () => number;\n getHeader: () => HTMLElement | null;\n disableContentPaddings?: boolean;\n contentWidthStyles?: React.CSSProperties;\n contentWrapperPaddings?: {\n closedNav: boolean;\n closedTools: boolean;\n };\n isOpen?: boolean;\n isMobile: boolean;\n isForcedPosition: boolean;\n // The lastInteraction property indicates last meaningful state transition used to trigger split-panel effects.\n // We can't observe properties in a regular way because split-panel is being mounted in several places at once.\n lastInteraction?: SplitPanelLastInteraction;\n splitPanelRef?: React.Ref<any>;\n splitPanelHeaderRef?: React.Ref<any>;\n onResize: (detail: { size: number }) => void;\n onToggle: () => void;\n onPreferencesChange: (detail: { position: 'side' | 'bottom' }) => void;\n reportSize: (pixels: number) => void;\n openButtonAriaLabel?: string;\n setOpenButtonAriaLabel?: (value: string) => void;\n}\n\nexport const SplitPanelContext = createContext<SplitPanelContextProps>({\n topOffset: 0,\n bottomOffset: 0,\n leftOffset: 0,\n rightOffset: 0,\n position: 'bottom',\n size: 0,\n getMaxWidth: () => 0,\n getMaxHeight: () => 0,\n getHeader: () => null,\n isOpen: true,\n isMobile: false,\n isForcedPosition: false,\n lastInteraction: undefined,\n splitPanelRef: undefined,\n splitPanelHeaderRef: undefined,\n onResize: () => {},\n onToggle: () => {},\n onPreferencesChange: () => {},\n reportSize: () => {},\n});\n\nexport function useSplitPanelContext() {\n return useContext(SplitPanelContext);\n}\n"]}
@@ -1,5 +1,5 @@
1
1
 
2
- export var PACKAGE_VERSION = '3.0.0 (3bd8f6e)';
2
+ export var PACKAGE_VERSION = '3.0.0 (e96b346)';
3
3
  export var THEME = 'open-source-visual-refresh';
4
4
  export var ALWAYS_VISUAL_REFRESH = true;
5
5
 
@@ -1,3 +1,3 @@
1
1
  {
2
- "commit": "3bd8f6e98b1b86ffc6593d4f70bb83d0483a2817"
2
+ "commit": "e96b346b7eed4f7239791577ed123d215ba7a61d"
3
3
  }
package/package.json CHANGED
@@ -112,6 +112,6 @@
112
112
  "./internal/base-component/index.js",
113
113
  "./internal/base-component/styles.css.js"
114
114
  ],
115
- "version": "3.0.141",
115
+ "version": "3.0.143",
116
116
  "license": "Apache-2.0"
117
117
  }
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/property-filter/utils.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAG7F,wBAAgB,sBAAsB,CACpC,mBAAmB,EAAE,SAAS,iBAAiB,EAAE,EACjD,aAAa,EAAE,MAAM,GACpB,IAAI,GAAG,iBAAiB,CAmB1B;AAGD,wBAAgB,aAAa,CAC3B,gBAAgB,EAAE,SAAS,kBAAkB,EAAE,EAC/C,aAAa,EAAE,MAAM,GACpB,IAAI,GAAG,kBAAkB,CAc3B;AAGD,wBAAgB,mBAAmB,CACjC,gBAAgB,EAAE,SAAS,kBAAkB,EAAE,EAC/C,aAAa,EAAE,MAAM,GACpB,IAAI,GAAG,MAAM,CAUf;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,KAAK,EAAE,gBAAgB,EAAE,SAAS,eAAe,EAAE,GAAG,KAAK,CAYjG;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAUhD;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAErD"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/property-filter/utils.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAG7F,wBAAgB,sBAAsB,CACpC,mBAAmB,EAAE,SAAS,iBAAiB,EAAE,EACjD,aAAa,EAAE,MAAM,GACpB,IAAI,GAAG,iBAAiB,CAgB1B;AAGD,wBAAgB,aAAa,CAC3B,gBAAgB,EAAE,SAAS,kBAAkB,EAAE,EAC/C,aAAa,EAAE,MAAM,GACpB,IAAI,GAAG,kBAAkB,CAc3B;AAGD,wBAAgB,mBAAmB,CACjC,gBAAgB,EAAE,SAAS,kBAAkB,EAAE,EAC/C,aAAa,EAAE,MAAM,GACpB,IAAI,GAAG,MAAM,CAUf;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,KAAK,EAAE,gBAAgB,EAAE,SAAS,eAAe,EAAE,GAAG,KAAK,CAYjG;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAUhD;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAErD"}
@@ -7,12 +7,9 @@ export function matchFilteringProperty(filteringProperties, filteringText) {
7
7
  var matchedProperty = null;
8
8
  for (var _i = 0, filteringProperties_1 = filteringProperties; _i < filteringProperties_1.length; _i++) {
9
9
  var property = filteringProperties_1[_i];
10
- if (property.propertyLabel === filteringText) {
11
- matchedProperty = property;
12
- break;
13
- }
14
- if (property.propertyLabel.length > maxLength &&
15
- startsWith(filteringText.toLowerCase(), property.propertyLabel.toLowerCase())) {
10
+ if ((property.propertyLabel.length >= maxLength && startsWith(filteringText, property.propertyLabel)) ||
11
+ (property.propertyLabel.length > maxLength &&
12
+ startsWith(filteringText.toLowerCase(), property.propertyLabel.toLowerCase()))) {
16
13
  maxLength = property.propertyLabel.length;
17
14
  matchedProperty = property;
18
15
  }
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","s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C,KAAK,GAAG,EAAE;YACrB,YAAY,EAAE,CAAC;SAChB;aAAM;YACL,MAAM;SACP;KACF;IACD,OAAO,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,MAAc;IAC3C,OAAO,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;AACtD,CAAC;AAED,SAAS,UAAU,CAAC,MAAc,EAAE,MAAc;IAChD,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACtC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { ComparisonOperator, FilteringOption, FilteringProperty, Token } from './interfaces';\n\n// Finds the longest property the filtering text starts from.\nexport function matchFilteringProperty(\n filteringProperties: readonly FilteringProperty[],\n filteringText: string\n): null | FilteringProperty {\n let maxLength = 0;\n let matchedProperty: null | FilteringProperty = null;\n\n for (const property of filteringProperties) {\n if (property.propertyLabel === filteringText) {\n matchedProperty = property;\n break;\n }\n if (\n property.propertyLabel.length > maxLength &&\n startsWith(filteringText.toLowerCase(), property.propertyLabel.toLowerCase())\n ) {\n maxLength = property.propertyLabel.length;\n matchedProperty = property;\n }\n }\n\n return matchedProperty;\n}\n\n// Finds the longest operator the filtering text starts from.\nexport function matchOperator(\n allowedOperators: readonly ComparisonOperator[],\n filteringText: string\n): null | ComparisonOperator {\n filteringText = filteringText.toLowerCase();\n\n let maxLength = 0;\n let matchedOperator: null | ComparisonOperator = null;\n\n for (const operator of allowedOperators) {\n if (operator.length > maxLength && startsWith(filteringText, operator.toLowerCase())) {\n maxLength = operator.length;\n matchedOperator = operator;\n }\n }\n\n return matchedOperator;\n}\n\n// Finds if the filtering text matches any operator prefix.\nexport function matchOperatorPrefix(\n allowedOperators: readonly ComparisonOperator[],\n filteringText: string\n): null | string {\n if (filteringText.trim().length === 0) {\n return '';\n }\n for (const operator of allowedOperators) {\n if (startsWith(operator.toLowerCase(), filteringText.toLowerCase())) {\n return filteringText;\n }\n }\n return null;\n}\n\nexport function matchTokenValue(token: Token, filteringOptions: readonly FilteringOption[]): Token {\n const value = token.value.toLowerCase();\n\n const propertyOptions = filteringOptions.filter(option => option.propertyKey === token.propertyKey);\n for (const option of propertyOptions) {\n const optionText = (option.label ?? option.value ?? '').toLowerCase();\n if (optionText === value) {\n return { ...token, value: option.value };\n }\n }\n\n return token;\n}\n\nexport function trimStart(source: string): string {\n let spacesLength = 0;\n for (let i = 0; i < source.length; i++) {\n if (source[i] === ' ') {\n spacesLength++;\n } else {\n break;\n }\n }\n return source.slice(spacesLength);\n}\n\nexport function trimFirstSpace(source: string): string {\n return source[0] === ' ' ? source.slice(1) : source;\n}\n\nfunction startsWith(source: string, target: string): boolean {\n return source.indexOf(target) === 0;\n}\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/property-filter/utils.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;;AAItC,6DAA6D;AAC7D,MAAM,UAAU,sBAAsB,CACpC,mBAAiD,EACjD,aAAqB;IAErB,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,IAAI,eAAe,GAA6B,IAAI,CAAC;IAErD,KAAuB,UAAmB,EAAnB,2CAAmB,EAAnB,iCAAmB,EAAnB,IAAmB,EAAE;QAAvC,IAAM,QAAQ,4BAAA;QACjB,IACE,CAAC,QAAQ,CAAC,aAAa,CAAC,MAAM,IAAI,SAAS,IAAI,UAAU,CAAC,aAAa,EAAE,QAAQ,CAAC,aAAa,CAAC,CAAC;YACjG,CAAC,QAAQ,CAAC,aAAa,CAAC,MAAM,GAAG,SAAS;gBACxC,UAAU,CAAC,aAAa,CAAC,WAAW,EAAE,EAAE,QAAQ,CAAC,aAAa,CAAC,WAAW,EAAE,CA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AAG,gBAAgB,CAAC,MAAM,CAAC,UAAA,MAAM,IAAI,OAAA,MAAM,CAAC,WAAW,KAAK,KAAK,CAAC,WAAW,EAAxC,CAAwC,CAAC,CAAC;IACpG,KAAqB,UAAe,EAAf,mCAAe,EAAf,6BAAe,EAAf,IAAe,EAAE;QAAjC,IAAM,MAAM,wBAAA;QACf,IAAM,UAAU,GAAG,CAAC,MAAA,MAAA,MAAM,CAAC,KAAK,mCAAI,MAAM,CAAC,KAAK,mCAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;QACtE,IAAI,UAAU,KAAK,KAAK,EAAE;YACxB,6BAAY,KAAK,KAAE,KAAK,EAAE,MAAM,CAAC,KAAK,IAAG;SAC1C;KACF;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,MAAc;IACtC,IAAI,YAAY,GAAG,CAAC,CAAC;IACrB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACtC,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;YACrB,YAAY,EAAE,CAAC;SAChB;aAAM;YACL,MAAM;SACP;KACF;IACD,OAAO,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,MAAc;IAC3C,OAAO,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;AACtD,CAAC;AAED,SAAS,UAAU,CAAC,MAAc,EAAE,MAAc;IAChD,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACtC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { ComparisonOperator, FilteringOption, FilteringProperty, Token } from './interfaces';\n\n// Finds the longest property the filtering text starts from.\nexport function matchFilteringProperty(\n filteringProperties: readonly FilteringProperty[],\n filteringText: string\n): null | FilteringProperty {\n let maxLength = 0;\n let matchedProperty: null | FilteringProperty = null;\n\n for (const property of filteringProperties) {\n if (\n (property.propertyLabel.length >= maxLength && startsWith(filteringText, property.propertyLabel)) ||\n (property.propertyLabel.length > maxLength &&\n startsWith(filteringText.toLowerCase(), property.propertyLabel.toLowerCase()))\n ) {\n maxLength = property.propertyLabel.length;\n matchedProperty = property;\n }\n }\n\n return matchedProperty;\n}\n\n// Finds the longest operator the filtering text starts from.\nexport function matchOperator(\n allowedOperators: readonly ComparisonOperator[],\n filteringText: string\n): null | ComparisonOperator {\n filteringText = filteringText.toLowerCase();\n\n let maxLength = 0;\n let matchedOperator: null | ComparisonOperator = null;\n\n for (const operator of allowedOperators) {\n if (operator.length > maxLength && startsWith(filteringText, operator.toLowerCase())) {\n maxLength = operator.length;\n matchedOperator = operator;\n }\n }\n\n return matchedOperator;\n}\n\n// Finds if the filtering text matches any operator prefix.\nexport function matchOperatorPrefix(\n allowedOperators: readonly ComparisonOperator[],\n filteringText: string\n): null | string {\n if (filteringText.trim().length === 0) {\n return '';\n }\n for (const operator of allowedOperators) {\n if (startsWith(operator.toLowerCase(), filteringText.toLowerCase())) {\n return filteringText;\n }\n }\n return null;\n}\n\nexport function matchTokenValue(token: Token, filteringOptions: readonly FilteringOption[]): Token {\n const value = token.value.toLowerCase();\n\n const propertyOptions = filteringOptions.filter(option => option.propertyKey === token.propertyKey);\n for (const option of propertyOptions) {\n const optionText = (option.label ?? option.value ?? '').toLowerCase();\n if (optionText === value) {\n return { ...token, value: option.value };\n }\n }\n\n return token;\n}\n\nexport function trimStart(source: string): string {\n let spacesLength = 0;\n for (let i = 0; i < source.length; i++) {\n if (source[i] === ' ') {\n spacesLength++;\n } else {\n break;\n }\n }\n return source.slice(spacesLength);\n}\n\nexport function trimFirstSpace(source: string): string {\n return source[0] === ' ' ? source.slice(1) : source;\n}\n\nfunction startsWith(source: string, target: string): boolean {\n return source.indexOf(target) === 0;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/split-panel/index.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,eAAe,EAAoB,MAAM,cAAc,CAAC;AAmBjE,OAAO,EAAE,eAAe,EAAE,CAAC;AAK3B,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EACjC,MAAM,EACN,QAAQ,EACR,qBAA6B,EAC7B,WAAW,EACX,GAAG,SAAS,EACb,EAAE,eAAe,eA8RjB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/split-panel/index.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,eAAe,EAAoB,MAAM,cAAc,CAAC;AAmBjE,OAAO,EAAE,eAAe,EAAE,CAAC;AAK3B,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EACjC,MAAM,EACN,QAAQ,EACR,qBAA6B,EAC7B,WAAW,EACX,GAAG,SAAS,EACb,EAAE,eAAe,eA6RjB"}
@@ -29,7 +29,7 @@ export default function SplitPanel(_a) {
29
29
  var header = _a.header, children = _a.children, _b = _a.hidePreferencesButton, hidePreferencesButton = _b === void 0 ? false : _b, i18nStrings = _a.i18nStrings, restProps = __rest(_a, ["header", "children", "hidePreferencesButton", "i18nStrings"]);
30
30
  var isRefresh = useVisualRefresh();
31
31
  var __internalRootRef = useBaseComponent('SplitPanel').__internalRootRef;
32
- var _c = useSplitPanelContext(), size = _c.size, getMaxWidth = _c.getMaxWidth, getMaxHeight = _c.getMaxHeight, position = _c.position, topOffset = _c.topOffset, bottomOffset = _c.bottomOffset, rightOffset = _c.rightOffset, contentWidthStyles = _c.contentWidthStyles, isCopy = _c.isCopy, isOpen = _c.isOpen, isForcedPosition = _c.isForcedPosition, splitPanelRef = _c.splitPanelRef, lastInteraction = _c.lastInteraction, onPreferencesChange = _c.onPreferencesChange, onResize = _c.onResize, onToggle = _c.onToggle, reportSize = _c.reportSize, setOpenButtonAriaLabel = _c.setOpenButtonAriaLabel;
32
+ var _c = useSplitPanelContext(), size = _c.size, getMaxWidth = _c.getMaxWidth, getMaxHeight = _c.getMaxHeight, position = _c.position, topOffset = _c.topOffset, bottomOffset = _c.bottomOffset, rightOffset = _c.rightOffset, contentWidthStyles = _c.contentWidthStyles, isOpen = _c.isOpen, isForcedPosition = _c.isForcedPosition, splitPanelRef = _c.splitPanelRef, lastInteraction = _c.lastInteraction, onPreferencesChange = _c.onPreferencesChange, onResize = _c.onResize, onToggle = _c.onToggle, reportSize = _c.reportSize, setOpenButtonAriaLabel = _c.setOpenButtonAriaLabel;
33
33
  var baseProps = getBaseProps(restProps);
34
34
  var focusVisible = useFocusVisible();
35
35
  var _d = useState(false), isPreferencesOpen = _d[0], setPreferencesOpen = _d[1];
@@ -141,7 +141,7 @@ export default function SplitPanel(_a) {
141
141
  * is still needed for the early return to prevent execution
142
142
  * of the following code.
143
143
  */
144
- if (isRefresh && (!isOpen || isCopy) && position === 'side') {
144
+ if (isRefresh && !isOpen && position === 'side') {
145
145
  return React.createElement(React.Fragment, null);
146
146
  }
147
147
  return (React.createElement(Transition, { "in": isOpen !== null && isOpen !== void 0 ? isOpen : false }, function (state, transitioningElementRef) { return (React.createElement(React.Fragment, null,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/split-panel/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC5E,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,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,IAAI,EACb,WAAW,EAAE,EAAE,QAAQ,UAAA,EAAE,EACzB,oBAAoB,EAAE,QAAQ,KAAK,QAAQ,IAAI,gBAAgB,EAC/D,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE;gBACX,MAAM,EAAE,WAAW,CAAC,gBAAgB;gBACpC,OAAO,EAAE,WAAW,CAAC,kBAAkB;gBACvC,MAAM,EAAE,WAAW,CAAC,iBAAiB;gBACrC,aAAa,EAAE,WAAW,CAAC,wBAAwB;gBACnD,mBAAmB,EAAE,WAAW,CAAC,8BAA8B;gBAC/D,cAAc,EAAE,WAAW,CAAC,yBAAyB;gBACrD,YAAY,EAAE,WAAW,CAAC,uBAAuB;aAClD,EACD,SAAS,EAAE,UAAA,WAAW;gBACpB,mBAAmB,cAAM,WAAW,EAAG,CAAC;gBACxC,kBAAkB,CAAC,KAAK,CAAC,CAAC;YAC5B,CAAC,EACD,SAAS,EAAE;gBACT,kBAAkB,CAAC,KAAK,CAAC,CAAC;YAC5B,CAAC,GACD,CACH,CACA,CACJ,EA7DoC,CA6DpC,CACU,CACd,CAAC;AACJ,CAAC;AAED,gBAAgB,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useState, useEffect, useLayoutEffect, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { InternalButton } from '../button/internal';\nimport { getBaseProps } from '../internal/base-component';\nimport { useSplitPanelContext } from '../internal/context/split-panel-context';\nimport useFocusVisible from '../internal/hooks/focus-visible';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\n\nimport { SplitPanelProps, SizeControlProps } from './interfaces';\nimport ResizeHandler from './icons/resize-handler';\nimport PreferencesModal from './preferences-modal';\nimport { usePointerEvents } from './utils/use-pointer-events';\nimport { useKeyboardEvents } from './utils/use-keyboard-events';\n\nimport styles from './styles.css.js';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { AppLayoutContext } from '../internal/context/app-layout-context';\nimport { getLimitedValue } from './utils/size-utils';\nimport { Transition } from '../internal/components/transition';\nimport { ButtonProps } from '../button/interfaces';\nimport { useEffectOnUpdate } from '../internal/hooks/use-effect-on-update';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { SplitPanelContentSide } from './side';\nimport { SplitPanelContentBottom } from './bottom';\n\nexport { SplitPanelProps };\n\nconst MIN_HEIGHT = 160;\nconst MIN_WIDTH = 280;\n\nexport default function SplitPanel({\n header,\n children,\n hidePreferencesButton = false,\n i18nStrings,\n ...restProps\n}: SplitPanelProps) {\n const isRefresh = useVisualRefresh();\n const { __internalRootRef } = useBaseComponent('SplitPanel');\n const {\n size,\n getMaxWidth,\n getMaxHeight,\n position,\n topOffset,\n bottomOffset,\n rightOffset,\n contentWidthStyles,\n isCopy,\n isOpen,\n isForcedPosition,\n splitPanelRef,\n lastInteraction,\n onPreferencesChange,\n onResize,\n onToggle,\n reportSize,\n setOpenButtonAriaLabel,\n } = useSplitPanelContext();\n const baseProps = getBaseProps(restProps);\n const focusVisible = useFocusVisible();\n const [isPreferencesOpen, setPreferencesOpen] = useState<boolean>(false);\n const [relativeSize, setRelativeSize] = useState(0);\n const [maxSize, setMaxSize] = useState(size);\n const minSize = position === 'bottom' ? MIN_HEIGHT : MIN_WIDTH;\n const cappedSize = getLimitedValue(minSize, size, maxSize);\n const appLayoutMaxWidth = isRefresh && position === 'bottom' ? contentWidthStyles : undefined;\n\n useEffect(() => {\n setOpenButtonAriaLabel?.(i18nStrings.openButtonAriaLabel);\n }, [setOpenButtonAriaLabel, i18nStrings.openButtonAriaLabel]);\n\n useEffect(() => {\n // effects are called inside out in the components tree\n // wait one frame to allow app-layout to complete its calculations\n const handle = requestAnimationFrame(() => {\n const maxSize = position === 'bottom' ? getMaxHeight() : getMaxWidth();\n setRelativeSize((size / maxSize) * 100);\n setMaxSize(maxSize);\n });\n return () => cancelAnimationFrame(handle);\n }, [size, position, getMaxHeight, getMaxWidth]);\n\n useEffect(() => {\n reportSize(cappedSize);\n }, [reportSize, cappedSize]);\n\n useEffect(() => {\n const handler = () => setMaxSize(position === 'bottom' ? getMaxHeight() : getMaxWidth());\n window.addEventListener('resize', handler);\n return () => window.removeEventListener('resize', handler);\n }, [position, getMaxWidth, getMaxHeight]);\n\n const setSidePanelWidth = (width: number) => {\n const maxWidth = getMaxWidth();\n const size = getLimitedValue(MIN_WIDTH, width, maxWidth);\n\n if (isOpen && maxWidth >= MIN_WIDTH) {\n onResize({ size });\n }\n };\n\n const setBottomPanelHeight = (height: number) => {\n const maxHeight = getMaxHeight();\n const size = getLimitedValue(MIN_HEIGHT, height, maxHeight);\n\n if (isOpen && maxHeight >= MIN_HEIGHT) {\n onResize({ size });\n }\n };\n\n const splitPanelRefObject = useRef<HTMLDivElement>(null);\n const handleRef = useRef<HTMLDivElement>(null);\n\n const sizeControlProps: SizeControlProps = {\n position,\n splitPanelRef: splitPanelRefObject,\n handleRef,\n setSidePanelWidth,\n setBottomPanelHeight,\n };\n const onSliderPointerDown = usePointerEvents(sizeControlProps);\n const onKeyDown = useKeyboardEvents(sizeControlProps);\n\n const toggleRef = useRef<ButtonProps.Ref>(null);\n const closeRef = useRef<ButtonProps.Ref>(null);\n const preferencesRef = useRef<ButtonProps.Ref>(null);\n\n useEffectOnUpdate(() => {\n switch (lastInteraction?.type) {\n case 'open':\n return handleRef.current?.focus();\n case 'close':\n return toggleRef.current?.focus();\n case 'position':\n return preferencesRef.current?.focus();\n default:\n return;\n }\n }, [lastInteraction]);\n\n const wrappedChildren = (\n <AppLayoutContext.Provider\n value={{\n stickyOffsetTop: topOffset,\n stickyOffsetBottom: bottomOffset,\n }}\n >\n {children}\n </AppLayoutContext.Provider>\n );\n\n const panelHeaderId = useUniqueId('split-panel-header');\n\n const wrappedHeader = (\n <div className={styles.header} style={appLayoutMaxWidth}>\n <h2 className={styles['header-text']} id={panelHeaderId}>\n {header}\n </h2>\n <div className={styles['header-actions']}>\n {!hidePreferencesButton && isOpen && (\n <>\n <InternalButton\n className={styles['preferences-button']}\n iconName=\"settings\"\n variant=\"icon\"\n onClick={() => setPreferencesOpen(true)}\n formAction=\"none\"\n ariaLabel={i18nStrings.preferencesTitle}\n ref={preferencesRef}\n />\n <span className={styles.divider} />\n </>\n )}\n\n {isOpen ? (\n <InternalButton\n className={styles['close-button']}\n iconName={isRefresh && position === 'side' ? 'angle-right' : isRefresh ? 'angle-down' : 'close'}\n variant=\"icon\"\n onClick={onToggle}\n formAction=\"none\"\n ariaLabel={i18nStrings.closeButtonAriaLabel}\n ref={closeRef}\n ariaExpanded={isOpen}\n />\n ) : position === 'side' ? null : (\n <InternalButton\n className={styles['open-button']}\n iconName=\"angle-up\"\n variant=\"icon\"\n formAction=\"none\"\n ariaLabel={i18nStrings.openButtonAriaLabel}\n ref={toggleRef}\n ariaExpanded={isOpen}\n />\n )}\n </div>\n </div>\n );\n\n const resizeHandle = (\n <div\n ref={handleRef}\n role=\"slider\"\n tabIndex={0}\n aria-label={i18nStrings.resizeHandleAriaLabel}\n aria-valuemax={100}\n aria-valuemin={0}\n aria-valuenow={relativeSize}\n className={clsx(styles.slider, styles[`slider-${position}`])}\n onKeyDown={onKeyDown}\n onPointerDown={onSliderPointerDown}\n {...focusVisible}\n >\n <ResizeHandler className={clsx(styles['slider-icon'], styles[`slider-icon-${position}`])} />\n </div>\n );\n\n /*\n This effect forces the browser to recalculate the layout\n whenever the split panel might have moved.\n\n This is needed as a workaround for a bug in Safari, which does\n not automatically calculate the new position of the split panel\n _content_ when the split panel moves.\n */\n useLayoutEffect(() => {\n const root = __internalRootRef.current;\n\n if (root) {\n const property = 'transform';\n const temporaryValue = 'translateZ(0)';\n\n const valueBefore = root.style[property];\n root.style[property] = temporaryValue;\n\n // This line forces the browser to recalculate the layout\n void root.offsetHeight;\n\n root.style[property] = valueBefore;\n }\n }, [rightOffset, __internalRootRef]);\n\n const mergedRef = useMergeRefs(splitPanelRef, splitPanelRefObject, __internalRootRef);\n\n /**\n * The AppLayout factor moved the circular buttons out of the\n * SplitPanel and into the Tools component. This conditional\n * is still needed for the early return to prevent execution\n * of the following code.\n */\n if (isRefresh && (!isOpen || isCopy) && position === 'side') {\n return <></>;\n }\n\n return (\n <Transition in={isOpen ?? false}>\n {(state, transitioningElementRef) => (\n <>\n {position === 'side' && (\n <SplitPanelContentSide\n resizeHandle={resizeHandle}\n baseProps={baseProps}\n isOpen={isOpen}\n splitPanelRef={mergedRef}\n cappedSize={cappedSize}\n onToggle={onToggle}\n i18nStrings={i18nStrings}\n toggleRef={toggleRef}\n header={wrappedHeader}\n panelHeaderId={panelHeaderId}\n >\n {wrappedChildren}\n </SplitPanelContentSide>\n )}\n\n {position === 'bottom' && (\n <SplitPanelContentBottom\n resizeHandle={resizeHandle}\n baseProps={baseProps}\n isOpen={isOpen}\n splitPanelRef={mergedRef}\n cappedSize={cappedSize}\n onToggle={onToggle}\n header={wrappedHeader}\n panelHeaderId={panelHeaderId}\n state={state}\n transitioningElementRef={transitioningElementRef}\n appLayoutMaxWidth={appLayoutMaxWidth}\n >\n {wrappedChildren}\n </SplitPanelContentBottom>\n )}\n {isPreferencesOpen && (\n <PreferencesModal\n visible={true}\n preferences={{ position }}\n disabledSidePosition={position === 'bottom' && isForcedPosition}\n isRefresh={isRefresh}\n i18nStrings={{\n header: i18nStrings.preferencesTitle,\n confirm: i18nStrings.preferencesConfirm,\n cancel: i18nStrings.preferencesCancel,\n positionLabel: i18nStrings.preferencesPositionLabel,\n positionDescription: i18nStrings.preferencesPositionDescription,\n positionBottom: i18nStrings.preferencesPositionBottom,\n positionSide: i18nStrings.preferencesPositionSide,\n }}\n onConfirm={preferences => {\n onPreferencesChange({ ...preferences });\n setPreferencesOpen(false);\n }}\n onDismiss={() => {\n setPreferencesOpen(false);\n }}\n />\n )}\n </>\n )}\n </Transition>\n );\n}\n\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xB,oBAAC,uBAAuB,IACtB,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,SAAS,EACxB,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,aAAa,EACrB,aAAa,EAAE,aAAa,EAC5B,KAAK,EAAE,KAAK,EACZ,uBAAuB,EAAE,uBAAuB,EAChD,iBAAiB,EAAE,iBAAiB,IAEnC,eAAe,CACQ,CAC3B;QACA,iBAAiB,IAAI,CACpB,oBAAC,gBAAgB,IACf,OAAO,EAAE,IAAI,EACb,WAAW,EAAE,EAAE,QAAQ,UAAA,EAAE,EACzB,oBAAoB,EAAE,QAAQ,KAAK,QAAQ,IAAI,gBAAgB,EAC/D,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE;gBACX,MAAM,EAAE,WAAW,CAAC,gBAAgB;gBACpC,OAAO,EAAE,WAAW,CAAC,kBAAkB;gBACvC,MAAM,EAAE,WAAW,CAAC,iBAAiB;gBACrC,aAAa,EAAE,WAAW,CAAC,wBAAwB;gBACnD,mBAAmB,EAAE,WAAW,CAAC,8BAA8B;gBAC/D,cAAc,EAAE,WAAW,CAAC,yBAAyB;gBACrD,YAAY,EAAE,WAAW,CAAC,uBAAuB;aAClD,EACD,SAAS,EAAE,UAAA,WAAW;gBACpB,mBAAmB,cAAM,WAAW,EAAG,CAAC;gBACxC,kBAAkB,CAAC,KAAK,CAAC,CAAC;YAC5B,CAAC,EACD,SAAS,EAAE;gBACT,kBAAkB,CAAC,KAAK,CAAC,CAAC;YAC5B,CAAC,GACD,CACH,CACA,CACJ,EA7DoC,CA6DpC,CACU,CACd,CAAC;AACJ,CAAC;AAED,gBAAgB,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useState, useEffect, useLayoutEffect, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { InternalButton } from '../button/internal';\nimport { getBaseProps } from '../internal/base-component';\nimport { useSplitPanelContext } from '../internal/context/split-panel-context';\nimport useFocusVisible from '../internal/hooks/focus-visible';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\n\nimport { SplitPanelProps, SizeControlProps } from './interfaces';\nimport ResizeHandler from './icons/resize-handler';\nimport PreferencesModal from './preferences-modal';\nimport { usePointerEvents } from './utils/use-pointer-events';\nimport { useKeyboardEvents } from './utils/use-keyboard-events';\n\nimport styles from './styles.css.js';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { AppLayoutContext } from '../internal/context/app-layout-context';\nimport { getLimitedValue } from './utils/size-utils';\nimport { Transition } from '../internal/components/transition';\nimport { ButtonProps } from '../button/interfaces';\nimport { useEffectOnUpdate } from '../internal/hooks/use-effect-on-update';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { SplitPanelContentSide } from './side';\nimport { SplitPanelContentBottom } from './bottom';\n\nexport { SplitPanelProps };\n\nconst MIN_HEIGHT = 160;\nconst MIN_WIDTH = 280;\n\nexport default function SplitPanel({\n header,\n children,\n hidePreferencesButton = false,\n i18nStrings,\n ...restProps\n}: SplitPanelProps) {\n const isRefresh = useVisualRefresh();\n const { __internalRootRef } = useBaseComponent('SplitPanel');\n const {\n size,\n getMaxWidth,\n getMaxHeight,\n position,\n topOffset,\n bottomOffset,\n rightOffset,\n contentWidthStyles,\n isOpen,\n isForcedPosition,\n splitPanelRef,\n lastInteraction,\n onPreferencesChange,\n onResize,\n onToggle,\n reportSize,\n setOpenButtonAriaLabel,\n } = useSplitPanelContext();\n const baseProps = getBaseProps(restProps);\n const focusVisible = useFocusVisible();\n const [isPreferencesOpen, setPreferencesOpen] = useState<boolean>(false);\n const [relativeSize, setRelativeSize] = useState(0);\n const [maxSize, setMaxSize] = useState(size);\n const minSize = position === 'bottom' ? MIN_HEIGHT : MIN_WIDTH;\n const cappedSize = getLimitedValue(minSize, size, maxSize);\n const appLayoutMaxWidth = isRefresh && position === 'bottom' ? contentWidthStyles : undefined;\n\n useEffect(() => {\n setOpenButtonAriaLabel?.(i18nStrings.openButtonAriaLabel);\n }, [setOpenButtonAriaLabel, i18nStrings.openButtonAriaLabel]);\n\n useEffect(() => {\n // effects are called inside out in the components tree\n // wait one frame to allow app-layout to complete its calculations\n const handle = requestAnimationFrame(() => {\n const maxSize = position === 'bottom' ? getMaxHeight() : getMaxWidth();\n setRelativeSize((size / maxSize) * 100);\n setMaxSize(maxSize);\n });\n return () => cancelAnimationFrame(handle);\n }, [size, position, getMaxHeight, getMaxWidth]);\n\n useEffect(() => {\n reportSize(cappedSize);\n }, [reportSize, cappedSize]);\n\n useEffect(() => {\n const handler = () => setMaxSize(position === 'bottom' ? getMaxHeight() : getMaxWidth());\n window.addEventListener('resize', handler);\n return () => window.removeEventListener('resize', handler);\n }, [position, getMaxWidth, getMaxHeight]);\n\n const setSidePanelWidth = (width: number) => {\n const maxWidth = getMaxWidth();\n const size = getLimitedValue(MIN_WIDTH, width, maxWidth);\n\n if (isOpen && maxWidth >= MIN_WIDTH) {\n onResize({ size });\n }\n };\n\n const setBottomPanelHeight = (height: number) => {\n const maxHeight = getMaxHeight();\n const size = getLimitedValue(MIN_HEIGHT, height, maxHeight);\n\n if (isOpen && maxHeight >= MIN_HEIGHT) {\n onResize({ size });\n }\n };\n\n const splitPanelRefObject = useRef<HTMLDivElement>(null);\n const handleRef = useRef<HTMLDivElement>(null);\n\n const sizeControlProps: SizeControlProps = {\n position,\n splitPanelRef: splitPanelRefObject,\n handleRef,\n setSidePanelWidth,\n setBottomPanelHeight,\n };\n const onSliderPointerDown = usePointerEvents(sizeControlProps);\n const onKeyDown = useKeyboardEvents(sizeControlProps);\n\n const toggleRef = useRef<ButtonProps.Ref>(null);\n const closeRef = useRef<ButtonProps.Ref>(null);\n const preferencesRef = useRef<ButtonProps.Ref>(null);\n\n useEffectOnUpdate(() => {\n switch (lastInteraction?.type) {\n case 'open':\n return handleRef.current?.focus();\n case 'close':\n return toggleRef.current?.focus();\n case 'position':\n return preferencesRef.current?.focus();\n default:\n return;\n }\n }, [lastInteraction]);\n\n const wrappedChildren = (\n <AppLayoutContext.Provider\n value={{\n stickyOffsetTop: topOffset,\n stickyOffsetBottom: bottomOffset,\n }}\n >\n {children}\n </AppLayoutContext.Provider>\n );\n\n const panelHeaderId = useUniqueId('split-panel-header');\n\n const wrappedHeader = (\n <div className={styles.header} style={appLayoutMaxWidth}>\n <h2 className={styles['header-text']} id={panelHeaderId}>\n {header}\n </h2>\n <div className={styles['header-actions']}>\n {!hidePreferencesButton && isOpen && (\n <>\n <InternalButton\n className={styles['preferences-button']}\n iconName=\"settings\"\n variant=\"icon\"\n onClick={() => setPreferencesOpen(true)}\n formAction=\"none\"\n ariaLabel={i18nStrings.preferencesTitle}\n ref={preferencesRef}\n />\n <span className={styles.divider} />\n </>\n )}\n\n {isOpen ? (\n <InternalButton\n className={styles['close-button']}\n iconName={isRefresh && position === 'side' ? 'angle-right' : isRefresh ? 'angle-down' : 'close'}\n variant=\"icon\"\n onClick={onToggle}\n formAction=\"none\"\n ariaLabel={i18nStrings.closeButtonAriaLabel}\n ref={closeRef}\n ariaExpanded={isOpen}\n />\n ) : position === 'side' ? null : (\n <InternalButton\n className={styles['open-button']}\n iconName=\"angle-up\"\n variant=\"icon\"\n formAction=\"none\"\n ariaLabel={i18nStrings.openButtonAriaLabel}\n ref={toggleRef}\n ariaExpanded={isOpen}\n />\n )}\n </div>\n </div>\n );\n\n const resizeHandle = (\n <div\n ref={handleRef}\n role=\"slider\"\n tabIndex={0}\n aria-label={i18nStrings.resizeHandleAriaLabel}\n aria-valuemax={100}\n aria-valuemin={0}\n aria-valuenow={relativeSize}\n className={clsx(styles.slider, styles[`slider-${position}`])}\n onKeyDown={onKeyDown}\n onPointerDown={onSliderPointerDown}\n {...focusVisible}\n >\n <ResizeHandler className={clsx(styles['slider-icon'], styles[`slider-icon-${position}`])} />\n </div>\n );\n\n /*\n This effect forces the browser to recalculate the layout\n whenever the split panel might have moved.\n\n This is needed as a workaround for a bug in Safari, which does\n not automatically calculate the new position of the split panel\n _content_ when the split panel moves.\n */\n useLayoutEffect(() => {\n const root = __internalRootRef.current;\n\n if (root) {\n const property = 'transform';\n const temporaryValue = 'translateZ(0)';\n\n const valueBefore = root.style[property];\n root.style[property] = temporaryValue;\n\n // This line forces the browser to recalculate the layout\n void root.offsetHeight;\n\n root.style[property] = valueBefore;\n }\n }, [rightOffset, __internalRootRef]);\n\n const mergedRef = useMergeRefs(splitPanelRef, splitPanelRefObject, __internalRootRef);\n\n /**\n * The AppLayout factor moved the circular buttons out of the\n * SplitPanel and into the Tools component. This conditional\n * is still needed for the early return to prevent execution\n * of the following code.\n */\n if (isRefresh && !isOpen && position === 'side') {\n return <></>;\n }\n\n return (\n <Transition in={isOpen ?? false}>\n {(state, transitioningElementRef) => (\n <>\n {position === 'side' && (\n <SplitPanelContentSide\n resizeHandle={resizeHandle}\n baseProps={baseProps}\n isOpen={isOpen}\n splitPanelRef={mergedRef}\n cappedSize={cappedSize}\n onToggle={onToggle}\n i18nStrings={i18nStrings}\n toggleRef={toggleRef}\n header={wrappedHeader}\n panelHeaderId={panelHeaderId}\n >\n {wrappedChildren}\n </SplitPanelContentSide>\n )}\n\n {position === 'bottom' && (\n <SplitPanelContentBottom\n resizeHandle={resizeHandle}\n baseProps={baseProps}\n isOpen={isOpen}\n splitPanelRef={mergedRef}\n cappedSize={cappedSize}\n onToggle={onToggle}\n header={wrappedHeader}\n panelHeaderId={panelHeaderId}\n state={state}\n transitioningElementRef={transitioningElementRef}\n appLayoutMaxWidth={appLayoutMaxWidth}\n >\n {wrappedChildren}\n </SplitPanelContentBottom>\n )}\n {isPreferencesOpen && (\n <PreferencesModal\n visible={true}\n preferences={{ position }}\n disabledSidePosition={position === 'bottom' && isForcedPosition}\n isRefresh={isRefresh}\n i18nStrings={{\n header: i18nStrings.preferencesTitle,\n confirm: i18nStrings.preferencesConfirm,\n cancel: i18nStrings.preferencesCancel,\n positionLabel: i18nStrings.preferencesPositionLabel,\n positionDescription: i18nStrings.preferencesPositionDescription,\n positionBottom: i18nStrings.preferencesPositionBottom,\n positionSide: i18nStrings.preferencesPositionSide,\n }}\n onConfirm={preferences => {\n onPreferencesChange({ ...preferences });\n setPreferencesOpen(false);\n }}\n onDismiss={() => {\n setPreferencesOpen(false);\n }}\n />\n )}\n </>\n )}\n </Transition>\n );\n}\n\napplyDisplayName(SplitPanel, 'SplitPanel');\n"]}