@cloudscape-design/components 3.0.624 → 3.0.626

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 (168) hide show
  1. package/alert/index.d.ts.map +1 -1
  2. package/alert/index.js +9 -5
  3. package/alert/index.js.map +1 -1
  4. package/attribute-editor/interfaces.d.ts +4 -0
  5. package/attribute-editor/interfaces.d.ts.map +1 -1
  6. package/attribute-editor/interfaces.js.map +1 -1
  7. package/attribute-editor/row.d.ts.map +1 -1
  8. package/attribute-editor/row.js +4 -1
  9. package/attribute-editor/row.js.map +1 -1
  10. package/button/styles.css.js +19 -19
  11. package/button/styles.scoped.css +159 -151
  12. package/button/styles.selectors.js +19 -19
  13. package/container/index.js +1 -1
  14. package/container/index.js.map +1 -1
  15. package/date-picker/index.d.ts.map +1 -1
  16. package/date-picker/index.js +2 -2
  17. package/date-picker/index.js.map +1 -1
  18. package/date-range-picker/index.d.ts.map +1 -1
  19. package/date-range-picker/index.js +2 -2
  20. package/date-range-picker/index.js.map +1 -1
  21. package/drawer/styles.css.js +3 -3
  22. package/drawer/styles.scoped.css +13 -13
  23. package/drawer/styles.selectors.js +3 -3
  24. package/file-upload/interfaces.d.ts +14 -4
  25. package/file-upload/interfaces.d.ts.map +1 -1
  26. package/file-upload/interfaces.js.map +1 -1
  27. package/file-upload/internal.js +13 -7
  28. package/file-upload/internal.js.map +1 -1
  29. package/form/index.d.ts.map +1 -1
  30. package/form/index.js +17 -6
  31. package/form/index.js.map +1 -1
  32. package/form/internal.d.ts.map +1 -1
  33. package/form/internal.js +1 -14
  34. package/form/internal.js.map +1 -1
  35. package/form-field/index.d.ts.map +1 -1
  36. package/form-field/index.js +3 -2
  37. package/form-field/index.js.map +1 -1
  38. package/form-field/interfaces.d.ts +12 -1
  39. package/form-field/interfaces.d.ts.map +1 -1
  40. package/form-field/interfaces.js.map +1 -1
  41. package/form-field/internal.d.ts +9 -3
  42. package/form-field/internal.d.ts.map +1 -1
  43. package/form-field/internal.js +36 -11
  44. package/form-field/internal.js.map +1 -1
  45. package/form-field/styles.css.js +23 -19
  46. package/form-field/styles.scoped.css +45 -29
  47. package/form-field/styles.selectors.js +23 -19
  48. package/form-field/util.d.ts +3 -2
  49. package/form-field/util.d.ts.map +1 -1
  50. package/form-field/util.js +4 -3
  51. package/form-field/util.js.map +1 -1
  52. package/help-panel/styles.css.js +4 -4
  53. package/help-panel/styles.scoped.css +71 -71
  54. package/help-panel/styles.selectors.js +4 -4
  55. package/input/index.d.ts.map +1 -1
  56. package/input/index.js +2 -1
  57. package/input/index.js.map +1 -1
  58. package/input/internal.d.ts.map +1 -1
  59. package/input/internal.js +4 -1
  60. package/input/internal.js.map +1 -1
  61. package/input/styles.css.js +13 -12
  62. package/input/styles.scoped.css +46 -30
  63. package/input/styles.selectors.js +13 -12
  64. package/internal/analytics/components/analytics-funnel.d.ts +12 -12
  65. package/internal/analytics/components/analytics-funnel.d.ts.map +1 -1
  66. package/internal/analytics/components/analytics-funnel.js +38 -25
  67. package/internal/analytics/components/analytics-funnel.js.map +1 -1
  68. package/internal/analytics/context/analytics-context.d.ts +7 -2
  69. package/internal/analytics/context/analytics-context.d.ts.map +1 -1
  70. package/internal/analytics/context/analytics-context.js.map +1 -1
  71. package/internal/analytics/hooks/use-funnel.d.ts +5 -1
  72. package/internal/analytics/hooks/use-funnel.d.ts.map +1 -1
  73. package/internal/analytics/hooks/use-funnel.js +9 -5
  74. package/internal/analytics/hooks/use-funnel.js.map +1 -1
  75. package/internal/analytics/interfaces.d.ts +23 -37
  76. package/internal/analytics/interfaces.d.ts.map +1 -1
  77. package/internal/analytics/interfaces.js.map +1 -1
  78. package/internal/base-component/index.d.ts +1 -1
  79. package/internal/base-component/index.d.ts.map +1 -1
  80. package/internal/base-component/index.js +1 -1
  81. package/internal/base-component/index.js.map +1 -1
  82. package/internal/base-component/styles.scoped.css +20 -0
  83. package/internal/components/button-trigger/index.d.ts +1 -0
  84. package/internal/components/button-trigger/index.d.ts.map +1 -1
  85. package/internal/components/button-trigger/index.js +2 -2
  86. package/internal/components/button-trigger/index.js.map +1 -1
  87. package/internal/components/button-trigger/styles.css.js +11 -10
  88. package/internal/components/button-trigger/styles.scoped.css +35 -24
  89. package/internal/components/button-trigger/styles.selectors.js +11 -10
  90. package/internal/context/form-field-context.d.ts +14 -1
  91. package/internal/context/form-field-context.d.ts.map +1 -1
  92. package/internal/context/form-field-context.js +1 -1
  93. package/internal/context/form-field-context.js.map +1 -1
  94. package/internal/environment.js +1 -1
  95. package/internal/environment.json +1 -1
  96. package/internal/generated/styles/tokens.d.ts +5 -0
  97. package/internal/generated/styles/tokens.js +5 -0
  98. package/internal/generated/theming/index.cjs +75 -0
  99. package/internal/generated/theming/index.js +75 -0
  100. package/internal/manifest.json +1 -1
  101. package/link/internal.d.ts.map +1 -1
  102. package/link/internal.js +9 -3
  103. package/link/internal.js.map +1 -1
  104. package/modal/body-scroll.d.ts.map +1 -1
  105. package/modal/body-scroll.js +5 -0
  106. package/modal/body-scroll.js.map +1 -1
  107. package/package.json +1 -1
  108. package/select/parts/filter.d.ts +1 -1
  109. package/select/parts/filter.d.ts.map +1 -1
  110. package/select/parts/trigger.d.ts.map +1 -1
  111. package/select/parts/trigger.js +2 -2
  112. package/select/parts/trigger.js.map +1 -1
  113. package/side-navigation/styles.css.js +28 -28
  114. package/side-navigation/styles.scoped.css +44 -43
  115. package/side-navigation/styles.selectors.js +28 -28
  116. package/table/body-cell/disabled-inline-editor.d.ts +1 -1
  117. package/table/body-cell/disabled-inline-editor.d.ts.map +1 -1
  118. package/table/body-cell/disabled-inline-editor.js +2 -2
  119. package/table/body-cell/disabled-inline-editor.js.map +1 -1
  120. package/table/body-cell/index.d.ts +1 -0
  121. package/table/body-cell/index.d.ts.map +1 -1
  122. package/table/body-cell/index.js +2 -2
  123. package/table/body-cell/index.js.map +1 -1
  124. package/table/body-cell/styles.css.js +44 -43
  125. package/table/body-cell/styles.scoped.css +167 -165
  126. package/table/body-cell/styles.selectors.js +44 -43
  127. package/table/internal.d.ts.map +1 -1
  128. package/table/internal.js +1 -1
  129. package/table/internal.js.map +1 -1
  130. package/test-utils/dom/file-upload/index.d.ts +2 -0
  131. package/test-utils/dom/file-upload/index.js +6 -0
  132. package/test-utils/dom/file-upload/index.js.map +1 -1
  133. package/test-utils/dom/form-field/index.d.ts +1 -0
  134. package/test-utils/dom/form-field/index.js +3 -0
  135. package/test-utils/dom/form-field/index.js.map +1 -1
  136. package/test-utils/selectors/file-upload/index.d.ts +2 -0
  137. package/test-utils/selectors/file-upload/index.js +6 -0
  138. package/test-utils/selectors/file-upload/index.js.map +1 -1
  139. package/test-utils/selectors/form-field/index.d.ts +1 -0
  140. package/test-utils/selectors/form-field/index.js +3 -0
  141. package/test-utils/selectors/form-field/index.js.map +1 -1
  142. package/test-utils/tsconfig.tsbuildinfo +1 -1
  143. package/textarea/index.d.ts.map +1 -1
  144. package/textarea/index.js +2 -1
  145. package/textarea/index.js.map +1 -1
  146. package/textarea/styles.css.js +5 -4
  147. package/textarea/styles.scoped.css +23 -12
  148. package/textarea/styles.selectors.js +5 -4
  149. package/token-group/styles.css.js +9 -8
  150. package/token-group/styles.scoped.css +27 -16
  151. package/token-group/styles.selectors.js +9 -8
  152. package/token-group/token.d.ts +3 -1
  153. package/token-group/token.d.ts.map +1 -1
  154. package/token-group/token.js +8 -5
  155. package/token-group/token.js.map +1 -1
  156. package/wizard/analytics.d.ts +2 -1
  157. package/wizard/analytics.d.ts.map +1 -1
  158. package/wizard/analytics.js +7 -3
  159. package/wizard/analytics.js.map +1 -1
  160. package/wizard/index.js +1 -1
  161. package/wizard/index.js.map +1 -1
  162. package/wizard/internal.d.ts.map +1 -1
  163. package/wizard/internal.js +2 -2
  164. package/wizard/internal.js.map +1 -1
  165. package/wizard/wizard-form.d.ts +4 -2
  166. package/wizard/wizard-form.d.ts.map +1 -1
  167. package/wizard/wizard-form.js +31 -19
  168. package/wizard/wizard-form.js.map +1 -1
@@ -30,7 +30,7 @@ export interface FormFieldControlProps {
30
30
  */
31
31
  ariaDescribedby?: string;
32
32
  }
33
- export interface FormFieldValidationControlProps extends FormFieldControlProps {
33
+ export interface FormFieldCommonValidationControlProps extends FormFieldControlProps {
34
34
  /**
35
35
  * Overrides the invalidation state. Usually the invalid state
36
36
  * comes from the parent `FormField`component,
@@ -40,6 +40,19 @@ export interface FormFieldValidationControlProps extends FormFieldControlProps {
40
40
  */
41
41
  invalid?: boolean;
42
42
  }
43
+ export interface FormFieldValidationControlProps extends FormFieldCommonValidationControlProps {
44
+ /**
45
+ * Overrides the warning state. Usually the warning state
46
+ * comes from the parent `FormField`component,
47
+ * however sometimes you need to override its
48
+ * state when you have more than one input within a
49
+ * single form field.
50
+ * When you use it, provide additional context with
51
+ * information on the input state, and associate it
52
+ * with the input using `ariaDescribedby`.
53
+ */
54
+ warning?: boolean;
55
+ }
43
56
  export declare const FormFieldContext: import("react").Context<FormFieldValidationControlProps>;
44
57
  export declare function useFormFieldContext(props: FormFieldValidationControlProps): FormFieldValidationControlProps;
45
58
  //# sourceMappingURL=form-field-context.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"form-field-context.d.ts","sourceRoot":"","sources":["../../../../src/internal/context/form-field-context.ts"],"names":[],"mappings":";AAIA,MAAM,WAAW,qBAAqB;IACpC;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;;;;;OAQG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;;;;;;;OASG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,+BAAgC,SAAQ,qBAAqB;IAC5E;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,gBAAgB,0DAAqD,CAAC;AAUnF,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,+BAA+B,mCAGzE"}
1
+ {"version":3,"file":"form-field-context.d.ts","sourceRoot":"","sources":["../../../../src/internal/context/form-field-context.ts"],"names":[],"mappings":";AAIA,MAAM,WAAW,qBAAqB;IACpC;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;;;;;OAQG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;;;;;;;OASG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,qCAAsC,SAAQ,qBAAqB;IAClF;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,+BAAgC,SAAQ,qCAAqC;IAC5F;;;;;;;;;OASG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,gBAAgB,0DAAqD,CAAC;AAUnF,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,+BAA+B,mCAGzE"}
@@ -11,6 +11,6 @@ function applyDefault(fields, defaults, keys) {
11
11
  }
12
12
  export function useFormFieldContext(props) {
13
13
  const context = useContext(FormFieldContext);
14
- return applyDefault(props, context, ['invalid', 'controlId', 'ariaLabelledby', 'ariaDescribedby']);
14
+ return applyDefault(props, context, ['invalid', 'warning', 'controlId', 'ariaLabelledby', 'ariaDescribedby']);
15
15
  }
16
16
  //# sourceMappingURL=form-field-context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"form-field-context.js","sourceRoot":"","sources":["../../../../src/internal/context/form-field-context.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AA+ClD,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAAkC,EAAE,CAAC,CAAC;AAEnF,SAAS,YAAY,CAAI,MAAS,EAAE,QAAW,EAAE,IAAiB;IAChE,MAAM,MAAM,GAAM,EAAE,CAAC;IACrB,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;QACjB,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACxE,CAAC,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,KAAsC;IACxE,MAAM,OAAO,GAAG,UAAU,CAAC,gBAAgB,CAAC,CAAC;IAC7C,OAAO,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC,SAAS,EAAE,WAAW,EAAE,gBAAgB,EAAE,iBAAiB,CAAC,CAAC,CAAC;AACrG,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useContext, createContext } from 'react';\n\nexport interface FormFieldControlProps {\n /**\n * Specifies the ID of the native form element. You can use it to relate\n * a label element's `for` attribute to this control.\n *\n * It defaults to an automatically generated ID that\n * is provided by its parent form field component.\n */\n controlId?: string;\n\n /**\n * Adds `aria-labelledby` to the component. If you're using this component within a form field,\n * don't set this property because the form field component automatically sets it.\n *\n * Use this property if the component isn't surrounded by a form field, or you want to override the value\n * automatically set by the form field (for example, if you have two components within a single form field).\n *\n * To use it correctly, define an ID for the element you want to use as label and set the property to that ID.\n */\n ariaLabelledby?: string;\n\n /**\n * Adds `aria-describedby` to the component. If you're using this component within a form field,\n * don't set this property because the form field component automatically sets it.\n *\n * Use this property if the component isn't surrounded by a form field, or you want to override the value\n * automatically set by the form field (for example, if you have two components within a single form field).\n *\n * To use it correctly, define an ID for each element that you want to use as a description\n * and set the property to a string of each ID separated by spaces (for example, `\"id1 id2 id3\"`).\n */\n ariaDescribedby?: string;\n}\n\nexport interface FormFieldValidationControlProps extends FormFieldControlProps {\n /**\n * Overrides the invalidation state. Usually the invalid state\n * comes from the parent `FormField`component,\n * however sometimes you need to override its\n * state when you have more than one input within a\n * single form field.\n */\n invalid?: boolean;\n}\n\nexport const FormFieldContext = createContext<FormFieldValidationControlProps>({});\n\nfunction applyDefault<T>(fields: T, defaults: T, keys: (keyof T)[]) {\n const result = <T>{};\n keys.forEach(key => {\n result[key] = fields[key] === undefined ? defaults[key] : fields[key];\n });\n return result;\n}\n\nexport function useFormFieldContext(props: FormFieldValidationControlProps) {\n const context = useContext(FormFieldContext);\n return applyDefault(props, context, ['invalid', 'controlId', 'ariaLabelledby', 'ariaDescribedby']);\n}\n"]}
1
+ {"version":3,"file":"form-field-context.js","sourceRoot":"","sources":["../../../../src/internal/context/form-field-context.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AA6DlD,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAAkC,EAAE,CAAC,CAAC;AAEnF,SAAS,YAAY,CAAI,MAAS,EAAE,QAAW,EAAE,IAAiB;IAChE,MAAM,MAAM,GAAM,EAAE,CAAC;IACrB,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;QACjB,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACxE,CAAC,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,KAAsC;IACxE,MAAM,OAAO,GAAG,UAAU,CAAC,gBAAgB,CAAC,CAAC;IAC7C,OAAO,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,gBAAgB,EAAE,iBAAiB,CAAC,CAAC,CAAC;AAChH,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useContext, createContext } from 'react';\n\nexport interface FormFieldControlProps {\n /**\n * Specifies the ID of the native form element. You can use it to relate\n * a label element's `for` attribute to this control.\n *\n * It defaults to an automatically generated ID that\n * is provided by its parent form field component.\n */\n controlId?: string;\n\n /**\n * Adds `aria-labelledby` to the component. If you're using this component within a form field,\n * don't set this property because the form field component automatically sets it.\n *\n * Use this property if the component isn't surrounded by a form field, or you want to override the value\n * automatically set by the form field (for example, if you have two components within a single form field).\n *\n * To use it correctly, define an ID for the element you want to use as label and set the property to that ID.\n */\n ariaLabelledby?: string;\n\n /**\n * Adds `aria-describedby` to the component. If you're using this component within a form field,\n * don't set this property because the form field component automatically sets it.\n *\n * Use this property if the component isn't surrounded by a form field, or you want to override the value\n * automatically set by the form field (for example, if you have two components within a single form field).\n *\n * To use it correctly, define an ID for each element that you want to use as a description\n * and set the property to a string of each ID separated by spaces (for example, `\"id1 id2 id3\"`).\n */\n ariaDescribedby?: string;\n}\n\nexport interface FormFieldCommonValidationControlProps extends FormFieldControlProps {\n /**\n * Overrides the invalidation state. Usually the invalid state\n * comes from the parent `FormField`component,\n * however sometimes you need to override its\n * state when you have more than one input within a\n * single form field.\n */\n invalid?: boolean;\n}\n\nexport interface FormFieldValidationControlProps extends FormFieldCommonValidationControlProps {\n /**\n * Overrides the warning state. Usually the warning state\n * comes from the parent `FormField`component,\n * however sometimes you need to override its\n * state when you have more than one input within a\n * single form field.\n * When you use it, provide additional context with\n * information on the input state, and associate it\n * with the input using `ariaDescribedby`.\n */\n warning?: boolean;\n}\n\nexport const FormFieldContext = createContext<FormFieldValidationControlProps>({});\n\nfunction applyDefault<T>(fields: T, defaults: T, keys: (keyof T)[]) {\n const result = <T>{};\n keys.forEach(key => {\n result[key] = fields[key] === undefined ? defaults[key] : fields[key];\n });\n return result;\n}\n\nexport function useFormFieldContext(props: FormFieldValidationControlProps) {\n const context = useContext(FormFieldContext);\n return applyDefault(props, context, ['invalid', 'warning', 'controlId', 'ariaLabelledby', 'ariaDescribedby']);\n}\n"]}
@@ -1,4 +1,4 @@
1
1
  export var PACKAGE_SOURCE = "components";
2
- export var PACKAGE_VERSION = "3.0.0 (94ca71b8)";
2
+ export var PACKAGE_VERSION = "3.0.0 (069cda15)";
3
3
  export var THEME = "open-source-visual-refresh";
4
4
  export var ALWAYS_VISUAL_REFRESH = true;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "PACKAGE_SOURCE": "components",
3
- "PACKAGE_VERSION": "3.0.0 (94ca71b8)",
3
+ "PACKAGE_VERSION": "3.0.0 (069cda15)",
4
4
  "THEME": "default",
5
5
  "ALWAYS_VISUAL_REFRESH": false
6
6
  }
@@ -327,6 +327,7 @@ export const colorBorderItemPlaceholder: string;
327
327
  export const colorBorderItemSelected: string;
328
328
  export const colorBorderLayout: string;
329
329
  export const colorBorderNotificationStackBar: string;
330
+ export const colorBorderPanelHeader: string;
330
331
  export const colorBorderPopover: string;
331
332
  export const colorBorderSegmentActive: string;
332
333
  export const colorBorderSegmentDefault: string;
@@ -620,6 +621,10 @@ export const spaceLayoutTogglePadding: string;
620
621
  export const spaceModalContentBottom: string;
621
622
  export const spaceModalHorizontal: string;
622
623
  export const spaceOptionIconBigTop: string;
624
+ export const spacePanelContentBottom: string;
625
+ export const spacePanelContentTop: string;
626
+ export const spacePanelDividerMarginHorizontal: string;
627
+ export const spacePanelHeaderVertical: string;
623
628
  export const spacePanelNavLeft: string;
624
629
  export const spacePanelSideLeft: string;
625
630
  export const spacePanelSideRight: string;
@@ -327,6 +327,7 @@ export var colorBorderItemPlaceholder = "var(--color-border-item-placeholder-h8j
327
327
  export var colorBorderItemSelected = "var(--color-border-item-selected-k00wlz, #0972d3)";
328
328
  export var colorBorderLayout = "var(--color-border-layout-ownedw, #d1d5db)";
329
329
  export var colorBorderNotificationStackBar = "var(--color-border-notification-stack-bar-t3aws2, #232f3e)";
330
+ export var colorBorderPanelHeader = "var(--color-border-panel-header-lf0q4c, #b6bec9)";
330
331
  export var colorBorderPopover = "var(--color-border-popover-umqvld, #9ba7b6)";
331
332
  export var colorBorderSegmentActive = "var(--color-border-segment-active-9ah16u, #414d5c)";
332
333
  export var colorBorderSegmentDefault = "var(--color-border-segment-default-a5zrkd, #414d5c)";
@@ -620,6 +621,10 @@ export var spaceLayoutTogglePadding = "var(--space-layout-toggle-padding-lcu6qi,
620
621
  export var spaceModalContentBottom = "var(--space-modal-content-bottom-hqahub, 16px)";
621
622
  export var spaceModalHorizontal = "var(--space-modal-horizontal-f89syl, 20px)";
622
623
  export var spaceOptionIconBigTop = "var(--space-option-icon-big-top-hybljv, 0px)";
624
+ export var spacePanelContentBottom = "var(--space-panel-content-bottom-7k6er3, 40px)";
625
+ export var spacePanelContentTop = "var(--space-panel-content-top-wac3yp, 20px)";
626
+ export var spacePanelDividerMarginHorizontal = "var(--space-panel-divider-margin-horizontal-sbik1z, 8px)";
627
+ export var spacePanelHeaderVertical = "var(--space-panel-header-vertical-gv9pti, 20px)";
623
628
  export var spacePanelNavLeft = "var(--space-panel-nav-left-b1g0mt, 28px)";
624
629
  export var spacePanelSideLeft = "var(--space-panel-side-left-5t0who, 28px)";
625
630
  export var spacePanelSideRight = "var(--space-panel-side-right-xofg51, 24px)";
@@ -1193,6 +1193,10 @@ module.exports.preset = {
1193
1193
  "light": "{colorGrey700}",
1194
1194
  "dark": "{colorGrey700}"
1195
1195
  },
1196
+ "colorBorderPanelHeader": {
1197
+ "light": "{colorBorderDividerDefault}",
1198
+ "dark": "{colorBorderDividerDefault}"
1199
+ },
1196
1200
  "colorBorderPopover": {
1197
1201
  "light": "{colorGrey400}",
1198
1202
  "dark": "{colorGrey550}"
@@ -2107,6 +2111,22 @@ module.exports.preset = {
2107
2111
  "comfortable": "0px",
2108
2112
  "compact": "0px"
2109
2113
  },
2114
+ "spacePanelContentBottom": {
2115
+ "comfortable": "{spaceScaledXxxl}",
2116
+ "compact": "{spaceScaledXxxl}"
2117
+ },
2118
+ "spacePanelContentTop": {
2119
+ "comfortable": "{spaceScaledL}",
2120
+ "compact": "{spaceScaledL}"
2121
+ },
2122
+ "spacePanelDividerMarginHorizontal": {
2123
+ "comfortable": "{spaceXs}",
2124
+ "compact": "{spaceXs}"
2125
+ },
2126
+ "spacePanelHeaderVertical": {
2127
+ "comfortable": "{spaceScaledL}",
2128
+ "compact": "{spaceScaledL}"
2129
+ },
2110
2130
  "spacePanelNavLeft": {
2111
2131
  "comfortable": "28px",
2112
2132
  "compact": "28px"
@@ -2553,6 +2573,22 @@ module.exports.preset = {
2553
2573
  "comfortable": "0px",
2554
2574
  "compact": "0px"
2555
2575
  },
2576
+ "spacePanelContentBottom": {
2577
+ "comfortable": "{spaceScaledXxxl}",
2578
+ "compact": "{spaceScaledXxxl}"
2579
+ },
2580
+ "spacePanelContentTop": {
2581
+ "comfortable": "{spaceScaledL}",
2582
+ "compact": "{spaceScaledL}"
2583
+ },
2584
+ "spacePanelDividerMarginHorizontal": {
2585
+ "comfortable": "{spaceXs}",
2586
+ "compact": "{spaceXs}"
2587
+ },
2588
+ "spacePanelHeaderVertical": {
2589
+ "comfortable": "{spaceScaledL}",
2590
+ "compact": "{spaceScaledL}"
2591
+ },
2556
2592
  "spacePanelNavLeft": {
2557
2593
  "comfortable": "28px",
2558
2594
  "compact": "28px"
@@ -3263,6 +3299,10 @@ module.exports.preset = {
3263
3299
  "light": "{colorGrey700}",
3264
3300
  "dark": "{colorGrey700}"
3265
3301
  },
3302
+ "colorBorderPanelHeader": {
3303
+ "light": "{colorBorderDividerDefault}",
3304
+ "dark": "{colorBorderDividerDefault}"
3305
+ },
3266
3306
  "colorBorderPopover": {
3267
3307
  "light": "{colorGrey550}",
3268
3308
  "dark": "{colorGrey550}"
@@ -4305,6 +4345,10 @@ module.exports.preset = {
4305
4345
  "light": "{colorGrey700}",
4306
4346
  "dark": "{colorGrey700}"
4307
4347
  },
4348
+ "colorBorderPanelHeader": {
4349
+ "light": "{colorBorderDividerDefault}",
4350
+ "dark": "{colorBorderDividerDefault}"
4351
+ },
4308
4352
  "colorBorderPopover": {
4309
4353
  "light": "{colorGrey550}",
4310
4354
  "dark": "{colorGrey550}"
@@ -5279,6 +5323,10 @@ module.exports.preset = {
5279
5323
  "light": "{colorGrey700}",
5280
5324
  "dark": "{colorGrey700}"
5281
5325
  },
5326
+ "colorBorderPanelHeader": {
5327
+ "light": "{colorBorderDividerDefault}",
5328
+ "dark": "{colorBorderDividerDefault}"
5329
+ },
5282
5330
  "colorBorderPopover": {
5283
5331
  "light": "{colorGrey400}",
5284
5332
  "dark": "{colorGrey550}"
@@ -6253,6 +6301,10 @@ module.exports.preset = {
6253
6301
  "light": "{colorGrey700}",
6254
6302
  "dark": "{colorGrey700}"
6255
6303
  },
6304
+ "colorBorderPanelHeader": {
6305
+ "light": "{colorBorderDividerDefault}",
6306
+ "dark": "{colorBorderDividerDefault}"
6307
+ },
6256
6308
  "colorBorderPopover": {
6257
6309
  "light": "{colorGrey400}",
6258
6310
  "dark": "{colorGrey550}"
@@ -7227,6 +7279,10 @@ module.exports.preset = {
7227
7279
  "light": "{colorGrey700}",
7228
7280
  "dark": "{colorGrey700}"
7229
7281
  },
7282
+ "colorBorderPanelHeader": {
7283
+ "light": "{colorBorderDividerDefault}",
7284
+ "dark": "{colorBorderDividerDefault}"
7285
+ },
7230
7286
  "colorBorderPopover": {
7231
7287
  "light": "{colorGrey400}",
7232
7288
  "dark": "{colorGrey550}"
@@ -8203,6 +8259,10 @@ module.exports.preset = {
8203
8259
  "light": "{colorGrey700}",
8204
8260
  "dark": "{colorGrey700}"
8205
8261
  },
8262
+ "colorBorderPanelHeader": {
8263
+ "light": "{colorBorderDividerDefault}",
8264
+ "dark": "{colorBorderDividerDefault}"
8265
+ },
8206
8266
  "colorBorderPopover": {
8207
8267
  "light": "{colorGrey550}",
8208
8268
  "dark": "{colorGrey550}"
@@ -8966,6 +9026,7 @@ module.exports.preset = {
8966
9026
  "colorBorderItemSelected": "color",
8967
9027
  "colorBorderLayout": "color",
8968
9028
  "colorBorderNotificationStackBar": "color",
9029
+ "colorBorderPanelHeader": "color",
8969
9030
  "colorBorderPopover": "color",
8970
9031
  "colorBorderSegmentActive": "color",
8971
9032
  "colorBorderSegmentDefault": "color",
@@ -9173,6 +9234,10 @@ module.exports.preset = {
9173
9234
  "spaceModalContentBottom": "density",
9174
9235
  "spaceModalHorizontal": "density",
9175
9236
  "spaceOptionIconBigTop": "density",
9237
+ "spacePanelContentBottom": "density",
9238
+ "spacePanelContentTop": "density",
9239
+ "spacePanelDividerMarginHorizontal": "density",
9240
+ "spacePanelHeaderVertical": "density",
9176
9241
  "spacePanelNavLeft": "density",
9177
9242
  "spacePanelSideLeft": "density",
9178
9243
  "spacePanelSideRight": "density",
@@ -10145,6 +10210,7 @@ module.exports.preset = {
10145
10210
  "colorBorderItemSelected": "color-border-item-selected",
10146
10211
  "colorBorderLayout": "color-border-layout",
10147
10212
  "colorBorderNotificationStackBar": "color-border-notification-stack-bar",
10213
+ "colorBorderPanelHeader": "color-border-panel-header",
10148
10214
  "colorBorderPopover": "color-border-popover",
10149
10215
  "colorBorderSegmentActive": "color-border-segment-active",
10150
10216
  "colorBorderSegmentDefault": "color-border-segment-default",
@@ -10438,6 +10504,10 @@ module.exports.preset = {
10438
10504
  "spaceModalContentBottom": "space-modal-content-bottom",
10439
10505
  "spaceModalHorizontal": "space-modal-horizontal",
10440
10506
  "spaceOptionIconBigTop": "space-option-icon-big-top",
10507
+ "spacePanelContentBottom": "space-panel-content-bottom",
10508
+ "spacePanelContentTop": "space-panel-content-top",
10509
+ "spacePanelDividerMarginHorizontal": "space-panel-divider-margin-horizontal",
10510
+ "spacePanelHeaderVertical": "space-panel-header-vertical",
10441
10511
  "spacePanelNavLeft": "space-panel-nav-left",
10442
10512
  "spacePanelSideLeft": "space-panel-side-left",
10443
10513
  "spacePanelSideRight": "space-panel-side-right",
@@ -10840,6 +10910,7 @@ module.exports.preset = {
10840
10910
  "colorBorderItemSelected": "--color-border-item-selected-k00wlz",
10841
10911
  "colorBorderLayout": "--color-border-layout-ownedw",
10842
10912
  "colorBorderNotificationStackBar": "--color-border-notification-stack-bar-t3aws2",
10913
+ "colorBorderPanelHeader": "--color-border-panel-header-lf0q4c",
10843
10914
  "colorBorderPopover": "--color-border-popover-umqvld",
10844
10915
  "colorBorderSegmentActive": "--color-border-segment-active-9ah16u",
10845
10916
  "colorBorderSegmentDefault": "--color-border-segment-default-a5zrkd",
@@ -11133,6 +11204,10 @@ module.exports.preset = {
11133
11204
  "spaceModalContentBottom": "--space-modal-content-bottom-hqahub",
11134
11205
  "spaceModalHorizontal": "--space-modal-horizontal-f89syl",
11135
11206
  "spaceOptionIconBigTop": "--space-option-icon-big-top-hybljv",
11207
+ "spacePanelContentBottom": "--space-panel-content-bottom-7k6er3",
11208
+ "spacePanelContentTop": "--space-panel-content-top-wac3yp",
11209
+ "spacePanelDividerMarginHorizontal": "--space-panel-divider-margin-horizontal-sbik1z",
11210
+ "spacePanelHeaderVertical": "--space-panel-header-vertical-gv9pti",
11136
11211
  "spacePanelNavLeft": "--space-panel-nav-left-b1g0mt",
11137
11212
  "spacePanelSideLeft": "--space-panel-side-left-5t0who",
11138
11213
  "spacePanelSideRight": "--space-panel-side-right-xofg51",
@@ -1193,6 +1193,10 @@ export var preset = {
1193
1193
  "light": "{colorGrey700}",
1194
1194
  "dark": "{colorGrey700}"
1195
1195
  },
1196
+ "colorBorderPanelHeader": {
1197
+ "light": "{colorBorderDividerDefault}",
1198
+ "dark": "{colorBorderDividerDefault}"
1199
+ },
1196
1200
  "colorBorderPopover": {
1197
1201
  "light": "{colorGrey400}",
1198
1202
  "dark": "{colorGrey550}"
@@ -2107,6 +2111,22 @@ export var preset = {
2107
2111
  "comfortable": "0px",
2108
2112
  "compact": "0px"
2109
2113
  },
2114
+ "spacePanelContentBottom": {
2115
+ "comfortable": "{spaceScaledXxxl}",
2116
+ "compact": "{spaceScaledXxxl}"
2117
+ },
2118
+ "spacePanelContentTop": {
2119
+ "comfortable": "{spaceScaledL}",
2120
+ "compact": "{spaceScaledL}"
2121
+ },
2122
+ "spacePanelDividerMarginHorizontal": {
2123
+ "comfortable": "{spaceXs}",
2124
+ "compact": "{spaceXs}"
2125
+ },
2126
+ "spacePanelHeaderVertical": {
2127
+ "comfortable": "{spaceScaledL}",
2128
+ "compact": "{spaceScaledL}"
2129
+ },
2110
2130
  "spacePanelNavLeft": {
2111
2131
  "comfortable": "28px",
2112
2132
  "compact": "28px"
@@ -2553,6 +2573,22 @@ export var preset = {
2553
2573
  "comfortable": "0px",
2554
2574
  "compact": "0px"
2555
2575
  },
2576
+ "spacePanelContentBottom": {
2577
+ "comfortable": "{spaceScaledXxxl}",
2578
+ "compact": "{spaceScaledXxxl}"
2579
+ },
2580
+ "spacePanelContentTop": {
2581
+ "comfortable": "{spaceScaledL}",
2582
+ "compact": "{spaceScaledL}"
2583
+ },
2584
+ "spacePanelDividerMarginHorizontal": {
2585
+ "comfortable": "{spaceXs}",
2586
+ "compact": "{spaceXs}"
2587
+ },
2588
+ "spacePanelHeaderVertical": {
2589
+ "comfortable": "{spaceScaledL}",
2590
+ "compact": "{spaceScaledL}"
2591
+ },
2556
2592
  "spacePanelNavLeft": {
2557
2593
  "comfortable": "28px",
2558
2594
  "compact": "28px"
@@ -3263,6 +3299,10 @@ export var preset = {
3263
3299
  "light": "{colorGrey700}",
3264
3300
  "dark": "{colorGrey700}"
3265
3301
  },
3302
+ "colorBorderPanelHeader": {
3303
+ "light": "{colorBorderDividerDefault}",
3304
+ "dark": "{colorBorderDividerDefault}"
3305
+ },
3266
3306
  "colorBorderPopover": {
3267
3307
  "light": "{colorGrey550}",
3268
3308
  "dark": "{colorGrey550}"
@@ -4305,6 +4345,10 @@ export var preset = {
4305
4345
  "light": "{colorGrey700}",
4306
4346
  "dark": "{colorGrey700}"
4307
4347
  },
4348
+ "colorBorderPanelHeader": {
4349
+ "light": "{colorBorderDividerDefault}",
4350
+ "dark": "{colorBorderDividerDefault}"
4351
+ },
4308
4352
  "colorBorderPopover": {
4309
4353
  "light": "{colorGrey550}",
4310
4354
  "dark": "{colorGrey550}"
@@ -5279,6 +5323,10 @@ export var preset = {
5279
5323
  "light": "{colorGrey700}",
5280
5324
  "dark": "{colorGrey700}"
5281
5325
  },
5326
+ "colorBorderPanelHeader": {
5327
+ "light": "{colorBorderDividerDefault}",
5328
+ "dark": "{colorBorderDividerDefault}"
5329
+ },
5282
5330
  "colorBorderPopover": {
5283
5331
  "light": "{colorGrey400}",
5284
5332
  "dark": "{colorGrey550}"
@@ -6253,6 +6301,10 @@ export var preset = {
6253
6301
  "light": "{colorGrey700}",
6254
6302
  "dark": "{colorGrey700}"
6255
6303
  },
6304
+ "colorBorderPanelHeader": {
6305
+ "light": "{colorBorderDividerDefault}",
6306
+ "dark": "{colorBorderDividerDefault}"
6307
+ },
6256
6308
  "colorBorderPopover": {
6257
6309
  "light": "{colorGrey400}",
6258
6310
  "dark": "{colorGrey550}"
@@ -7227,6 +7279,10 @@ export var preset = {
7227
7279
  "light": "{colorGrey700}",
7228
7280
  "dark": "{colorGrey700}"
7229
7281
  },
7282
+ "colorBorderPanelHeader": {
7283
+ "light": "{colorBorderDividerDefault}",
7284
+ "dark": "{colorBorderDividerDefault}"
7285
+ },
7230
7286
  "colorBorderPopover": {
7231
7287
  "light": "{colorGrey400}",
7232
7288
  "dark": "{colorGrey550}"
@@ -8203,6 +8259,10 @@ export var preset = {
8203
8259
  "light": "{colorGrey700}",
8204
8260
  "dark": "{colorGrey700}"
8205
8261
  },
8262
+ "colorBorderPanelHeader": {
8263
+ "light": "{colorBorderDividerDefault}",
8264
+ "dark": "{colorBorderDividerDefault}"
8265
+ },
8206
8266
  "colorBorderPopover": {
8207
8267
  "light": "{colorGrey550}",
8208
8268
  "dark": "{colorGrey550}"
@@ -8966,6 +9026,7 @@ export var preset = {
8966
9026
  "colorBorderItemSelected": "color",
8967
9027
  "colorBorderLayout": "color",
8968
9028
  "colorBorderNotificationStackBar": "color",
9029
+ "colorBorderPanelHeader": "color",
8969
9030
  "colorBorderPopover": "color",
8970
9031
  "colorBorderSegmentActive": "color",
8971
9032
  "colorBorderSegmentDefault": "color",
@@ -9173,6 +9234,10 @@ export var preset = {
9173
9234
  "spaceModalContentBottom": "density",
9174
9235
  "spaceModalHorizontal": "density",
9175
9236
  "spaceOptionIconBigTop": "density",
9237
+ "spacePanelContentBottom": "density",
9238
+ "spacePanelContentTop": "density",
9239
+ "spacePanelDividerMarginHorizontal": "density",
9240
+ "spacePanelHeaderVertical": "density",
9176
9241
  "spacePanelNavLeft": "density",
9177
9242
  "spacePanelSideLeft": "density",
9178
9243
  "spacePanelSideRight": "density",
@@ -10145,6 +10210,7 @@ export var preset = {
10145
10210
  "colorBorderItemSelected": "color-border-item-selected",
10146
10211
  "colorBorderLayout": "color-border-layout",
10147
10212
  "colorBorderNotificationStackBar": "color-border-notification-stack-bar",
10213
+ "colorBorderPanelHeader": "color-border-panel-header",
10148
10214
  "colorBorderPopover": "color-border-popover",
10149
10215
  "colorBorderSegmentActive": "color-border-segment-active",
10150
10216
  "colorBorderSegmentDefault": "color-border-segment-default",
@@ -10438,6 +10504,10 @@ export var preset = {
10438
10504
  "spaceModalContentBottom": "space-modal-content-bottom",
10439
10505
  "spaceModalHorizontal": "space-modal-horizontal",
10440
10506
  "spaceOptionIconBigTop": "space-option-icon-big-top",
10507
+ "spacePanelContentBottom": "space-panel-content-bottom",
10508
+ "spacePanelContentTop": "space-panel-content-top",
10509
+ "spacePanelDividerMarginHorizontal": "space-panel-divider-margin-horizontal",
10510
+ "spacePanelHeaderVertical": "space-panel-header-vertical",
10441
10511
  "spacePanelNavLeft": "space-panel-nav-left",
10442
10512
  "spacePanelSideLeft": "space-panel-side-left",
10443
10513
  "spacePanelSideRight": "space-panel-side-right",
@@ -10840,6 +10910,7 @@ export var preset = {
10840
10910
  "colorBorderItemSelected": "--color-border-item-selected-k00wlz",
10841
10911
  "colorBorderLayout": "--color-border-layout-ownedw",
10842
10912
  "colorBorderNotificationStackBar": "--color-border-notification-stack-bar-t3aws2",
10913
+ "colorBorderPanelHeader": "--color-border-panel-header-lf0q4c",
10843
10914
  "colorBorderPopover": "--color-border-popover-umqvld",
10844
10915
  "colorBorderSegmentActive": "--color-border-segment-active-9ah16u",
10845
10916
  "colorBorderSegmentDefault": "--color-border-segment-default-a5zrkd",
@@ -11133,6 +11204,10 @@ export var preset = {
11133
11204
  "spaceModalContentBottom": "--space-modal-content-bottom-hqahub",
11134
11205
  "spaceModalHorizontal": "--space-modal-horizontal-f89syl",
11135
11206
  "spaceOptionIconBigTop": "--space-option-icon-big-top-hybljv",
11207
+ "spacePanelContentBottom": "--space-panel-content-bottom-7k6er3",
11208
+ "spacePanelContentTop": "--space-panel-content-top-wac3yp",
11209
+ "spacePanelDividerMarginHorizontal": "--space-panel-divider-margin-horizontal-sbik1z",
11210
+ "spacePanelHeaderVertical": "--space-panel-header-vertical-gv9pti",
11136
11211
  "spacePanelNavLeft": "--space-panel-nav-left-b1g0mt",
11137
11212
  "spacePanelSideLeft": "--space-panel-side-left-5t0who",
11138
11213
  "spacePanelSideRight": "--space-panel-side-right-xofg51",
@@ -1,3 +1,3 @@
1
1
  {
2
- "commit": "94ca71b8aef86bf77b0ea1b7d4c27a55fe3616cb"
2
+ "commit": "069cda1560c7b5eb251bc13786f9d8a572e882fe"
3
3
  }
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/link/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAQlD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAwBlF,QAAA,MAAM,YAAY;cAHJ,SAAS,CAAC,SAAS,CAAC,GAAG,gBAAgB,GAAG,MAAM,GAAG,UAAU;uCA0L1E,CAAC;AAqBF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/link/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAQlD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAwBlF,QAAA,MAAM,YAAY;cAHJ,SAAS,CAAC,SAAS,CAAC,GAAG,gBAAgB,GAAG,MAAM,GAAG,UAAU;uCAgM1E,CAAC;AAqBF,eAAe,YAAY,CAAC"}
package/link/internal.js CHANGED
@@ -36,17 +36,20 @@ const InternalLink = React.forwardRef((_a, ref) => {
36
36
  const linkId = useUniqueId('link-self');
37
37
  const infoId = useUniqueId('link-info');
38
38
  const infoLinkLabelFromContext = useContext(InfoLinkLabelContext);
39
- const { funnelInteractionId } = useFunnel();
40
- const { stepNumber, stepNameSelector } = useFunnelStep();
41
- const { subStepSelector, subStepNameSelector } = useFunnelSubStep();
39
+ const { funnelIdentifier, funnelInteractionId } = useFunnel();
40
+ const { stepIdentifier, stepNumber, stepNameSelector } = useFunnelStep();
41
+ const { subStepIdentifier, subStepSelector, subStepNameSelector } = useFunnelSubStep();
42
42
  const fireFunnelEvent = (funnelInteractionId) => {
43
43
  if (variant === 'info') {
44
44
  const stepName = getNameFromSelector(stepNameSelector);
45
45
  const subStepName = getNameFromSelector(subStepNameSelector);
46
46
  FunnelMetrics.helpPanelInteracted({
47
+ funnelIdentifier,
47
48
  funnelInteractionId,
49
+ stepIdentifier,
48
50
  stepNumber,
49
51
  stepName,
52
+ subStepIdentifier,
50
53
  stepNameSelector,
51
54
  subStepSelector,
52
55
  subStepName,
@@ -59,10 +62,13 @@ const InternalLink = React.forwardRef((_a, ref) => {
59
62
  const stepName = getNameFromSelector(stepNameSelector);
60
63
  const subStepName = getNameFromSelector(subStepNameSelector);
61
64
  FunnelMetrics.externalLinkInteracted({
65
+ funnelIdentifier,
62
66
  funnelInteractionId,
67
+ stepIdentifier,
63
68
  stepNumber,
64
69
  stepName,
65
70
  stepNameSelector,
71
+ subStepIdentifier,
66
72
  subStepSelector,
67
73
  subStepName,
68
74
  subStepNameSelector,
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/link/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAC5C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3E,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAG9C,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;AACnF,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAEpG,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,yBAAyB,EAAE,MAAM,kDAAkD,CAAC;AAC7F,OAAO,EAAE,0BAA0B,EAAE,MAAM,wDAAwD,CAAC;AAOpG,MAAM,YAAY,GAAG,KAAK,CAAC,UAAU,CACnC,CACE,EA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;IAClD,qDAAqD;IACrD,2CACM,WAAW,IACf,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,YAAY,EACpB,GAAG,EAAE,SAAS,EACd,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,eAAe,KAEvB,OAAO,CACN,CACL,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,SAAS,eAAe,CAAC,OAAyD;IAChF,OAAO,WAAW,OAAO,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,EAAE,CAAC;AACrD,CAAC;AAED,SAAS,gBAAgB,CAAC,OAAqC,EAAE,QAAuC;IACtG,QAAQ,OAAO,EAAE;QACf,KAAK,MAAM;YACT,OAAO,kBAAkB,CAAC;QAC5B,KAAK,mBAAmB;YACtB,OAAO,qBAAqB,CAAC;QAC/B;YACE,OAAO,aAAa,QAAQ,EAAE,CAAC;KAClC;AACH,CAAC;AAED,SAAS,aAAa,CAAC,OAAqC,EAAE,KAAiC;IAC7F,OAAO,SAAS,OAAO,KAAK,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;AAC1D,CAAC;AAED,eAAe,YAAY,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useContext, useRef } from 'react';\nimport clsx from 'clsx';\nimport InternalIcon from '../icon/internal';\nimport styles from './styles.css.js';\nimport { getBaseProps } from '../internal/base-component';\nimport { fireCancelableEvent, isPlainLeftClick } from '../internal/events';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport { KeyCode } from '../internal/keycode';\nimport { LinkProps } from './interfaces';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { checkSafeUrl } from '../internal/utils/check-safe-url';\nimport { useInternalI18n } from '../i18n/context';\nimport { InfoLinkLabelContext } from '../internal/context/info-link-label-context';\nimport { useFunnel, useFunnelStep, useFunnelSubStep } from '../internal/analytics/hooks/use-funnel';\n\nimport { FunnelMetrics } from '../internal/analytics';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport {\n DATA_ATTR_FUNNEL_VALUE,\n getFunnelValueSelector,\n getNameFromSelector,\n getSubStepAllSelector,\n} from '../internal/analytics/selectors';\nimport { LinkDefaultVariantContext } from '../internal/context/link-default-variant-context';\nimport { useSingleTabStopNavigation } from '../internal/context/single-tab-stop-navigation-context';\n\ntype InternalLinkProps = InternalBaseComponentProps<HTMLAnchorElement> &\n Omit<LinkProps, 'variant'> & {\n variant?: LinkProps['variant'] | 'top-navigation' | 'link' | 'recovery';\n };\n\nconst InternalLink = React.forwardRef(\n (\n {\n variant: providedVariant,\n fontSize = 'body-m',\n color = 'normal',\n external = false,\n target,\n href,\n rel,\n ariaLabel,\n externalIconAriaLabel,\n onFollow,\n children,\n __internalRootRef = null,\n ...props\n }: InternalLinkProps,\n ref: React.Ref<LinkProps.Ref>\n ) => {\n checkSafeUrl('Link', href);\n const isButton = !href;\n const { defaultVariant } = useContext(LinkDefaultVariantContext);\n const variant = providedVariant || defaultVariant;\n const specialStyles = ['top-navigation', 'link', 'recovery'];\n const hasSpecialStyle = specialStyles.indexOf(variant) > -1;\n\n const i18n = useInternalI18n('link');\n const baseProps = getBaseProps(props);\n const anchorTarget = target ?? (external ? '_blank' : undefined);\n const anchorRel = rel ?? (anchorTarget === '_blank' ? 'noopener noreferrer' : undefined);\n const uniqueId = useUniqueId('link');\n const linkId = useUniqueId('link-self');\n const infoId = useUniqueId('link-info');\n\n const infoLinkLabelFromContext = useContext(InfoLinkLabelContext);\n\n const { funnelInteractionId } = useFunnel();\n const { stepNumber, stepNameSelector } = useFunnelStep();\n const { subStepSelector, subStepNameSelector } = useFunnelSubStep();\n\n const fireFunnelEvent = (funnelInteractionId: string) => {\n if (variant === 'info') {\n const stepName = getNameFromSelector(stepNameSelector);\n const subStepName = getNameFromSelector(subStepNameSelector);\n\n FunnelMetrics.helpPanelInteracted({\n funnelInteractionId,\n stepNumber,\n stepName,\n stepNameSelector,\n subStepSelector,\n subStepName,\n subStepNameSelector,\n elementSelector: getFunnelValueSelector(uniqueId),\n subStepAllSelector: getSubStepAllSelector(),\n });\n } else if (external) {\n const stepName = getNameFromSelector(stepNameSelector);\n const subStepName = getNameFromSelector(subStepNameSelector);\n\n FunnelMetrics.externalLinkInteracted({\n funnelInteractionId,\n stepNumber,\n stepName,\n stepNameSelector,\n subStepSelector,\n subStepName,\n subStepNameSelector,\n elementSelector: getFunnelValueSelector(uniqueId),\n subStepAllSelector: getSubStepAllSelector(),\n });\n }\n };\n\n const fireFollowEvent = (event: React.SyntheticEvent) => {\n if (funnelInteractionId) {\n fireFunnelEvent(funnelInteractionId);\n }\n\n fireCancelableEvent(onFollow, { href, external, target: anchorTarget }, event);\n };\n\n const handleLinkClick = (event: React.MouseEvent) => {\n if (isPlainLeftClick(event)) {\n fireFollowEvent(event);\n }\n };\n\n const handleButtonClick = (event: React.MouseEvent) => {\n fireFollowEvent(event);\n };\n\n const handleButtonKeyDown = (event: React.KeyboardEvent) => {\n if (event.keyCode === KeyCode.space || event.keyCode === KeyCode.enter) {\n event.preventDefault();\n fireFollowEvent(event);\n }\n };\n\n const linkRef = useRef<HTMLElement>(null);\n const isVisualRefresh = useVisualRefresh();\n useForwardFocus(ref, linkRef);\n\n // Visual refresh should only add styles to buttons that don't already have unique styles (e.g. primary/secondary variants)\n const applyButtonStyles = isButton && isVisualRefresh && !hasSpecialStyle;\n\n const sharedProps = {\n id: linkId,\n ...baseProps,\n // https://github.com/microsoft/TypeScript/issues/36659\n ref: useMergeRefs(linkRef, __internalRootRef),\n className: clsx(\n styles.link,\n baseProps.className,\n applyButtonStyles ? styles.button : null,\n styles[getVariantStyle(variant)],\n styles[getFontSizeStyle(variant, fontSize)],\n styles[getColorStyle(variant, color)]\n ),\n 'aria-label': ariaLabel,\n 'aria-labelledby': '',\n [DATA_ATTR_FUNNEL_VALUE]: uniqueId,\n };\n\n if (variant === 'info' && infoLinkLabelFromContext && !ariaLabel) {\n sharedProps['aria-labelledby'] = `${sharedProps.id} ${infoId} ${infoLinkLabelFromContext}`;\n }\n\n const renderedExternalIconAriaLabel = i18n('externalIconAriaLabel', externalIconAriaLabel);\n const content = (\n <>\n {children}\n {external && (\n <span className={styles['icon-wrapper']}>\n &nbsp;\n <span\n className={styles.icon}\n aria-label={renderedExternalIconAriaLabel}\n role={renderedExternalIconAriaLabel ? 'img' : undefined}\n >\n <InternalIcon name=\"external\" size=\"inherit\" />\n </span>\n </span>\n )}\n {variant === 'info' && (\n <span hidden={true} id={infoId}>\n :\n </span>\n )}\n </>\n );\n\n const { tabIndex } = useSingleTabStopNavigation(linkRef, { tabIndex: isButton ? 0 : undefined });\n\n if (isButton) {\n return (\n <a\n {...sharedProps}\n role=\"button\"\n tabIndex={tabIndex}\n onKeyDown={handleButtonKeyDown}\n onClick={handleButtonClick}\n >\n {content}\n </a>\n );\n }\n\n return (\n // we dynamically set proper rel in the code above\n // eslint-disable-next-line react/jsx-no-target-blank\n <a\n {...sharedProps}\n tabIndex={tabIndex}\n target={anchorTarget}\n rel={anchorRel}\n href={href}\n onClick={handleLinkClick}\n >\n {content}\n </a>\n );\n }\n);\n\nfunction getVariantStyle(variant: Exclude<InternalLinkProps['variant'], undefined>) {\n return `variant-${variant.replace(/^awsui-/, '')}`;\n}\n\nfunction getFontSizeStyle(variant: InternalLinkProps['variant'], fontSize: InternalLinkProps['fontSize']) {\n switch (variant) {\n case 'info':\n return 'font-size-body-s';\n case 'awsui-value-large':\n return 'font-size-display-l';\n default:\n return `font-size-${fontSize}`;\n }\n}\n\nfunction getColorStyle(variant: InternalLinkProps['variant'], color: InternalLinkProps['color']) {\n return `color-${variant === 'info' ? 'normal' : color}`;\n}\n\nexport default InternalLink;\n"]}
1
+ {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/link/internal.tsx"],"names":[],"mappings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AED,OAAO;IACL,kDAAkD;IAClD,qDAAqD;IACrD,2CACM,WAAW,IACf,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,YAAY,EACpB,GAAG,EAAE,SAAS,EACd,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,eAAe,KAEvB,OAAO,CACN,CACL,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,SAAS,eAAe,CAAC,OAAyD;IAChF,OAAO,WAAW,OAAO,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,EAAE,CAAC;AACrD,CAAC;AAED,SAAS,gBAAgB,CAAC,OAAqC,EAAE,QAAuC;IACtG,QAAQ,OAAO,EAAE;QACf,KAAK,MAAM;YACT,OAAO,kBAAkB,CAAC;QAC5B,KAAK,mBAAmB;YACtB,OAAO,qBAAqB,CAAC;QAC/B;YACE,OAAO,aAAa,QAAQ,EAAE,CAAC;KAClC;AACH,CAAC;AAED,SAAS,aAAa,CAAC,OAAqC,EAAE,KAAiC;IAC7F,OAAO,SAAS,OAAO,KAAK,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;AAC1D,CAAC;AAED,eAAe,YAAY,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useContext, useRef } from 'react';\nimport clsx from 'clsx';\nimport InternalIcon from '../icon/internal';\nimport styles from './styles.css.js';\nimport { getBaseProps } from '../internal/base-component';\nimport { fireCancelableEvent, isPlainLeftClick } from '../internal/events';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport { KeyCode } from '../internal/keycode';\nimport { LinkProps } from './interfaces';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { checkSafeUrl } from '../internal/utils/check-safe-url';\nimport { useInternalI18n } from '../i18n/context';\nimport { InfoLinkLabelContext } from '../internal/context/info-link-label-context';\nimport { useFunnel, useFunnelStep, useFunnelSubStep } from '../internal/analytics/hooks/use-funnel';\n\nimport { FunnelMetrics } from '../internal/analytics';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport {\n DATA_ATTR_FUNNEL_VALUE,\n getFunnelValueSelector,\n getNameFromSelector,\n getSubStepAllSelector,\n} from '../internal/analytics/selectors';\nimport { LinkDefaultVariantContext } from '../internal/context/link-default-variant-context';\nimport { useSingleTabStopNavigation } from '../internal/context/single-tab-stop-navigation-context';\n\ntype InternalLinkProps = InternalBaseComponentProps<HTMLAnchorElement> &\n Omit<LinkProps, 'variant'> & {\n variant?: LinkProps['variant'] | 'top-navigation' | 'link' | 'recovery';\n };\n\nconst InternalLink = React.forwardRef(\n (\n {\n variant: providedVariant,\n fontSize = 'body-m',\n color = 'normal',\n external = false,\n target,\n href,\n rel,\n ariaLabel,\n externalIconAriaLabel,\n onFollow,\n children,\n __internalRootRef = null,\n ...props\n }: InternalLinkProps,\n ref: React.Ref<LinkProps.Ref>\n ) => {\n checkSafeUrl('Link', href);\n const isButton = !href;\n const { defaultVariant } = useContext(LinkDefaultVariantContext);\n const variant = providedVariant || defaultVariant;\n const specialStyles = ['top-navigation', 'link', 'recovery'];\n const hasSpecialStyle = specialStyles.indexOf(variant) > -1;\n\n const i18n = useInternalI18n('link');\n const baseProps = getBaseProps(props);\n const anchorTarget = target ?? (external ? '_blank' : undefined);\n const anchorRel = rel ?? (anchorTarget === '_blank' ? 'noopener noreferrer' : undefined);\n const uniqueId = useUniqueId('link');\n const linkId = useUniqueId('link-self');\n const infoId = useUniqueId('link-info');\n\n const infoLinkLabelFromContext = useContext(InfoLinkLabelContext);\n\n const { funnelIdentifier, funnelInteractionId } = useFunnel();\n const { stepIdentifier, stepNumber, stepNameSelector } = useFunnelStep();\n const { subStepIdentifier, subStepSelector, subStepNameSelector } = useFunnelSubStep();\n\n const fireFunnelEvent = (funnelInteractionId: string) => {\n if (variant === 'info') {\n const stepName = getNameFromSelector(stepNameSelector);\n const subStepName = getNameFromSelector(subStepNameSelector);\n\n FunnelMetrics.helpPanelInteracted({\n funnelIdentifier,\n funnelInteractionId,\n stepIdentifier,\n stepNumber,\n stepName,\n subStepIdentifier,\n stepNameSelector,\n subStepSelector,\n subStepName,\n subStepNameSelector,\n elementSelector: getFunnelValueSelector(uniqueId),\n subStepAllSelector: getSubStepAllSelector(),\n });\n } else if (external) {\n const stepName = getNameFromSelector(stepNameSelector);\n const subStepName = getNameFromSelector(subStepNameSelector);\n\n FunnelMetrics.externalLinkInteracted({\n funnelIdentifier,\n funnelInteractionId,\n stepIdentifier,\n stepNumber,\n stepName,\n stepNameSelector,\n subStepIdentifier,\n subStepSelector,\n subStepName,\n subStepNameSelector,\n elementSelector: getFunnelValueSelector(uniqueId),\n subStepAllSelector: getSubStepAllSelector(),\n });\n }\n };\n\n const fireFollowEvent = (event: React.SyntheticEvent) => {\n if (funnelInteractionId) {\n fireFunnelEvent(funnelInteractionId);\n }\n\n fireCancelableEvent(onFollow, { href, external, target: anchorTarget }, event);\n };\n\n const handleLinkClick = (event: React.MouseEvent) => {\n if (isPlainLeftClick(event)) {\n fireFollowEvent(event);\n }\n };\n\n const handleButtonClick = (event: React.MouseEvent) => {\n fireFollowEvent(event);\n };\n\n const handleButtonKeyDown = (event: React.KeyboardEvent) => {\n if (event.keyCode === KeyCode.space || event.keyCode === KeyCode.enter) {\n event.preventDefault();\n fireFollowEvent(event);\n }\n };\n\n const linkRef = useRef<HTMLElement>(null);\n const isVisualRefresh = useVisualRefresh();\n useForwardFocus(ref, linkRef);\n\n // Visual refresh should only add styles to buttons that don't already have unique styles (e.g. primary/secondary variants)\n const applyButtonStyles = isButton && isVisualRefresh && !hasSpecialStyle;\n\n const sharedProps = {\n id: linkId,\n ...baseProps,\n // https://github.com/microsoft/TypeScript/issues/36659\n ref: useMergeRefs(linkRef, __internalRootRef),\n className: clsx(\n styles.link,\n baseProps.className,\n applyButtonStyles ? styles.button : null,\n styles[getVariantStyle(variant)],\n styles[getFontSizeStyle(variant, fontSize)],\n styles[getColorStyle(variant, color)]\n ),\n 'aria-label': ariaLabel,\n 'aria-labelledby': '',\n [DATA_ATTR_FUNNEL_VALUE]: uniqueId,\n };\n\n if (variant === 'info' && infoLinkLabelFromContext && !ariaLabel) {\n sharedProps['aria-labelledby'] = `${sharedProps.id} ${infoId} ${infoLinkLabelFromContext}`;\n }\n\n const renderedExternalIconAriaLabel = i18n('externalIconAriaLabel', externalIconAriaLabel);\n const content = (\n <>\n {children}\n {external && (\n <span className={styles['icon-wrapper']}>\n &nbsp;\n <span\n className={styles.icon}\n aria-label={renderedExternalIconAriaLabel}\n role={renderedExternalIconAriaLabel ? 'img' : undefined}\n >\n <InternalIcon name=\"external\" size=\"inherit\" />\n </span>\n </span>\n )}\n {variant === 'info' && (\n <span hidden={true} id={infoId}>\n :\n </span>\n )}\n </>\n );\n\n const { tabIndex } = useSingleTabStopNavigation(linkRef, { tabIndex: isButton ? 0 : undefined });\n\n if (isButton) {\n return (\n <a\n {...sharedProps}\n role=\"button\"\n tabIndex={tabIndex}\n onKeyDown={handleButtonKeyDown}\n onClick={handleButtonClick}\n >\n {content}\n </a>\n );\n }\n\n return (\n // we dynamically set proper rel in the code above\n // eslint-disable-next-line react/jsx-no-target-blank\n <a\n {...sharedProps}\n tabIndex={tabIndex}\n target={anchorTarget}\n rel={anchorRel}\n href={href}\n onClick={handleLinkClick}\n >\n {content}\n </a>\n );\n }\n);\n\nfunction getVariantStyle(variant: Exclude<InternalLinkProps['variant'], undefined>) {\n return `variant-${variant.replace(/^awsui-/, '')}`;\n}\n\nfunction getFontSizeStyle(variant: InternalLinkProps['variant'], fontSize: InternalLinkProps['fontSize']) {\n switch (variant) {\n case 'info':\n return 'font-size-body-s';\n case 'awsui-value-large':\n return 'font-size-display-l';\n default:\n return `font-size-${fontSize}`;\n }\n}\n\nfunction getColorStyle(variant: InternalLinkProps['variant'], color: InternalLinkProps['color']) {\n return `color-${variant === 'info' ? 'normal' : color}`;\n}\n\nexport default InternalLink;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"body-scroll.d.ts","sourceRoot":"","sources":["../../../src/modal/body-scroll.ts"],"names":[],"mappings":"AAOA,wBAAgB,oBAAoB,SAGnC;AAED,wBAAgB,mBAAmB,SAGlC"}
1
+ {"version":3,"file":"body-scroll.d.ts","sourceRoot":"","sources":["../../../src/modal/body-scroll.ts"],"names":[],"mappings":"AAaA,wBAAgB,oBAAoB,SAGnC;AAED,wBAAgB,mBAAmB,SAGlC"}
@@ -2,6 +2,11 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import styles from './styles.css.js';
4
4
  import { browserScrollbarSize } from '../internal/utils/browser-scrollbar-size';
5
+ // Read this before making changes to the code below.
6
+ //
7
+ // When a modal is used from an iframe the body scrolling utils take no effect because they need to be applied to another document.
8
+ // The customers replicate this behavior by running the same code on the correct document instance, see AWSUI-41915.
9
+ // Hence, we should avoid making changes to the component that break the body scrolling logic in its current form.
5
10
  let initialBodyPaddingRightStyle = undefined;
6
11
  export function disableBodyScrolling() {
7
12
  setBodyScrollbarPadding();
@@ -1 +1 @@
1
- {"version":3,"file":"body-scroll.js","sourceRoot":"","sources":["../../../src/modal/body-scroll.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAEhF,IAAI,4BAA4B,GAAuB,SAAS,CAAC;AAEjE,MAAM,UAAU,oBAAoB;IAClC,uBAAuB,EAAE,CAAC;IAC1B,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC;AACpD,CAAC;AAED,MAAM,UAAU,mBAAmB;IACjC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC;IACrD,2BAA2B,EAAE,CAAC;AAChC,CAAC;AAED,SAAS,uBAAuB;IAC9B,IAAI,gBAAgB,EAAE,EAAE;QACtB,4BAA4B,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC;QAChE,MAAM,uBAAuB,GAAG,8BAA8B,EAAE,CAAC;QACjE,MAAM,cAAc,GAAG,oBAAoB,EAAE,CAAC,KAAK,CAAC;QACpD,MAAM,mBAAmB,GAAG,uBAAuB,GAAG,cAAc,CAAC;QACrE,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,GAAG,mBAAmB,GAAG,IAAI,CAAC;KAC/D;AACH,CAAC;AAED,SAAS,8BAA8B;IACrC,OAAO,QAAQ,CAAC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;AAC3E,CAAC;AAED,SAAS,2BAA2B;IAClC,IAAI,4BAA4B,EAAE;QAChC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,eAAe,EAAE,4BAA4B,CAAC,CAAC;KAChF;SAAM;QACL,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;KACrD;IACD,4BAA4B,GAAG,SAAS,CAAC;AAC3C,CAAC;AAED,SAAS,gBAAgB;IACvB,4FAA4F;IAC5F,gGAAgG;IAChG,YAAY;IACZ,OAAO,QAAQ,CAAC,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC;AACvD,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport styles from './styles.css.js';\nimport { browserScrollbarSize } from '../internal/utils/browser-scrollbar-size';\n\nlet initialBodyPaddingRightStyle: string | undefined = undefined;\n\nexport function disableBodyScrolling() {\n setBodyScrollbarPadding();\n document.body.classList.add(styles['modal-open']);\n}\n\nexport function enableBodyScrolling() {\n document.body.classList.remove(styles['modal-open']);\n restoreBodyScrollbarPadding();\n}\n\nfunction setBodyScrollbarPadding() {\n if (bodyHasScrollbar()) {\n initialBodyPaddingRightStyle = document.body.style.paddingRight;\n const initialBodyPaddingRight = computedBodyPaddingRightPixels();\n const scrollbarWidth = browserScrollbarSize().width;\n const newBodyPaddingRight = initialBodyPaddingRight + scrollbarWidth;\n document.body.style.paddingRight = newBodyPaddingRight + 'px';\n }\n}\n\nfunction computedBodyPaddingRightPixels() {\n return parseInt(window.getComputedStyle(document.body).paddingRight, 10);\n}\n\nfunction restoreBodyScrollbarPadding() {\n if (initialBodyPaddingRightStyle) {\n document.body.style.setProperty('padding-right', initialBodyPaddingRightStyle);\n } else {\n document.body.style.removeProperty('padding-right');\n }\n initialBodyPaddingRightStyle = undefined;\n}\n\nfunction bodyHasScrollbar() {\n // Unfortunately this difference doesn't appear to match the scrollbar width during testing,\n // otherwise we could remove browserScrollbarSize(). Bootstrap also doesn't use this difference\n // directly.\n return document.body.clientWidth < window.innerWidth;\n}\n"]}
1
+ {"version":3,"file":"body-scroll.js","sourceRoot":"","sources":["../../../src/modal/body-scroll.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAEhF,qDAAqD;AACrD,EAAE;AACF,mIAAmI;AACnI,oHAAoH;AACpH,kHAAkH;AAElH,IAAI,4BAA4B,GAAuB,SAAS,CAAC;AAEjE,MAAM,UAAU,oBAAoB;IAClC,uBAAuB,EAAE,CAAC;IAC1B,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC;AACpD,CAAC;AAED,MAAM,UAAU,mBAAmB;IACjC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC;IACrD,2BAA2B,EAAE,CAAC;AAChC,CAAC;AAED,SAAS,uBAAuB;IAC9B,IAAI,gBAAgB,EAAE,EAAE;QACtB,4BAA4B,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC;QAChE,MAAM,uBAAuB,GAAG,8BAA8B,EAAE,CAAC;QACjE,MAAM,cAAc,GAAG,oBAAoB,EAAE,CAAC,KAAK,CAAC;QACpD,MAAM,mBAAmB,GAAG,uBAAuB,GAAG,cAAc,CAAC;QACrE,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,GAAG,mBAAmB,GAAG,IAAI,CAAC;KAC/D;AACH,CAAC;AAED,SAAS,8BAA8B;IACrC,OAAO,QAAQ,CAAC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;AAC3E,CAAC;AAED,SAAS,2BAA2B;IAClC,IAAI,4BAA4B,EAAE;QAChC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,eAAe,EAAE,4BAA4B,CAAC,CAAC;KAChF;SAAM;QACL,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;KACrD;IACD,4BAA4B,GAAG,SAAS,CAAC;AAC3C,CAAC;AAED,SAAS,gBAAgB;IACvB,4FAA4F;IAC5F,gGAAgG;IAChG,YAAY;IACZ,OAAO,QAAQ,CAAC,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC;AACvD,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport styles from './styles.css.js';\nimport { browserScrollbarSize } from '../internal/utils/browser-scrollbar-size';\n\n// Read this before making changes to the code below.\n//\n// When a modal is used from an iframe the body scrolling utils take no effect because they need to be applied to another document.\n// The customers replicate this behavior by running the same code on the correct document instance, see AWSUI-41915.\n// Hence, we should avoid making changes to the component that break the body scrolling logic in its current form.\n\nlet initialBodyPaddingRightStyle: string | undefined = undefined;\n\nexport function disableBodyScrolling() {\n setBodyScrollbarPadding();\n document.body.classList.add(styles['modal-open']);\n}\n\nexport function enableBodyScrolling() {\n document.body.classList.remove(styles['modal-open']);\n restoreBodyScrollbarPadding();\n}\n\nfunction setBodyScrollbarPadding() {\n if (bodyHasScrollbar()) {\n initialBodyPaddingRightStyle = document.body.style.paddingRight;\n const initialBodyPaddingRight = computedBodyPaddingRightPixels();\n const scrollbarWidth = browserScrollbarSize().width;\n const newBodyPaddingRight = initialBodyPaddingRight + scrollbarWidth;\n document.body.style.paddingRight = newBodyPaddingRight + 'px';\n }\n}\n\nfunction computedBodyPaddingRightPixels() {\n return parseInt(window.getComputedStyle(document.body).paddingRight, 10);\n}\n\nfunction restoreBodyScrollbarPadding() {\n if (initialBodyPaddingRightStyle) {\n document.body.style.setProperty('padding-right', initialBodyPaddingRightStyle);\n } else {\n document.body.style.removeProperty('padding-right');\n }\n initialBodyPaddingRightStyle = undefined;\n}\n\nfunction bodyHasScrollbar() {\n // Unfortunately this difference doesn't appear to match the scrollbar width during testing,\n // otherwise we could remove browserScrollbarSize(). Bootstrap also doesn't use this difference\n // directly.\n return document.body.clientWidth < window.innerWidth;\n}\n"]}