@cloudscape-design/components-themeable 3.0.654 → 3.0.656

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 (175) hide show
  1. package/lib/internal/manifest.json +1 -1
  2. package/lib/internal/scss/app-layout/drawer/styles.scss +10 -0
  3. package/lib/internal/scss/button/styles.scss +0 -1
  4. package/lib/internal/scss/container/styles.scss +26 -20
  5. package/lib/internal/scss/form/styles.scss +1 -1
  6. package/lib/internal/scss/grid/styles.scss +0 -3
  7. package/lib/internal/scss/header/styles.scss +0 -5
  8. package/lib/internal/scss/input/styles.scss +0 -6
  9. package/lib/internal/scss/internal/components/autosuggest-input/styles.scss +0 -1
  10. package/lib/internal/scss/internal/components/dropdown/styles.scss +0 -6
  11. package/lib/internal/scss/internal/components/panel-resize-handle/styles.scss +50 -0
  12. package/lib/internal/scss/link/constants.scss +0 -1
  13. package/lib/internal/scss/popover/styles.scss +0 -6
  14. package/lib/internal/scss/segmented-control/styles.scss +0 -2
  15. package/lib/internal/scss/split-panel/styles.scss +1 -59
  16. package/lib/internal/scss/split-panel/test-classes/styles.scss +15 -0
  17. package/lib/internal/scss/tiles/styles.scss +1 -5
  18. package/lib/internal/template/app-layout/drawer/index.js +1 -1
  19. package/lib/internal/template/app-layout/drawer/index.js.map +1 -1
  20. package/lib/internal/template/app-layout/drawer/resizable-drawer.d.ts.map +1 -1
  21. package/lib/internal/template/app-layout/drawer/resizable-drawer.js +2 -5
  22. package/lib/internal/template/app-layout/drawer/resizable-drawer.js.map +1 -1
  23. package/lib/internal/template/app-layout/drawer/styles.css.js +13 -12
  24. package/lib/internal/template/app-layout/drawer/styles.scoped.css +30 -20
  25. package/lib/internal/template/app-layout/drawer/styles.selectors.js +13 -12
  26. package/lib/internal/template/app-layout/utils/use-resize.d.ts.map +1 -1
  27. package/lib/internal/template/app-layout/utils/use-resize.js +3 -7
  28. package/lib/internal/template/app-layout/utils/use-resize.js.map +1 -1
  29. package/lib/internal/template/app-layout/visual-refresh/drawers.js +3 -3
  30. package/lib/internal/template/app-layout/visual-refresh/drawers.js.map +1 -1
  31. package/lib/internal/template/app-layout/visual-refresh/split-panel.d.ts.map +1 -1
  32. package/lib/internal/template/app-layout/visual-refresh/split-panel.js +1 -3
  33. package/lib/internal/template/app-layout/visual-refresh/split-panel.js.map +1 -1
  34. package/lib/internal/template/app-layout/visual-refresh/tools.js +2 -2
  35. package/lib/internal/template/app-layout/visual-refresh/tools.js.map +1 -1
  36. package/lib/internal/template/autosuggest/plain-list.d.ts.map +1 -1
  37. package/lib/internal/template/autosuggest/plain-list.js +1 -3
  38. package/lib/internal/template/autosuggest/plain-list.js.map +1 -1
  39. package/lib/internal/template/autosuggest/virtual-list.d.ts.map +1 -1
  40. package/lib/internal/template/autosuggest/virtual-list.js +1 -3
  41. package/lib/internal/template/autosuggest/virtual-list.js.map +1 -1
  42. package/lib/internal/template/calendar/utils/intl.d.ts.map +1 -1
  43. package/lib/internal/template/calendar/utils/intl.js +0 -3
  44. package/lib/internal/template/calendar/utils/intl.js.map +1 -1
  45. package/lib/internal/template/container/internal.d.ts.map +1 -1
  46. package/lib/internal/template/container/internal.js +3 -0
  47. package/lib/internal/template/container/internal.js.map +1 -1
  48. package/lib/internal/template/container/styles.css.js +29 -28
  49. package/lib/internal/template/container/styles.scoped.css +55 -52
  50. package/lib/internal/template/container/styles.selectors.js +29 -28
  51. package/lib/internal/template/date-range-picker/calendar/grids/index.d.ts.map +1 -1
  52. package/lib/internal/template/date-range-picker/calendar/grids/index.js +0 -8
  53. package/lib/internal/template/date-range-picker/calendar/grids/index.js.map +1 -1
  54. package/lib/internal/template/form/interfaces.d.ts +3 -8
  55. package/lib/internal/template/form/interfaces.d.ts.map +1 -1
  56. package/lib/internal/template/form/interfaces.js.map +1 -1
  57. package/lib/internal/template/form/internal.d.ts +1 -1
  58. package/lib/internal/template/form/internal.d.ts.map +1 -1
  59. package/lib/internal/template/form/internal.js +14 -20
  60. package/lib/internal/template/form/internal.js.map +1 -1
  61. package/lib/internal/template/form/styles.css.js +8 -9
  62. package/lib/internal/template/form/styles.scoped.css +8 -8
  63. package/lib/internal/template/form/styles.selectors.js +8 -9
  64. package/lib/internal/template/header/internal.d.ts.map +1 -1
  65. package/lib/internal/template/header/internal.js +1 -3
  66. package/lib/internal/template/header/internal.js.map +1 -1
  67. package/lib/internal/template/header/styles.css.js +34 -35
  68. package/lib/internal/template/header/styles.scoped.css +50 -53
  69. package/lib/internal/template/header/styles.selectors.js +34 -35
  70. package/lib/internal/template/input/styles.css.js +13 -13
  71. package/lib/internal/template/input/styles.scoped.css +32 -35
  72. package/lib/internal/template/input/styles.selectors.js +13 -13
  73. package/lib/internal/template/internal/components/chart-plot/application-controller.js +3 -13
  74. package/lib/internal/template/internal/components/chart-plot/application-controller.js.map +1 -1
  75. package/lib/internal/template/internal/components/dropdown/index.d.ts.map +1 -1
  76. package/lib/internal/template/internal/components/dropdown/index.js +0 -2
  77. package/lib/internal/template/internal/components/dropdown/index.js.map +1 -1
  78. package/lib/internal/template/internal/components/dropdown/styles.css.js +20 -20
  79. package/lib/internal/template/internal/components/dropdown/styles.scoped.css +39 -45
  80. package/lib/internal/template/internal/components/dropdown/styles.selectors.js +20 -20
  81. package/lib/internal/template/internal/components/panel-resize-handle/icon.d.ts +5 -0
  82. package/lib/internal/template/internal/components/panel-resize-handle/icon.d.ts.map +1 -0
  83. package/lib/internal/template/internal/components/panel-resize-handle/icon.js +9 -0
  84. package/lib/internal/template/internal/components/panel-resize-handle/icon.js.map +1 -0
  85. package/lib/internal/template/internal/components/panel-resize-handle/index.d.ts +12 -0
  86. package/lib/internal/template/internal/components/panel-resize-handle/index.d.ts.map +1 -0
  87. package/lib/internal/template/internal/components/panel-resize-handle/index.js +11 -0
  88. package/lib/internal/template/internal/components/panel-resize-handle/index.js.map +1 -0
  89. package/lib/internal/template/internal/components/panel-resize-handle/styles.css.js +10 -0
  90. package/lib/internal/template/internal/components/panel-resize-handle/styles.scoped.css +153 -0
  91. package/lib/internal/template/internal/components/panel-resize-handle/styles.selectors.js +11 -0
  92. package/lib/internal/template/internal/context/single-tab-stop-navigation-context.js +2 -2
  93. package/lib/internal/template/internal/context/single-tab-stop-navigation-context.js.map +1 -1
  94. package/lib/internal/template/internal/environment.js +1 -1
  95. package/lib/internal/template/internal/environment.json +1 -1
  96. package/lib/internal/template/internal/utils/content-header-utils.d.ts +0 -2
  97. package/lib/internal/template/internal/utils/content-header-utils.d.ts.map +1 -1
  98. package/lib/internal/template/internal/utils/content-header-utils.js +0 -3
  99. package/lib/internal/template/internal/utils/content-header-utils.js.map +1 -1
  100. package/lib/internal/template/internal/utils/dom.d.ts.map +1 -1
  101. package/lib/internal/template/internal/utils/dom.js +7 -27
  102. package/lib/internal/template/internal/utils/dom.js.map +1 -1
  103. package/lib/internal/template/internal/utils/global-flags.d.ts +0 -1
  104. package/lib/internal/template/internal/utils/global-flags.d.ts.map +1 -1
  105. package/lib/internal/template/internal/utils/global-flags.js.map +1 -1
  106. package/lib/internal/template/link/interfaces.d.ts +6 -1
  107. package/lib/internal/template/link/interfaces.d.ts.map +1 -1
  108. package/lib/internal/template/link/interfaces.js.map +1 -1
  109. package/lib/internal/template/link/internal.d.ts.map +1 -1
  110. package/lib/internal/template/link/internal.js +12 -2
  111. package/lib/internal/template/link/internal.js.map +1 -1
  112. package/lib/internal/template/pie-chart/labels.d.ts.map +1 -1
  113. package/lib/internal/template/pie-chart/labels.js +1 -4
  114. package/lib/internal/template/pie-chart/labels.js.map +1 -1
  115. package/lib/internal/template/pie-chart/pie-chart.d.ts.map +1 -1
  116. package/lib/internal/template/pie-chart/pie-chart.js +0 -3
  117. package/lib/internal/template/pie-chart/pie-chart.js.map +1 -1
  118. package/lib/internal/template/pie-chart/utils.d.ts.map +1 -1
  119. package/lib/internal/template/pie-chart/utils.js +0 -4
  120. package/lib/internal/template/pie-chart/utils.js.map +1 -1
  121. package/lib/internal/template/popover/internal.js +3 -6
  122. package/lib/internal/template/popover/internal.js.map +1 -1
  123. package/lib/internal/template/popover/styles.css.js +49 -50
  124. package/lib/internal/template/popover/styles.scoped.css +66 -69
  125. package/lib/internal/template/popover/styles.selectors.js +49 -50
  126. package/lib/internal/template/segmented-control/styles.css.js +14 -14
  127. package/lib/internal/template/segmented-control/styles.scoped.css +33 -33
  128. package/lib/internal/template/segmented-control/styles.selectors.js +14 -14
  129. package/lib/internal/template/split-panel/bottom.d.ts.map +1 -1
  130. package/lib/internal/template/split-panel/bottom.js +4 -2
  131. package/lib/internal/template/split-panel/bottom.js.map +1 -1
  132. package/lib/internal/template/split-panel/icons/bottom-icon.js +1 -1
  133. package/lib/internal/template/split-panel/icons/bottom-icon.js.map +1 -1
  134. package/lib/internal/template/split-panel/icons/side-position-refresh.js +1 -1
  135. package/lib/internal/template/split-panel/icons/side-position-refresh.js.map +1 -1
  136. package/lib/internal/template/split-panel/icons/side-position.js +1 -1
  137. package/lib/internal/template/split-panel/icons/side-position.js.map +1 -1
  138. package/lib/internal/template/split-panel/icons/styles.css.js +27 -0
  139. package/lib/internal/template/split-panel/icons/styles.scoped.css +168 -0
  140. package/lib/internal/template/split-panel/icons/styles.selectors.js +28 -0
  141. package/lib/internal/template/split-panel/implementation.d.ts.map +1 -1
  142. package/lib/internal/template/split-panel/implementation.js +12 -8
  143. package/lib/internal/template/split-panel/implementation.js.map +1 -1
  144. package/lib/internal/template/split-panel/side.d.ts.map +1 -1
  145. package/lib/internal/template/split-panel/side.js +5 -3
  146. package/lib/internal/template/split-panel/side.js.map +1 -1
  147. package/lib/internal/template/split-panel/styles.css.js +26 -57
  148. package/lib/internal/template/split-panel/styles.scoped.css +41 -281
  149. package/lib/internal/template/split-panel/styles.selectors.js +26 -57
  150. package/lib/internal/template/split-panel/test-classes/styles.css.js +13 -0
  151. package/lib/internal/template/split-panel/test-classes/styles.scoped.css +14 -0
  152. package/lib/internal/template/split-panel/test-classes/styles.selectors.js +14 -0
  153. package/lib/internal/template/table/selection/selection-control.d.ts.map +1 -1
  154. package/lib/internal/template/table/selection/selection-control.js.map +1 -1
  155. package/lib/internal/template/table/table-role/utils.d.ts.map +1 -1
  156. package/lib/internal/template/table/table-role/utils.js +6 -1
  157. package/lib/internal/template/table/table-role/utils.js.map +1 -1
  158. package/lib/internal/template/test-utils/dom/app-layout/index.js +1 -1
  159. package/lib/internal/template/test-utils/dom/app-layout/index.js.map +1 -1
  160. package/lib/internal/template/test-utils/dom/split-panel/index.js +3 -3
  161. package/lib/internal/template/test-utils/dom/split-panel/index.js.map +1 -1
  162. package/lib/internal/template/test-utils/selectors/app-layout/index.js +1 -1
  163. package/lib/internal/template/test-utils/selectors/app-layout/index.js.map +1 -1
  164. package/lib/internal/template/test-utils/selectors/split-panel/index.js +3 -3
  165. package/lib/internal/template/test-utils/selectors/split-panel/index.js.map +1 -1
  166. package/lib/internal/template/test-utils/tsconfig.tsbuildinfo +1 -1
  167. package/lib/internal/template/tiles/styles.css.js +29 -29
  168. package/lib/internal/template/tiles/styles.scoped.css +82 -95
  169. package/lib/internal/template/tiles/styles.selectors.js +29 -29
  170. package/package.json +1 -1
  171. package/lib/internal/template/split-panel/icons/resize-handler.d.ts +0 -6
  172. package/lib/internal/template/split-panel/icons/resize-handler.d.ts.map +0 -1
  173. package/lib/internal/template/split-panel/icons/resize-handler.js +0 -8
  174. package/lib/internal/template/split-panel/icons/resize-handler.js.map +0 -1
  175. /package/lib/internal/scss/split-panel/icons/{icons-styles.scss → styles.scss} +0 -0
@@ -48,14 +48,14 @@ function ApplicationController({ activeElementKey, activeElementRef, onFocus, on
48
48
  // Focuses application but before copies aria-attributes from the target.
49
49
  function focusApplication(app, target) {
50
50
  // Remove prev attributes.
51
- for (const attributeName of getAttributeNames(app)) {
51
+ for (const attributeName of app.getAttributeNames()) {
52
52
  if (attributeName === 'role' || attributeName.slice(0, 4) === 'aria') {
53
53
  app.removeAttribute(attributeName);
54
54
  }
55
55
  }
56
56
  // Copy new attributes.
57
57
  if (target) {
58
- for (const attributeName of getAttributeNames(target)) {
58
+ for (const attributeName of target.getAttributeNames()) {
59
59
  if (attributeName === 'role' || attributeName.slice(0, 4) === 'aria') {
60
60
  const attributeValue = target.getAttribute(attributeName);
61
61
  attributeValue && app.setAttribute(attributeName, attributeValue);
@@ -72,7 +72,7 @@ function focusApplication(app, target) {
72
72
  // The application is to be only focused programmatically.
73
73
  function muteApplication(app) {
74
74
  // Remove prev attributes.
75
- for (const attributeName of getAttributeNames(app)) {
75
+ for (const attributeName of app.getAttributeNames()) {
76
76
  if (attributeName === 'role' || attributeName.slice(0, 4) === 'aria') {
77
77
  app.removeAttribute(attributeName);
78
78
  }
@@ -82,14 +82,4 @@ function muteApplication(app) {
82
82
  app.setAttribute('focusable', 'false');
83
83
  app.setAttribute('aria-hidden', 'true');
84
84
  }
85
- // Polyfill for element.getAttributeNames(), IE11
86
- // https://developer.mozilla.org/en-US/docs/Web/API/Element/getAttributeNames#polyfill
87
- function getAttributeNames(element) {
88
- const attributes = element.attributes;
89
- const result = new Array(attributes.length);
90
- for (let i = 0; i < attributes.length; i++) {
91
- result[i] = attributes[i].name;
92
- }
93
- return result;
94
- }
95
85
  //# sourceMappingURL=application-controller.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"application-controller.js","sourceRoot":"","sources":["../../../../../src/internal/components/chart-plot/application-controller.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzG,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAcrC,eAAe,UAAU,CAAC,qBAAqB,CAAC,CAAC;AAEjD,SAAS,qBAAqB,CAC5B,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAA8B,EAC9F,GAA8B;IAE9B,MAAM,YAAY,GAAG,MAAM,CAAc,IAAI,CAAC,CAAC;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AC,IAAI,CAAC;KAChC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { forwardRef, useCallback, useEffect, useImperativeHandle, useRef, useState } from 'react';\nimport styles from './styles.css.js';\n\nexport interface ApplicationRef {\n focus(): void;\n}\n\nexport interface ApplicationControllerProps {\n activeElementKey: null | string | number | boolean;\n activeElementRef?: React.RefObject<SVGGElement>;\n onFocus?: (event: React.FocusEvent<SVGGElement>) => void;\n onBlur?: (event: React.FocusEvent<SVGGElement>) => void;\n onKeyDown?: (event: React.KeyboardEvent<SVGGElement>) => void;\n}\n\nexport default forwardRef(ApplicationController);\n\nfunction ApplicationController(\n { activeElementKey, activeElementRef, onFocus, onBlur, onKeyDown }: ApplicationControllerProps,\n ref: React.Ref<ApplicationRef>\n) {\n const containerRef = useRef<SVGGElement>(null);\n const applicationRef = useRef<SVGGElement>(null);\n const focusTransitionRef = useRef(false);\n const [isFocused, setFocused] = useState(false);\n\n // Calls provided onFocus handler when the application obtains focus, ignoring internal focus juggling.\n const onApplicationFocus = useCallback(\n (event: React.FocusEvent<SVGGElement>) => {\n if (focusTransitionRef.current === false) {\n setFocused(true);\n onFocus && onFocus(event);\n } else {\n focusTransitionRef.current = false;\n }\n },\n [onFocus]\n );\n // Calls provided onBlur handler when the application loses focus, ignoring internal focus juggling.\n const onApplicationBlur = useCallback(\n (event: React.FocusEvent<SVGGElement>) => {\n if (focusTransitionRef.current === false) {\n setFocused(false);\n onBlur && onBlur(event);\n // The application controller can only be focused programmatically.\n muteApplication(applicationRef.current!);\n }\n },\n [onBlur]\n );\n const onApplicationKeyDown = onKeyDown;\n\n useImperativeHandle(\n ref,\n () => ({\n focus: () => focusApplication(applicationRef.current!, activeElementRef?.current || null),\n }),\n [activeElementRef]\n );\n\n // Re-attaches and re-focuses the application for screen readers to treat it as an update.\n useEffect(() => {\n // Skip if not focused or if the transition is already happening.\n if (!isFocused || focusTransitionRef.current === true) {\n return;\n }\n focusTransitionRef.current = true;\n containerRef.current!.removeChild(applicationRef.current!);\n containerRef.current!.appendChild(applicationRef.current!);\n focusApplication(applicationRef.current!, activeElementRef?.current || null);\n }, [isFocused, activeElementKey, activeElementRef]);\n\n return (\n <g ref={containerRef}>\n <g\n tabIndex={-1}\n ref={applicationRef}\n onFocus={onApplicationFocus}\n onBlur={onApplicationBlur}\n onKeyDown={onApplicationKeyDown}\n className={styles.application}\n ></g>\n </g>\n );\n}\n\n// Focuses application but before copies aria-attributes from the target.\nfunction focusApplication(app: SVGGElement, target: null | SVGGElement) {\n // Remove prev attributes.\n for (const attributeName of getAttributeNames(app)) {\n if (attributeName === 'role' || attributeName.slice(0, 4) === 'aria') {\n app.removeAttribute(attributeName);\n }\n }\n\n // Copy new attributes.\n if (target) {\n for (const attributeName of getAttributeNames(target)) {\n if (attributeName === 'role' || attributeName.slice(0, 4) === 'aria') {\n const attributeValue = target.getAttribute(attributeName);\n attributeValue && app.setAttribute(attributeName, attributeValue);\n }\n }\n }\n\n // Make app focusable.\n app.tabIndex = 0;\n app.setAttribute('focusable', 'true');\n app.setAttribute('aria-hidden', 'false');\n\n // Focus app.\n app.focus({ preventScroll: true });\n}\n\n// The application is to be only focused programmatically.\nfunction muteApplication(app: SVGGElement) {\n // Remove prev attributes.\n for (const attributeName of getAttributeNames(app)) {\n if (attributeName === 'role' || attributeName.slice(0, 4) === 'aria') {\n app.removeAttribute(attributeName);\n }\n }\n\n // Make app non-focusable.\n app.tabIndex = -1;\n app.setAttribute('focusable', 'false');\n app.setAttribute('aria-hidden', 'true');\n}\n\n// Polyfill for element.getAttributeNames(), IE11\n// https://developer.mozilla.org/en-US/docs/Web/API/Element/getAttributeNames#polyfill\nfunction getAttributeNames(element: Element) {\n const attributes = element.attributes;\n const result = new Array(attributes.length);\n for (let i = 0; i < attributes.length; i++) {\n result[i] = attributes[i].name;\n }\n return result;\n}\n"]}
1
+ {"version":3,"file":"application-controller.js","sourceRoot":"","sources":["../../../../../src/internal/components/chart-plot/application-controller.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzG,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAcrC,eAAe,UAAU,CAAC,qBAAqB,CAAC,CAAC;AAEjD,SAAS,qBAAqB,CAC5B,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAA8B,EAC9F,GAA8B;IAE9B,MAAM,YAAY,GAAG,MAAM,CAAc,IAAI,CAAC,CAAC;IAC/C,MAAM,cAAc,GAAG,MAAM,CAAc,IAAI,CAAC,CAAC;IACjD,MAAM,kBAAkB,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IACzC,MAAM,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEhD,uGAAuG;IACvG,MAAM,kBAAkB,GAAG,WAAW,CACpC,CAAC,KAAoC,EAAE,EAAE;QACvC,IAAI,kBAAkB,CAAC,OAAO,KAAK,KAAK,EAAE;YACxC,UAAU,CAAC,IAAI,CAAC,CAAC;YACjB,OAAO,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC;SAC3B;aAAM;YACL,kBAAkB,CAAC,OAAO,GAAG,KAAK,CAAC;SACpC;IACH,CAAC,EACD,CAAC,OAAO,CAAC,CACV,CAAC;IACF,oGAAoG;IACpG,MAAM,iBAAiB,GAAG,WAAW,CACnC,CAAC,KAAoC,EAAE,EAAE;QACvC,IAAI,kBAAkB,CAAC,OAAO,KAAK,KAAK,EAAE;YACxC,UAAU,CAAC,KAAK,CAAC,CAAC;YAClB,MAAM,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC;YACxB,mEAAmE;YACnE,eAAe,C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AC;IAClB,GAAG,CAAC,YAAY,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IACvC,GAAG,CAAC,YAAY,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;AAC1C,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { forwardRef, useCallback, useEffect, useImperativeHandle, useRef, useState } from 'react';\nimport styles from './styles.css.js';\n\nexport interface ApplicationRef {\n focus(): void;\n}\n\nexport interface ApplicationControllerProps {\n activeElementKey: null | string | number | boolean;\n activeElementRef?: React.RefObject<SVGGElement>;\n onFocus?: (event: React.FocusEvent<SVGGElement>) => void;\n onBlur?: (event: React.FocusEvent<SVGGElement>) => void;\n onKeyDown?: (event: React.KeyboardEvent<SVGGElement>) => void;\n}\n\nexport default forwardRef(ApplicationController);\n\nfunction ApplicationController(\n { activeElementKey, activeElementRef, onFocus, onBlur, onKeyDown }: ApplicationControllerProps,\n ref: React.Ref<ApplicationRef>\n) {\n const containerRef = useRef<SVGGElement>(null);\n const applicationRef = useRef<SVGGElement>(null);\n const focusTransitionRef = useRef(false);\n const [isFocused, setFocused] = useState(false);\n\n // Calls provided onFocus handler when the application obtains focus, ignoring internal focus juggling.\n const onApplicationFocus = useCallback(\n (event: React.FocusEvent<SVGGElement>) => {\n if (focusTransitionRef.current === false) {\n setFocused(true);\n onFocus && onFocus(event);\n } else {\n focusTransitionRef.current = false;\n }\n },\n [onFocus]\n );\n // Calls provided onBlur handler when the application loses focus, ignoring internal focus juggling.\n const onApplicationBlur = useCallback(\n (event: React.FocusEvent<SVGGElement>) => {\n if (focusTransitionRef.current === false) {\n setFocused(false);\n onBlur && onBlur(event);\n // The application controller can only be focused programmatically.\n muteApplication(applicationRef.current!);\n }\n },\n [onBlur]\n );\n const onApplicationKeyDown = onKeyDown;\n\n useImperativeHandle(\n ref,\n () => ({\n focus: () => focusApplication(applicationRef.current!, activeElementRef?.current || null),\n }),\n [activeElementRef]\n );\n\n // Re-attaches and re-focuses the application for screen readers to treat it as an update.\n useEffect(() => {\n // Skip if not focused or if the transition is already happening.\n if (!isFocused || focusTransitionRef.current === true) {\n return;\n }\n focusTransitionRef.current = true;\n containerRef.current!.removeChild(applicationRef.current!);\n containerRef.current!.appendChild(applicationRef.current!);\n focusApplication(applicationRef.current!, activeElementRef?.current || null);\n }, [isFocused, activeElementKey, activeElementRef]);\n\n return (\n <g ref={containerRef}>\n <g\n tabIndex={-1}\n ref={applicationRef}\n onFocus={onApplicationFocus}\n onBlur={onApplicationBlur}\n onKeyDown={onApplicationKeyDown}\n className={styles.application}\n ></g>\n </g>\n );\n}\n\n// Focuses application but before copies aria-attributes from the target.\nfunction focusApplication(app: SVGGElement, target: null | SVGGElement) {\n // Remove prev attributes.\n for (const attributeName of app.getAttributeNames()) {\n if (attributeName === 'role' || attributeName.slice(0, 4) === 'aria') {\n app.removeAttribute(attributeName);\n }\n }\n\n // Copy new attributes.\n if (target) {\n for (const attributeName of target.getAttributeNames()) {\n if (attributeName === 'role' || attributeName.slice(0, 4) === 'aria') {\n const attributeValue = target.getAttribute(attributeName);\n attributeValue && app.setAttribute(attributeName, attributeValue);\n }\n }\n }\n\n // Make app focusable.\n app.tabIndex = 0;\n app.setAttribute('focusable', 'true');\n app.setAttribute('aria-hidden', 'false');\n\n // Focus app.\n app.focus({ preventScroll: true });\n}\n\n// The application is to be only focused programmatically.\nfunction muteApplication(app: SVGGElement) {\n // Remove prev attributes.\n for (const attributeName of app.getAttributeNames()) {\n if (attributeName === 'role' || attributeName.slice(0, 4) === 'aria') {\n app.removeAttribute(attributeName);\n }\n }\n\n // Make app non-focusable.\n app.tabIndex = -1;\n app.setAttribute('focusable', 'false');\n app.setAttribute('aria-hidden', 'true');\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/dropdown/index.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAuI7C,QAAA,MAAM,QAAQ,iXA2BX,aAAa,gBAqTf,CAAC;AAMF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/dropdown/index.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAuI7C,QAAA,MAAM,QAAQ,iXA2BX,aAAa,gBAmTf,CAAC;AAMF,eAAe,QAAQ,CAAC"}
@@ -55,8 +55,6 @@ const Dropdown = ({ children, trigger, open, onDropdownClose, onMouseDown, heade
55
55
  const triggerRef = useRef(null);
56
56
  const dropdownRef = useRef(null);
57
57
  const dropdownContainerRef = useRef(null);
58
- // This container is only needed to apply max-height to. We can't move max-height to it's parent
59
- // because of an IE11 issue with flexbox. https://github.com/philipwalton/flexbugs/issues/216
60
58
  const verticalContainerRef = useRef(null);
61
59
  // To keep track of the initial position (drop up/down) which is kept the same during fixed repositioning
62
60
  const fixedPosition = useRef(null);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/components/dropdown/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAEtD,OAAO,EAGL,iBAAiB,EACjB,uBAAuB,EACvB,yCAAyC,GAC1C,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,UAAU,EAAoB,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,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AE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,gBAAgB,EAAE,gBAAgB,EAClC,yBAAyB,EAAE,yBAAyB,EACpD,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,EACxB,oBAAoB,EAAE,oBAAoB,EAC1C,QAAQ,EAAE,QAAQ,EAClB,EAAE,EAAE,iBAAiB,EACrB,IAAI,EAAE,mBAAmB,EACzB,cAAc,EAAE,cAAc,EAC9B,eAAe,EAAE,eAAe,IAE/B,QAAQ,CACS;gBAEpB,oBAAC,OAAO,IACN,iBAAiB,EAAE,GAAG,EAAE,WAAC,OAAA,UAAU,CAAC,OAAO,KAAI,MAAA,iBAAiB,CAAC,UAAU,CAAC,OAAO,CAAC,0CAAE,KAAK,EAAE,CAAA,CAAA,EAAA,EAC7F,QAAQ,EAAE,CAAC,IAAI,IAAI,CAAC,SAAS,GAC7B,CACE,CACP,CACU,CACK,CAChB,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,CACzB,QAAqD,EACf,EAAE,CAAE,QAAqC,CAAC,aAAa,KAAK,SAAS,CAAC;AAE9G,eAAe,QAAQ,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 clsx from 'clsx';\nimport { useMergeRefs } from '../../hooks/use-merge-refs';\nimport React, { useEffect, useLayoutEffect, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\nimport { fireNonCancelableEvent } from '../../events';\nimport { DropdownProps } from './interfaces';\nimport {\n DropdownPosition,\n InteriorDropdownPosition,\n calculatePosition,\n defaultMaxDropdownWidth,\n hasEnoughSpaceToStretchBeyondTriggerWidth,\n} from './dropdown-fit-handler';\nimport { Transition, TransitionStatus } from '../transition';\nimport { useVisualRefresh } from '../../hooks/use-visual-mode';\nimport { usePortalModeClasses } from '../../hooks/use-portal-mode-classes';\nimport { DropdownContextProvider, DropdownContextProviderProps } from './context';\nimport { useMobile } from '../../hooks/use-mobile';\nimport TabTrap from '../tab-trap/index.js';\nimport { getFirstFocusable, getLastFocusable } from '../focus-lock/utils.js';\nimport { useUniqueId } from '../../hooks/use-unique-id/index.js';\nimport customCssProps from '../../generated/custom-css-properties';\nimport { useResizeObserver } from '@cloudscape-design/component-toolkit/internal';\nimport { nodeBelongs } from '../../utils/node-belongs';\nimport { getLogicalBoundingClientRect } from '@cloudscape-design/component-toolkit/internal';\n\ninterface DropdownContainerProps {\n children?: React.ReactNode;\n renderWithPortal?: boolean;\n id?: string;\n referrerId?: string;\n open?: boolean;\n}\n\nconst DropdownContainer = ({ children, renderWithPortal = false, id, referrerId, open }: DropdownContainerProps) => {\n if (renderWithPortal) {\n if (open) {\n return createPortal(\n <div id={id} data-awsui-referrer-id={referrerId}>\n {children}\n </div>,\n document.body\n );\n } else {\n return null;\n }\n } else {\n return <>{children}</>;\n }\n};\n\ninterface TransitionContentProps {\n state: TransitionStatus;\n transitionRef: React.MutableRefObject<any>;\n dropdownClasses: string;\n stretchWidth: boolean;\n interior: boolean;\n isRefresh: boolean;\n dropdownRef: React.RefObject<HTMLDivElement>;\n verticalContainerRef: React.RefObject<HTMLDivElement>;\n expandToViewport?: boolean;\n stretchBeyondTriggerWidth?: boolean;\n header?: React.ReactNode;\n children?: React.ReactNode;\n footer?: React.ReactNode;\n position?: DropdownContextProviderProps['position'];\n open?: boolean;\n onMouseDown?: React.MouseEventHandler<Element>;\n id?: string;\n role?: string;\n ariaLabelledby?: string;\n ariaDescribedby?: string;\n}\n\nconst TransitionContent = ({\n state,\n transitionRef,\n dropdownClasses,\n stretchWidth,\n interior,\n isRefresh,\n dropdownRef,\n verticalContainerRef,\n expandToViewport,\n stretchBeyondTriggerWidth,\n header,\n children,\n footer,\n position,\n open,\n onMouseDown,\n id,\n role,\n ariaLabelledby,\n ariaDescribedby,\n}: TransitionContentProps) => {\n const contentRef = useMergeRefs(dropdownRef, transitionRef);\n return (\n <div\n className={clsx(styles.dropdown, dropdownClasses, {\n [styles.open]: open,\n [styles['with-limited-width']]: !stretchWidth,\n [styles['hide-block-border']]: stretchWidth,\n [styles.interior]: interior,\n [styles.refresh]: isRefresh,\n [styles['use-portal']]: expandToViewport && !interior,\n [styles['stretch-beyond-trigger-width']]: stretchBeyondTriggerWidth,\n })}\n ref={contentRef}\n id={id}\n role={role}\n aria-labelledby={ariaLabelledby}\n aria-describedby={ariaDescribedby}\n data-open={open}\n data-animating={state !== 'exited'}\n aria-hidden={!open}\n style={\n stretchBeyondTriggerWidth ? { [customCssProps.dropdownDefaultMaxWidth]: `${defaultMaxDropdownWidth}px` } : {}\n }\n onMouseDown={onMouseDown}\n >\n <div\n className={clsx(\n styles['dropdown-content-wrapper'],\n !header && !children && styles['is-empty'],\n isRefresh && styles.refresh\n )}\n >\n <div ref={verticalContainerRef} className={styles['dropdown-content']}>\n <DropdownContextProvider position={position}>\n {header}\n {children}\n {footer}\n </DropdownContextProvider>\n </div>\n </div>\n </div>\n );\n};\n\nconst Dropdown = ({\n children,\n trigger,\n open,\n onDropdownClose,\n onMouseDown,\n header,\n footer,\n dropdownId,\n stretchTriggerHeight = false,\n stretchWidth = true,\n stretchHeight = false,\n stretchToTriggerWidth = true,\n stretchBeyondTriggerWidth = false,\n expandToViewport = false,\n preferCenter = false,\n interior = false,\n minWidth,\n scrollable = true,\n loopFocus = expandToViewport,\n onFocus,\n onBlur,\n contentKey,\n dropdownContentId,\n dropdownContentRole,\n ariaLabelledby,\n ariaDescribedby,\n}: DropdownProps) => {\n const wrapperRef = useRef<HTMLDivElement | null>(null);\n const triggerRef = useRef<HTMLDivElement | null>(null);\n const dropdownRef = useRef<HTMLDivElement | null>(null);\n const dropdownContainerRef = useRef<HTMLDivElement | null>(null);\n // This container is only needed to apply max-height to. We can't move max-height to it's parent\n // because of an IE11 issue with flexbox. https://github.com/philipwalton/flexbugs/issues/216\n const verticalContainerRef = useRef<HTMLDivElement>(null);\n // To keep track of the initial position (drop up/down) which is kept the same during fixed repositioning\n const fixedPosition = useRef<DropdownPosition | null>(null);\n\n const isRefresh = useVisualRefresh();\n\n const dropdownClasses = usePortalModeClasses(triggerRef);\n const [position, setPosition] = useState<DropdownContextProviderProps['position']>('bottom-right');\n\n const isMobile = useMobile();\n\n const setDropdownPosition = (\n position: DropdownPosition | InteriorDropdownPosition,\n triggerBox: DOMRect,\n target: HTMLDivElement,\n verticalContainer: HTMLDivElement\n ) => {\n const entireWidth = !interior && stretchWidth;\n if (!stretchWidth) {\n // 1px offset for dropdowns where the dropdown itself needs a border, rather than on the items\n verticalContainer.style.maxBlockSize = `${parseInt(position.blockSize) + 1}px`;\n } else {\n verticalContainer.style.maxBlockSize = position.blockSize;\n }\n\n if (entireWidth && !expandToViewport) {\n if (stretchToTriggerWidth) {\n target.classList.add(styles['occupy-entire-width']);\n }\n } else {\n target.style.inlineSize = position.inlineSize;\n }\n\n // Using styles for main dropdown to adjust its position as preferred alternative\n if (position.dropBlockStart && !interior) {\n target.classList.add(styles['dropdown-drop-up']);\n if (!expandToViewport) {\n target.style.insetBlockEnd = '100%';\n }\n } else {\n target.classList.remove(styles['dropdown-drop-up']);\n }\n target.classList.add(position.dropInlineStart ? styles['dropdown-drop-left'] : styles['dropdown-drop-right']);\n\n if (position.insetInlineStart && position.insetInlineStart !== 'auto') {\n target.style.insetInlineStart = position.insetInlineStart;\n }\n\n // Position normal overflow dropdowns with fixed positioning relative to viewport\n if (expandToViewport && !interior) {\n target.style.position = 'fixed';\n if (position.dropBlockStart) {\n target.style.insetBlockEnd = `calc(100% - ${triggerBox.top}px)`;\n } else {\n target.style.insetBlockStart = `${triggerBox.bottom}px`;\n }\n if (position.dropInlineStart) {\n target.style.insetInlineStart = `calc(${triggerBox.right}px - ${position.inlineSize})`;\n } else {\n target.style.insetInlineStart = `${triggerBox.left}px`;\n }\n // Keep track of the initial dropdown position and direction.\n // Dropdown direction doesn't need to change as the user scrolls, just needs to stay attached to the trigger.\n fixedPosition.current = position;\n return;\n }\n\n // For an interior dropdown (the fly out) we need exact values for positioning\n // and classes are not enough\n // usage of relative position is impossible due to overwrite of overflow-x\n if (interior && isInteriorPosition(position)) {\n if (position.dropBlockStart) {\n target.style.insetBlockEnd = position.insetBlockEnd;\n } else {\n target.style.insetBlockStart = position.insetBlockStart;\n }\n target.style.insetInlineStart = position.insetInlineStart;\n }\n\n if (position.dropBlockStart && position.dropInlineStart) {\n setPosition('top-left');\n } else if (position.dropBlockStart) {\n setPosition('top-right');\n } else if (position.dropInlineStart) {\n setPosition('bottom-left');\n } else {\n setPosition('bottom-right');\n }\n };\n\n const isOutsideDropdown = (element: Element) =>\n (!wrapperRef.current || !nodeBelongs(wrapperRef.current, element)) &&\n (!dropdownContainerRef.current || !nodeBelongs(dropdownContainerRef.current, element));\n\n const focusHandler = (event: React.FocusEvent) => {\n if (!event.relatedTarget || isOutsideDropdown(event.relatedTarget)) {\n fireNonCancelableEvent(onFocus, event);\n }\n };\n\n const blurHandler = (event: React.FocusEvent) => {\n if (!event.relatedTarget || isOutsideDropdown(event.relatedTarget)) {\n fireNonCancelableEvent(onBlur, event);\n }\n };\n\n // Prevent the dropdown width from stretching beyond the trigger width\n // if that is going to cause the dropdown to be cropped because of overflow\n const fixStretching = () => {\n const classNameToRemove = styles['stretch-beyond-trigger-width'];\n if (\n open &&\n stretchBeyondTriggerWidth &&\n dropdownRef.current &&\n triggerRef.current &&\n dropdownRef.current.classList.contains(classNameToRemove) &&\n !hasEnoughSpaceToStretchBeyondTriggerWidth({\n triggerElement: triggerRef.current,\n dropdownElement: dropdownRef.current,\n desiredMinWidth: minWidth,\n expandToViewport,\n stretchWidth,\n stretchHeight,\n isMobile,\n })\n ) {\n dropdownRef.current.classList.remove(classNameToRemove);\n }\n };\n\n useResizeObserver(() => dropdownRef.current, fixStretching);\n\n useLayoutEffect(() => {\n const onDropdownOpen = () => {\n if (open && dropdownRef.current && triggerRef.current && verticalContainerRef.current) {\n // calculate scroll width only for dropdowns that has a scrollbar and ignore it for date picker components\n if (scrollable) {\n dropdownRef.current.classList.add(styles.nowrap);\n }\n setDropdownPosition(\n ...calculatePosition(\n dropdownRef.current,\n triggerRef.current,\n verticalContainerRef.current,\n interior,\n expandToViewport,\n preferCenter,\n stretchWidth,\n stretchHeight,\n isMobile,\n minWidth,\n stretchBeyondTriggerWidth\n ),\n dropdownRef.current,\n verticalContainerRef.current\n );\n if (scrollable) {\n dropdownRef.current.classList.remove(styles.nowrap);\n }\n }\n };\n onDropdownOpen();\n\n if (open) {\n // window may scroll when dropdown opens, for example when soft keyboard shows up\n window.addEventListener('scroll', onDropdownOpen);\n // only listen to window scroll within very short time after the dropdown opens\n // do not want to interfere dropdown position on scroll afterwards\n const timeoutId = setTimeout(() => {\n window.removeEventListener('scroll', onDropdownOpen);\n }, 500);\n\n return () => {\n clearTimeout(timeoutId);\n window.removeEventListener('scroll', onDropdownOpen);\n };\n }\n // See AWSUI-13040\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [open, dropdownRef, triggerRef, verticalContainerRef, interior, stretchWidth, isMobile, contentKey]);\n\n // subscribe to outside click\n useEffect(() => {\n if (!open) {\n return;\n }\n const clickListener = (e: MouseEvent) => {\n if (!nodeBelongs(dropdownRef.current, e.target) && !nodeBelongs(triggerRef.current, e.target)) {\n fireNonCancelableEvent(onDropdownClose);\n }\n };\n window.addEventListener('click', clickListener, true);\n\n return () => {\n window.removeEventListener('click', clickListener, true);\n };\n }, [open, onDropdownClose]);\n\n // sync dropdown position on scroll and resize\n useLayoutEffect(() => {\n if (!expandToViewport || !open) {\n return;\n }\n const updateDropdownPosition = () => {\n if (triggerRef.current && dropdownRef.current && verticalContainerRef.current) {\n const triggerRect = getLogicalBoundingClientRect(triggerRef.current);\n const target = dropdownRef.current;\n if (fixedPosition.current) {\n if (fixedPosition.current.dropBlockStart) {\n dropdownRef.current.style.insetBlockEnd = `calc(100% - ${triggerRect.insetBlockStart}px)`;\n } else {\n target.style.insetBlockStart = `${triggerRect.insetBlockEnd}px`;\n }\n if (fixedPosition.current.dropInlineStart) {\n target.style.insetInlineStart = `calc(${triggerRect.insetInlineEnd}px - ${fixedPosition.current.inlineSize})`;\n } else {\n target.style.insetInlineStart = `${triggerRect.insetInlineStart}px`;\n }\n }\n }\n };\n\n updateDropdownPosition();\n\n window.addEventListener('scroll', updateDropdownPosition, true);\n window.addEventListener('resize', updateDropdownPosition, true);\n return () => {\n window.removeEventListener('scroll', updateDropdownPosition, true);\n window.removeEventListener('resize', updateDropdownPosition, true);\n };\n }, [open, expandToViewport]);\n\n const referrerId = useUniqueId();\n\n return (\n <div\n className={clsx(\n styles.root,\n interior && styles.interior,\n stretchTriggerHeight && styles['stretch-trigger-height']\n )}\n ref={wrapperRef}\n onFocus={focusHandler}\n onBlur={blurHandler}\n >\n <div id={referrerId} className={clsx(stretchTriggerHeight && styles['stretch-trigger-height'])} ref={triggerRef}>\n {trigger}\n </div>\n\n <TabTrap\n focusNextCallback={() => dropdownRef.current && getFirstFocusable(dropdownRef.current)?.focus()}\n disabled={!open || !loopFocus}\n />\n\n <DropdownContainer\n renderWithPortal={expandToViewport && !interior}\n id={dropdownId}\n referrerId={referrerId}\n open={open}\n >\n <Transition in={open ?? false} exit={false}>\n {(state, ref) => (\n <div ref={dropdownContainerRef}>\n <TabTrap\n focusNextCallback={() => triggerRef.current && getLastFocusable(triggerRef.current)?.focus()}\n disabled={!open || !loopFocus}\n />\n\n <TransitionContent\n state={state}\n transitionRef={ref}\n dropdownClasses={dropdownClasses}\n open={open}\n stretchWidth={stretchWidth}\n interior={interior}\n header={header}\n expandToViewport={expandToViewport}\n stretchBeyondTriggerWidth={stretchBeyondTriggerWidth}\n footer={footer}\n onMouseDown={onMouseDown}\n isRefresh={isRefresh}\n dropdownRef={dropdownRef}\n verticalContainerRef={verticalContainerRef}\n position={position}\n id={dropdownContentId}\n role={dropdownContentRole}\n ariaLabelledby={ariaLabelledby}\n ariaDescribedby={ariaDescribedby}\n >\n {children}\n </TransitionContent>\n\n <TabTrap\n focusNextCallback={() => triggerRef.current && getFirstFocusable(triggerRef.current)?.focus()}\n disabled={!open || !loopFocus}\n />\n </div>\n )}\n </Transition>\n </DropdownContainer>\n </div>\n );\n};\n\nconst isInteriorPosition = (\n position: DropdownPosition | InteriorDropdownPosition\n): position is InteriorDropdownPosition => (position as InteriorDropdownPosition).insetBlockEnd !== undefined;\n\nexport default Dropdown;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/components/dropdown/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAEtD,OAAO,EAGL,iBAAiB,EACjB,uBAAuB,EACvB,yCAAyC,GAC1C,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,UAAU,EAAoB,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,uBAAuB,EAAgC,MAAM,WAAW,CAAC;AAClF,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,OAAO,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAA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iBAAiB,EAAE,GAAG,EAAE,WAAC,OAAA,UAAU,CAAC,OAAO,KAAI,MAAA,iBAAiB,CAAC,UAAU,CAAC,OAAO,CAAC,0CAAE,KAAK,EAAE,CAAA,CAAA,EAAA,EAC7F,QAAQ,EAAE,CAAC,IAAI,IAAI,CAAC,SAAS,GAC7B,CACE,CACP,CACU,CACK,CAChB,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,CACzB,QAAqD,EACf,EAAE,CAAE,QAAqC,CAAC,aAAa,KAAK,SAAS,CAAC;AAE9G,eAAe,QAAQ,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 clsx from 'clsx';\nimport { useMergeRefs } from '../../hooks/use-merge-refs';\nimport React, { useEffect, useLayoutEffect, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\nimport { fireNonCancelableEvent } from '../../events';\nimport { DropdownProps } from './interfaces';\nimport {\n DropdownPosition,\n InteriorDropdownPosition,\n calculatePosition,\n defaultMaxDropdownWidth,\n hasEnoughSpaceToStretchBeyondTriggerWidth,\n} from './dropdown-fit-handler';\nimport { Transition, TransitionStatus } from '../transition';\nimport { useVisualRefresh } from '../../hooks/use-visual-mode';\nimport { usePortalModeClasses } from '../../hooks/use-portal-mode-classes';\nimport { DropdownContextProvider, DropdownContextProviderProps } from './context';\nimport { useMobile } from '../../hooks/use-mobile';\nimport TabTrap from '../tab-trap/index.js';\nimport { getFirstFocusable, getLastFocusable } from '../focus-lock/utils.js';\nimport { useUniqueId } from '../../hooks/use-unique-id/index.js';\nimport customCssProps from '../../generated/custom-css-properties';\nimport { useResizeObserver } from '@cloudscape-design/component-toolkit/internal';\nimport { nodeBelongs } from '../../utils/node-belongs';\nimport { getLogicalBoundingClientRect } from '@cloudscape-design/component-toolkit/internal';\n\ninterface DropdownContainerProps {\n children?: React.ReactNode;\n renderWithPortal?: boolean;\n id?: string;\n referrerId?: string;\n open?: boolean;\n}\n\nconst DropdownContainer = ({ children, renderWithPortal = false, id, referrerId, open }: DropdownContainerProps) => {\n if (renderWithPortal) {\n if (open) {\n return createPortal(\n <div id={id} data-awsui-referrer-id={referrerId}>\n {children}\n </div>,\n document.body\n );\n } else {\n return null;\n }\n } else {\n return <>{children}</>;\n }\n};\n\ninterface TransitionContentProps {\n state: TransitionStatus;\n transitionRef: React.MutableRefObject<any>;\n dropdownClasses: string;\n stretchWidth: boolean;\n interior: boolean;\n isRefresh: boolean;\n dropdownRef: React.RefObject<HTMLDivElement>;\n verticalContainerRef: React.RefObject<HTMLDivElement>;\n expandToViewport?: boolean;\n stretchBeyondTriggerWidth?: boolean;\n header?: React.ReactNode;\n children?: React.ReactNode;\n footer?: React.ReactNode;\n position?: DropdownContextProviderProps['position'];\n open?: boolean;\n onMouseDown?: React.MouseEventHandler<Element>;\n id?: string;\n role?: string;\n ariaLabelledby?: string;\n ariaDescribedby?: string;\n}\n\nconst TransitionContent = ({\n state,\n transitionRef,\n dropdownClasses,\n stretchWidth,\n interior,\n isRefresh,\n dropdownRef,\n verticalContainerRef,\n expandToViewport,\n stretchBeyondTriggerWidth,\n header,\n children,\n footer,\n position,\n open,\n onMouseDown,\n id,\n role,\n ariaLabelledby,\n ariaDescribedby,\n}: TransitionContentProps) => {\n const contentRef = useMergeRefs(dropdownRef, transitionRef);\n return (\n <div\n className={clsx(styles.dropdown, dropdownClasses, {\n [styles.open]: open,\n [styles['with-limited-width']]: !stretchWidth,\n [styles['hide-block-border']]: stretchWidth,\n [styles.interior]: interior,\n [styles.refresh]: isRefresh,\n [styles['use-portal']]: expandToViewport && !interior,\n [styles['stretch-beyond-trigger-width']]: stretchBeyondTriggerWidth,\n })}\n ref={contentRef}\n id={id}\n role={role}\n aria-labelledby={ariaLabelledby}\n aria-describedby={ariaDescribedby}\n data-open={open}\n data-animating={state !== 'exited'}\n aria-hidden={!open}\n style={\n stretchBeyondTriggerWidth ? { [customCssProps.dropdownDefaultMaxWidth]: `${defaultMaxDropdownWidth}px` } : {}\n }\n onMouseDown={onMouseDown}\n >\n <div\n className={clsx(\n styles['dropdown-content-wrapper'],\n !header && !children && styles['is-empty'],\n isRefresh && styles.refresh\n )}\n >\n <div ref={verticalContainerRef} className={styles['dropdown-content']}>\n <DropdownContextProvider position={position}>\n {header}\n {children}\n {footer}\n </DropdownContextProvider>\n </div>\n </div>\n </div>\n );\n};\n\nconst Dropdown = ({\n children,\n trigger,\n open,\n onDropdownClose,\n onMouseDown,\n header,\n footer,\n dropdownId,\n stretchTriggerHeight = false,\n stretchWidth = true,\n stretchHeight = false,\n stretchToTriggerWidth = true,\n stretchBeyondTriggerWidth = false,\n expandToViewport = false,\n preferCenter = false,\n interior = false,\n minWidth,\n scrollable = true,\n loopFocus = expandToViewport,\n onFocus,\n onBlur,\n contentKey,\n dropdownContentId,\n dropdownContentRole,\n ariaLabelledby,\n ariaDescribedby,\n}: DropdownProps) => {\n const wrapperRef = useRef<HTMLDivElement | null>(null);\n const triggerRef = useRef<HTMLDivElement | null>(null);\n const dropdownRef = useRef<HTMLDivElement | null>(null);\n const dropdownContainerRef = useRef<HTMLDivElement | null>(null);\n const verticalContainerRef = useRef<HTMLDivElement>(null);\n // To keep track of the initial position (drop up/down) which is kept the same during fixed repositioning\n const fixedPosition = useRef<DropdownPosition | null>(null);\n\n const isRefresh = useVisualRefresh();\n\n const dropdownClasses = usePortalModeClasses(triggerRef);\n const [position, setPosition] = useState<DropdownContextProviderProps['position']>('bottom-right');\n\n const isMobile = useMobile();\n\n const setDropdownPosition = (\n position: DropdownPosition | InteriorDropdownPosition,\n triggerBox: DOMRect,\n target: HTMLDivElement,\n verticalContainer: HTMLDivElement\n ) => {\n const entireWidth = !interior && stretchWidth;\n if (!stretchWidth) {\n // 1px offset for dropdowns where the dropdown itself needs a border, rather than on the items\n verticalContainer.style.maxBlockSize = `${parseInt(position.blockSize) + 1}px`;\n } else {\n verticalContainer.style.maxBlockSize = position.blockSize;\n }\n\n if (entireWidth && !expandToViewport) {\n if (stretchToTriggerWidth) {\n target.classList.add(styles['occupy-entire-width']);\n }\n } else {\n target.style.inlineSize = position.inlineSize;\n }\n\n // Using styles for main dropdown to adjust its position as preferred alternative\n if (position.dropBlockStart && !interior) {\n target.classList.add(styles['dropdown-drop-up']);\n if (!expandToViewport) {\n target.style.insetBlockEnd = '100%';\n }\n } else {\n target.classList.remove(styles['dropdown-drop-up']);\n }\n target.classList.add(position.dropInlineStart ? styles['dropdown-drop-left'] : styles['dropdown-drop-right']);\n\n if (position.insetInlineStart && position.insetInlineStart !== 'auto') {\n target.style.insetInlineStart = position.insetInlineStart;\n }\n\n // Position normal overflow dropdowns with fixed positioning relative to viewport\n if (expandToViewport && !interior) {\n target.style.position = 'fixed';\n if (position.dropBlockStart) {\n target.style.insetBlockEnd = `calc(100% - ${triggerBox.top}px)`;\n } else {\n target.style.insetBlockStart = `${triggerBox.bottom}px`;\n }\n if (position.dropInlineStart) {\n target.style.insetInlineStart = `calc(${triggerBox.right}px - ${position.inlineSize})`;\n } else {\n target.style.insetInlineStart = `${triggerBox.left}px`;\n }\n // Keep track of the initial dropdown position and direction.\n // Dropdown direction doesn't need to change as the user scrolls, just needs to stay attached to the trigger.\n fixedPosition.current = position;\n return;\n }\n\n // For an interior dropdown (the fly out) we need exact values for positioning\n // and classes are not enough\n // usage of relative position is impossible due to overwrite of overflow-x\n if (interior && isInteriorPosition(position)) {\n if (position.dropBlockStart) {\n target.style.insetBlockEnd = position.insetBlockEnd;\n } else {\n target.style.insetBlockStart = position.insetBlockStart;\n }\n target.style.insetInlineStart = position.insetInlineStart;\n }\n\n if (position.dropBlockStart && position.dropInlineStart) {\n setPosition('top-left');\n } else if (position.dropBlockStart) {\n setPosition('top-right');\n } else if (position.dropInlineStart) {\n setPosition('bottom-left');\n } else {\n setPosition('bottom-right');\n }\n };\n\n const isOutsideDropdown = (element: Element) =>\n (!wrapperRef.current || !nodeBelongs(wrapperRef.current, element)) &&\n (!dropdownContainerRef.current || !nodeBelongs(dropdownContainerRef.current, element));\n\n const focusHandler = (event: React.FocusEvent) => {\n if (!event.relatedTarget || isOutsideDropdown(event.relatedTarget)) {\n fireNonCancelableEvent(onFocus, event);\n }\n };\n\n const blurHandler = (event: React.FocusEvent) => {\n if (!event.relatedTarget || isOutsideDropdown(event.relatedTarget)) {\n fireNonCancelableEvent(onBlur, event);\n }\n };\n\n // Prevent the dropdown width from stretching beyond the trigger width\n // if that is going to cause the dropdown to be cropped because of overflow\n const fixStretching = () => {\n const classNameToRemove = styles['stretch-beyond-trigger-width'];\n if (\n open &&\n stretchBeyondTriggerWidth &&\n dropdownRef.current &&\n triggerRef.current &&\n dropdownRef.current.classList.contains(classNameToRemove) &&\n !hasEnoughSpaceToStretchBeyondTriggerWidth({\n triggerElement: triggerRef.current,\n dropdownElement: dropdownRef.current,\n desiredMinWidth: minWidth,\n expandToViewport,\n stretchWidth,\n stretchHeight,\n isMobile,\n })\n ) {\n dropdownRef.current.classList.remove(classNameToRemove);\n }\n };\n\n useResizeObserver(() => dropdownRef.current, fixStretching);\n\n useLayoutEffect(() => {\n const onDropdownOpen = () => {\n if (open && dropdownRef.current && triggerRef.current && verticalContainerRef.current) {\n // calculate scroll width only for dropdowns that has a scrollbar and ignore it for date picker components\n if (scrollable) {\n dropdownRef.current.classList.add(styles.nowrap);\n }\n setDropdownPosition(\n ...calculatePosition(\n dropdownRef.current,\n triggerRef.current,\n verticalContainerRef.current,\n interior,\n expandToViewport,\n preferCenter,\n stretchWidth,\n stretchHeight,\n isMobile,\n minWidth,\n stretchBeyondTriggerWidth\n ),\n dropdownRef.current,\n verticalContainerRef.current\n );\n if (scrollable) {\n dropdownRef.current.classList.remove(styles.nowrap);\n }\n }\n };\n onDropdownOpen();\n\n if (open) {\n // window may scroll when dropdown opens, for example when soft keyboard shows up\n window.addEventListener('scroll', onDropdownOpen);\n // only listen to window scroll within very short time after the dropdown opens\n // do not want to interfere dropdown position on scroll afterwards\n const timeoutId = setTimeout(() => {\n window.removeEventListener('scroll', onDropdownOpen);\n }, 500);\n\n return () => {\n clearTimeout(timeoutId);\n window.removeEventListener('scroll', onDropdownOpen);\n };\n }\n // See AWSUI-13040\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [open, dropdownRef, triggerRef, verticalContainerRef, interior, stretchWidth, isMobile, contentKey]);\n\n // subscribe to outside click\n useEffect(() => {\n if (!open) {\n return;\n }\n const clickListener = (e: MouseEvent) => {\n if (!nodeBelongs(dropdownRef.current, e.target) && !nodeBelongs(triggerRef.current, e.target)) {\n fireNonCancelableEvent(onDropdownClose);\n }\n };\n window.addEventListener('click', clickListener, true);\n\n return () => {\n window.removeEventListener('click', clickListener, true);\n };\n }, [open, onDropdownClose]);\n\n // sync dropdown position on scroll and resize\n useLayoutEffect(() => {\n if (!expandToViewport || !open) {\n return;\n }\n const updateDropdownPosition = () => {\n if (triggerRef.current && dropdownRef.current && verticalContainerRef.current) {\n const triggerRect = getLogicalBoundingClientRect(triggerRef.current);\n const target = dropdownRef.current;\n if (fixedPosition.current) {\n if (fixedPosition.current.dropBlockStart) {\n dropdownRef.current.style.insetBlockEnd = `calc(100% - ${triggerRect.insetBlockStart}px)`;\n } else {\n target.style.insetBlockStart = `${triggerRect.insetBlockEnd}px`;\n }\n if (fixedPosition.current.dropInlineStart) {\n target.style.insetInlineStart = `calc(${triggerRect.insetInlineEnd}px - ${fixedPosition.current.inlineSize})`;\n } else {\n target.style.insetInlineStart = `${triggerRect.insetInlineStart}px`;\n }\n }\n }\n };\n\n updateDropdownPosition();\n\n window.addEventListener('scroll', updateDropdownPosition, true);\n window.addEventListener('resize', updateDropdownPosition, true);\n return () => {\n window.removeEventListener('scroll', updateDropdownPosition, true);\n window.removeEventListener('resize', updateDropdownPosition, true);\n };\n }, [open, expandToViewport]);\n\n const referrerId = useUniqueId();\n\n return (\n <div\n className={clsx(\n styles.root,\n interior && styles.interior,\n stretchTriggerHeight && styles['stretch-trigger-height']\n )}\n ref={wrapperRef}\n onFocus={focusHandler}\n onBlur={blurHandler}\n >\n <div id={referrerId} className={clsx(stretchTriggerHeight && styles['stretch-trigger-height'])} ref={triggerRef}>\n {trigger}\n </div>\n\n <TabTrap\n focusNextCallback={() => dropdownRef.current && getFirstFocusable(dropdownRef.current)?.focus()}\n disabled={!open || !loopFocus}\n />\n\n <DropdownContainer\n renderWithPortal={expandToViewport && !interior}\n id={dropdownId}\n referrerId={referrerId}\n open={open}\n >\n <Transition in={open ?? false} exit={false}>\n {(state, ref) => (\n <div ref={dropdownContainerRef}>\n <TabTrap\n focusNextCallback={() => triggerRef.current && getLastFocusable(triggerRef.current)?.focus()}\n disabled={!open || !loopFocus}\n />\n\n <TransitionContent\n state={state}\n transitionRef={ref}\n dropdownClasses={dropdownClasses}\n open={open}\n stretchWidth={stretchWidth}\n interior={interior}\n header={header}\n expandToViewport={expandToViewport}\n stretchBeyondTriggerWidth={stretchBeyondTriggerWidth}\n footer={footer}\n onMouseDown={onMouseDown}\n isRefresh={isRefresh}\n dropdownRef={dropdownRef}\n verticalContainerRef={verticalContainerRef}\n position={position}\n id={dropdownContentId}\n role={dropdownContentRole}\n ariaLabelledby={ariaLabelledby}\n ariaDescribedby={ariaDescribedby}\n >\n {children}\n </TransitionContent>\n\n <TabTrap\n focusNextCallback={() => triggerRef.current && getFirstFocusable(triggerRef.current)?.focus()}\n disabled={!open || !loopFocus}\n />\n </div>\n )}\n </Transition>\n </DropdownContainer>\n </div>\n );\n};\n\nconst isInteriorPosition = (\n position: DropdownPosition | InteriorDropdownPosition\n): position is InteriorDropdownPosition => (position as InteriorDropdownPosition).insetBlockEnd !== undefined;\n\nexport default Dropdown;\n"]}
@@ -1,25 +1,25 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "dropdown-content-wrapper": "awsui_dropdown-content-wrapper_qwoo0_1tzz2_99",
5
- "awsui-motion-fade-in-dropdown": "awsui_awsui-motion-fade-in-dropdown_qwoo0_1tzz2_1",
6
- "refresh": "awsui_refresh_qwoo0_1tzz2_120",
7
- "awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-0_qwoo0_1tzz2_1",
8
- "root": "awsui_root_qwoo0_1tzz2_149",
9
- "interior": "awsui_interior_qwoo0_1tzz2_185",
10
- "dropdown": "awsui_dropdown_qwoo0_1tzz2_99",
11
- "use-portal": "awsui_use-portal_qwoo0_1tzz2_196",
12
- "is-empty": "awsui_is-empty_qwoo0_1tzz2_248",
13
- "dropdown-drop-up": "awsui_dropdown-drop-up_qwoo0_1tzz2_255",
14
- "with-limited-width": "awsui_with-limited-width_qwoo0_1tzz2_259",
15
- "dropdown-drop-left": "awsui_dropdown-drop-left_qwoo0_1tzz2_262",
16
- "dropdown-drop-right": "awsui_dropdown-drop-right_qwoo0_1tzz2_268",
17
- "occupy-entire-width": "awsui_occupy-entire-width_qwoo0_1tzz2_274",
18
- "stretch-beyond-trigger-width": "awsui_stretch-beyond-trigger-width_qwoo0_1tzz2_277",
19
- "hide-block-border": "awsui_hide-block-border_qwoo0_1tzz2_284",
20
- "open": "awsui_open_qwoo0_1tzz2_293",
21
- "nowrap": "awsui_nowrap_qwoo0_1tzz2_302",
22
- "dropdown-content": "awsui_dropdown-content_qwoo0_1tzz2_99",
23
- "stretch-trigger-height": "awsui_stretch-trigger-height_qwoo0_1tzz2_313"
4
+ "dropdown-content-wrapper": "awsui_dropdown-content-wrapper_qwoo0_se6og_99",
5
+ "awsui-motion-fade-in-dropdown": "awsui_awsui-motion-fade-in-dropdown_qwoo0_se6og_1",
6
+ "refresh": "awsui_refresh_qwoo0_se6og_120",
7
+ "awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-0_qwoo0_se6og_1",
8
+ "root": "awsui_root_qwoo0_se6og_149",
9
+ "interior": "awsui_interior_qwoo0_se6og_185",
10
+ "dropdown": "awsui_dropdown_qwoo0_se6og_99",
11
+ "use-portal": "awsui_use-portal_qwoo0_se6og_196",
12
+ "is-empty": "awsui_is-empty_qwoo0_se6og_242",
13
+ "dropdown-drop-up": "awsui_dropdown-drop-up_qwoo0_se6og_249",
14
+ "with-limited-width": "awsui_with-limited-width_qwoo0_se6og_253",
15
+ "dropdown-drop-left": "awsui_dropdown-drop-left_qwoo0_se6og_256",
16
+ "dropdown-drop-right": "awsui_dropdown-drop-right_qwoo0_se6og_262",
17
+ "occupy-entire-width": "awsui_occupy-entire-width_qwoo0_se6og_268",
18
+ "stretch-beyond-trigger-width": "awsui_stretch-beyond-trigger-width_qwoo0_se6og_271",
19
+ "hide-block-border": "awsui_hide-block-border_qwoo0_se6og_278",
20
+ "open": "awsui_open_qwoo0_se6og_287",
21
+ "nowrap": "awsui_nowrap_qwoo0_se6og_296",
22
+ "dropdown-content": "awsui_dropdown-content_qwoo0_se6og_99",
23
+ "stretch-trigger-height": "awsui_stretch-trigger-height_qwoo0_se6og_307"
24
24
  };
25
25
 
@@ -96,10 +96,10 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
96
96
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
97
97
  SPDX-License-Identifier: Apache-2.0
98
98
  */
99
- .awsui_dropdown-content-wrapper_qwoo0_1tzz2_99:not(#\9) {
100
- animation: awsui_awsui-motion-fade-in-dropdown_qwoo0_1tzz2_1 var(--motion-duration-show-quick-kypzaj, 135ms) var(--motion-easing-show-quick-lvi5i8, ease-out);
99
+ .awsui_dropdown-content-wrapper_qwoo0_se6og_99:not(#\9) {
100
+ animation: awsui_awsui-motion-fade-in-dropdown_qwoo0_se6og_1 var(--motion-duration-show-quick-kypzaj, 135ms) var(--motion-easing-show-quick-lvi5i8, ease-out);
101
101
  }
102
- @keyframes awsui_awsui-motion-fade-in-dropdown_qwoo0_1tzz2_1 {
102
+ @keyframes awsui_awsui-motion-fade-in-dropdown_qwoo0_se6og_1 {
103
103
  from {
104
104
  opacity: 0.4;
105
105
  }
@@ -108,22 +108,22 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
108
108
  }
109
109
  }
110
110
  @media (prefers-reduced-motion: reduce) {
111
- .awsui_dropdown-content-wrapper_qwoo0_1tzz2_99:not(#\9) {
111
+ .awsui_dropdown-content-wrapper_qwoo0_se6og_99:not(#\9) {
112
112
  animation: none;
113
113
  transition: none;
114
114
  }
115
115
  }
116
- .awsui-motion-disabled .awsui_dropdown-content-wrapper_qwoo0_1tzz2_99:not(#\9), .awsui-mode-entering .awsui_dropdown-content-wrapper_qwoo0_1tzz2_99:not(#\9) {
116
+ .awsui-motion-disabled .awsui_dropdown-content-wrapper_qwoo0_se6og_99:not(#\9), .awsui-mode-entering .awsui_dropdown-content-wrapper_qwoo0_se6og_99:not(#\9) {
117
117
  animation: none;
118
118
  transition: none;
119
119
  }
120
- .awsui_dropdown-content-wrapper_qwoo0_1tzz2_99.awsui_refresh_qwoo0_1tzz2_120:not(#\9) {
120
+ .awsui_dropdown-content-wrapper_qwoo0_se6og_99.awsui_refresh_qwoo0_se6og_120:not(#\9) {
121
121
  transform-origin: top;
122
- animation-name: awsui_awsui-motion-fade-in-0_qwoo0_1tzz2_1;
122
+ animation-name: awsui_awsui-motion-fade-in-0_qwoo0_se6og_1;
123
123
  animation-duration: var(--motion-duration-show-quick-kypzaj, 135ms);
124
124
  animation-timing-function: var(--motion-easing-show-quick-lvi5i8, ease-out);
125
125
  }
126
- @keyframes awsui_awsui-motion-fade-in-0_qwoo0_1tzz2_1 {
126
+ @keyframes awsui_awsui-motion-fade-in-0_qwoo0_se6og_1 {
127
127
  from {
128
128
  opacity: 0;
129
129
  }
@@ -132,12 +132,12 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
132
132
  }
133
133
  }
134
134
  @media (prefers-reduced-motion: reduce) {
135
- .awsui_dropdown-content-wrapper_qwoo0_1tzz2_99.awsui_refresh_qwoo0_1tzz2_120:not(#\9) {
135
+ .awsui_dropdown-content-wrapper_qwoo0_se6og_99.awsui_refresh_qwoo0_se6og_120:not(#\9) {
136
136
  animation: none;
137
137
  transition: none;
138
138
  }
139
139
  }
140
- .awsui-motion-disabled .awsui_dropdown-content-wrapper_qwoo0_1tzz2_99.awsui_refresh_qwoo0_1tzz2_120:not(#\9), .awsui-mode-entering .awsui_dropdown-content-wrapper_qwoo0_1tzz2_99.awsui_refresh_qwoo0_1tzz2_120:not(#\9) {
140
+ .awsui-motion-disabled .awsui_dropdown-content-wrapper_qwoo0_se6og_99.awsui_refresh_qwoo0_se6og_120:not(#\9), .awsui-mode-entering .awsui_dropdown-content-wrapper_qwoo0_se6og_99.awsui_refresh_qwoo0_se6og_120:not(#\9) {
141
141
  animation: none;
142
142
  transition: none;
143
143
  }
@@ -146,7 +146,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
146
146
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
147
147
  SPDX-License-Identifier: Apache-2.0
148
148
  */
149
- .awsui_root_qwoo0_1tzz2_149:not(#\9) {
149
+ .awsui_root_qwoo0_se6og_149:not(#\9) {
150
150
  border-collapse: separate;
151
151
  border-spacing: 0;
152
152
  box-sizing: border-box;
@@ -183,11 +183,11 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
183
183
  position: relative;
184
184
  white-space: inherit;
185
185
  }
186
- .awsui_root_qwoo0_1tzz2_149.awsui_interior_qwoo0_1tzz2_185:not(#\9) {
186
+ .awsui_root_qwoo0_se6og_149.awsui_interior_qwoo0_se6og_185:not(#\9) {
187
187
  position: static;
188
188
  }
189
189
 
190
- .awsui_dropdown_qwoo0_1tzz2_99:not(#\9) {
190
+ .awsui_dropdown_qwoo0_se6og_99:not(#\9) {
191
191
  position: absolute;
192
192
  display: none;
193
193
  z-index: 2000;
@@ -195,24 +195,24 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
195
195
  user-select: none;
196
196
  transform-origin: top;
197
197
  }
198
- .awsui_dropdown_qwoo0_1tzz2_99.awsui_use-portal_qwoo0_1tzz2_196:not(#\9) {
198
+ .awsui_dropdown_qwoo0_se6og_99.awsui_use-portal_qwoo0_se6og_196:not(#\9) {
199
199
  z-index: 7000;
200
200
  }
201
- .awsui_dropdown_qwoo0_1tzz2_99:not(#\9):not(.awsui_interior_qwoo0_1tzz2_185) {
201
+ .awsui_dropdown_qwoo0_se6og_99:not(#\9):not(.awsui_interior_qwoo0_se6og_185) {
202
202
  transform: translateY(0px);
203
203
  transition: transform var(--motion-duration-show-quick-kypzaj, 135ms);
204
204
  }
205
205
  @media (prefers-reduced-motion: reduce) {
206
- .awsui_dropdown_qwoo0_1tzz2_99:not(#\9):not(.awsui_interior_qwoo0_1tzz2_185) {
206
+ .awsui_dropdown_qwoo0_se6og_99:not(#\9):not(.awsui_interior_qwoo0_se6og_185) {
207
207
  animation: none;
208
208
  transition: none;
209
209
  }
210
210
  }
211
- .awsui-motion-disabled .awsui_dropdown_qwoo0_1tzz2_99:not(#\9):not(.awsui_interior_qwoo0_1tzz2_185), .awsui-mode-entering .awsui_dropdown_qwoo0_1tzz2_99:not(#\9):not(.awsui_interior_qwoo0_1tzz2_185) {
211
+ .awsui-motion-disabled .awsui_dropdown_qwoo0_se6og_99:not(#\9):not(.awsui_interior_qwoo0_se6og_185), .awsui-mode-entering .awsui_dropdown_qwoo0_se6og_99:not(#\9):not(.awsui_interior_qwoo0_se6og_185) {
212
212
  animation: none;
213
213
  transition: none;
214
214
  }
215
- .awsui_dropdown-content-wrapper_qwoo0_1tzz2_99:not(#\9) {
215
+ .awsui_dropdown-content-wrapper_qwoo0_se6og_99:not(#\9) {
216
216
  position: relative;
217
217
  background-color: var(--color-background-dropdown-item-default-s7k0er, #ffffff);
218
218
  outline: none;
@@ -224,7 +224,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
224
224
  border-block: var(--border-divider-list-width-471u6a, 1px) solid var(--color-border-container-top-9shhmi, #eaeded);
225
225
  box-sizing: border-box;
226
226
  }
227
- .awsui_dropdown-content-wrapper_qwoo0_1tzz2_99:not(#\9)::after {
227
+ .awsui_dropdown-content-wrapper_qwoo0_se6og_99:not(#\9)::after {
228
228
  content: "";
229
229
  position: absolute;
230
230
  z-index: 1;
@@ -241,77 +241,71 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
241
241
  border-end-end-radius: var(--border-radius-dropdown-cw0ldi, 0px);
242
242
  pointer-events: none;
243
243
  }
244
- @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
245
- .awsui_dropdown-content-wrapper_qwoo0_1tzz2_99:not(#\9) {
246
- border-block: var(--border-field-width-yoy972, 1px) solid var(--color-border-container-top-9shhmi, #eaeded);
247
- border-inline: var(--border-field-width-yoy972, 1px) solid var(--color-border-container-top-9shhmi, #eaeded);
248
- }
249
- }
250
- .awsui_dropdown-content-wrapper_qwoo0_1tzz2_99.awsui_is-empty_qwoo0_1tzz2_248:not(#\9)::after {
244
+ .awsui_dropdown-content-wrapper_qwoo0_se6og_99.awsui_is-empty_qwoo0_se6og_242:not(#\9)::after {
251
245
  display: none;
252
246
  }
253
- .awsui_dropdown_qwoo0_1tzz2_99 > .awsui_dropdown-content-wrapper_qwoo0_1tzz2_99:not(#\9) {
247
+ .awsui_dropdown_qwoo0_se6og_99 > .awsui_dropdown-content-wrapper_qwoo0_se6og_99:not(#\9) {
254
248
  border-block-start: var(--border-divider-list-width-471u6a, 1px) solid var(--color-border-container-top-9shhmi, #eaeded);
255
249
  border-block-end: var(--border-divider-list-width-471u6a, 1px) solid var(--color-border-dropdown-group-mkqzrv, #eaeded);
256
250
  }
257
- .awsui_dropdown-drop-up_qwoo0_1tzz2_255 > .awsui_dropdown-content-wrapper_qwoo0_1tzz2_99:not(#\9) {
251
+ .awsui_dropdown-drop-up_qwoo0_se6og_249 > .awsui_dropdown-content-wrapper_qwoo0_se6og_99:not(#\9) {
258
252
  transform-origin: bottom;
259
253
  box-shadow: var(--shadow-dropup-ovsp4h, 0 -1px 1px 0 rgba(0, 28, 36, 0.3), 1px -1px 1px 0 rgba(0, 28, 36, 0.15), -1px -1px 1px 0 rgba(0, 28, 36, 0.15));
260
254
  }
261
- .awsui_dropdown-drop-up_qwoo0_1tzz2_255.awsui_with-limited-width_qwoo0_1tzz2_259 > .awsui_dropdown-content-wrapper_qwoo0_1tzz2_99:not(#\9) {
255
+ .awsui_dropdown-drop-up_qwoo0_se6og_249.awsui_with-limited-width_qwoo0_se6og_253 > .awsui_dropdown-content-wrapper_qwoo0_se6og_99:not(#\9) {
262
256
  border-block-start: none;
263
257
  }
264
- .awsui_dropdown-drop-left_qwoo0_1tzz2_262:not(#\9) {
258
+ .awsui_dropdown-drop-left_qwoo0_se6og_256:not(#\9) {
265
259
  inset-inline-end: 0;
266
260
  }
267
- .awsui_dropdown-drop-left_qwoo0_1tzz2_262:not(#\9):dir(rtl) {
261
+ .awsui_dropdown-drop-left_qwoo0_se6og_256:not(#\9):dir(rtl) {
268
262
  inset-inline-end: unset;
269
263
  }
270
- .awsui_dropdown-drop-right_qwoo0_1tzz2_268:not(#\9) {
264
+ .awsui_dropdown-drop-right_qwoo0_se6og_262:not(#\9) {
271
265
  inset-inline-start: 0;
272
266
  }
273
- .awsui_dropdown-drop-right_qwoo0_1tzz2_268:not(#\9):dir(rtl) {
267
+ .awsui_dropdown-drop-right_qwoo0_se6og_262:not(#\9):dir(rtl) {
274
268
  inset-inline-start: unset;
275
269
  }
276
- .awsui_dropdown_qwoo0_1tzz2_99.awsui_occupy-entire-width_qwoo0_1tzz2_274:not(#\9) {
270
+ .awsui_dropdown_qwoo0_se6og_99.awsui_occupy-entire-width_qwoo0_se6og_268:not(#\9) {
277
271
  min-inline-size: 100%;
278
272
  }
279
- .awsui_dropdown_qwoo0_1tzz2_99.awsui_stretch-beyond-trigger-width_qwoo0_1tzz2_277:not(#\9) {
273
+ .awsui_dropdown_qwoo0_se6og_99.awsui_stretch-beyond-trigger-width_qwoo0_se6og_271:not(#\9) {
280
274
  inline-size: max-content;
281
275
  max-inline-size: var(--awsui-dropdown-default-max-width-7t5ed6, 100%);
282
276
  }
283
- .awsui_dropdown_qwoo0_1tzz2_99.awsui_interior_qwoo0_1tzz2_185 > .awsui_dropdown-content-wrapper_qwoo0_1tzz2_99:not(#\9) {
277
+ .awsui_dropdown_qwoo0_se6og_99.awsui_interior_qwoo0_se6og_185 > .awsui_dropdown-content-wrapper_qwoo0_se6og_99:not(#\9) {
284
278
  margin-block-start: -1px;
285
279
  }
286
- .awsui_dropdown_qwoo0_1tzz2_99.awsui_hide-block-border_qwoo0_1tzz2_284 > .awsui_dropdown-content-wrapper_qwoo0_1tzz2_99:not(#\9) {
280
+ .awsui_dropdown_qwoo0_se6og_99.awsui_hide-block-border_qwoo0_se6og_278 > .awsui_dropdown-content-wrapper_qwoo0_se6og_99:not(#\9) {
287
281
  border-block-start: none;
288
282
  }
289
- .awsui_dropdown_qwoo0_1tzz2_99.awsui_hide-block-border_qwoo0_1tzz2_284:not(#\9):not(.awsui_dropdown-drop-up_qwoo0_1tzz2_255) > .awsui_dropdown-content-wrapper_qwoo0_1tzz2_99 {
283
+ .awsui_dropdown_qwoo0_se6og_99.awsui_hide-block-border_qwoo0_se6og_278:not(#\9):not(.awsui_dropdown-drop-up_qwoo0_se6og_249) > .awsui_dropdown-content-wrapper_qwoo0_se6og_99 {
290
284
  border-block-end: none;
291
285
  }
292
- .awsui_dropdown_qwoo0_1tzz2_99.awsui_hide-block-border_qwoo0_1tzz2_284.awsui_refresh_qwoo0_1tzz2_120 > .awsui_dropdown-content-wrapper_qwoo0_1tzz2_99:not(#\9) {
286
+ .awsui_dropdown_qwoo0_se6og_99.awsui_hide-block-border_qwoo0_se6og_278.awsui_refresh_qwoo0_se6og_120 > .awsui_dropdown-content-wrapper_qwoo0_se6og_99:not(#\9) {
293
287
  border-block-end: none;
294
288
  }
295
- .awsui_dropdown_qwoo0_1tzz2_99.awsui_open_qwoo0_1tzz2_293:not(#\9) {
289
+ .awsui_dropdown_qwoo0_se6og_99.awsui_open_qwoo0_se6og_287:not(#\9) {
296
290
  display: block;
297
291
  }
298
- .awsui_dropdown_qwoo0_1tzz2_99.awsui_open_qwoo0_1tzz2_293:not(#\9):not(.awsui_interior_qwoo0_1tzz2_185).awsui_refresh_qwoo0_1tzz2_120[data-animating=true] {
292
+ .awsui_dropdown_qwoo0_se6og_99.awsui_open_qwoo0_se6og_287:not(#\9):not(.awsui_interior_qwoo0_se6og_185).awsui_refresh_qwoo0_se6og_120[data-animating=true] {
299
293
  transform: translateY(4px);
300
294
  }
301
- .awsui_dropdown_qwoo0_1tzz2_99.awsui_open_qwoo0_1tzz2_293:not(#\9):not(.awsui_interior_qwoo0_1tzz2_185).awsui_refresh_qwoo0_1tzz2_120[data-animating=true].awsui_dropdown-drop-up_qwoo0_1tzz2_255 {
295
+ .awsui_dropdown_qwoo0_se6og_99.awsui_open_qwoo0_se6og_287:not(#\9):not(.awsui_interior_qwoo0_se6og_185).awsui_refresh_qwoo0_se6og_120[data-animating=true].awsui_dropdown-drop-up_qwoo0_se6og_249 {
302
296
  transform: translateY(-4px);
303
297
  }
304
- .awsui_dropdown_qwoo0_1tzz2_99.awsui_open_qwoo0_1tzz2_293.awsui_nowrap_qwoo0_1tzz2_302:not(#\9) {
298
+ .awsui_dropdown_qwoo0_se6og_99.awsui_open_qwoo0_se6og_287.awsui_nowrap_qwoo0_se6og_296:not(#\9) {
305
299
  white-space: nowrap;
306
300
  overflow: scroll;
307
301
  }
308
302
 
309
- .awsui_dropdown-content_qwoo0_1tzz2_99:not(#\9) {
303
+ .awsui_dropdown-content_qwoo0_se6og_99:not(#\9) {
310
304
  display: flex;
311
305
  flex-direction: column;
312
306
  inline-size: 100%;
313
307
  }
314
308
 
315
- .awsui_stretch-trigger-height_qwoo0_1tzz2_313:not(#\9) {
309
+ .awsui_stretch-trigger-height_qwoo0_se6og_307:not(#\9) {
316
310
  block-size: 100%;
317
311
  }
@@ -2,25 +2,25 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "dropdown-content-wrapper": "awsui_dropdown-content-wrapper_qwoo0_1tzz2_99",
6
- "awsui-motion-fade-in-dropdown": "awsui_awsui-motion-fade-in-dropdown_qwoo0_1tzz2_1",
7
- "refresh": "awsui_refresh_qwoo0_1tzz2_120",
8
- "awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-0_qwoo0_1tzz2_1",
9
- "root": "awsui_root_qwoo0_1tzz2_149",
10
- "interior": "awsui_interior_qwoo0_1tzz2_185",
11
- "dropdown": "awsui_dropdown_qwoo0_1tzz2_99",
12
- "use-portal": "awsui_use-portal_qwoo0_1tzz2_196",
13
- "is-empty": "awsui_is-empty_qwoo0_1tzz2_248",
14
- "dropdown-drop-up": "awsui_dropdown-drop-up_qwoo0_1tzz2_255",
15
- "with-limited-width": "awsui_with-limited-width_qwoo0_1tzz2_259",
16
- "dropdown-drop-left": "awsui_dropdown-drop-left_qwoo0_1tzz2_262",
17
- "dropdown-drop-right": "awsui_dropdown-drop-right_qwoo0_1tzz2_268",
18
- "occupy-entire-width": "awsui_occupy-entire-width_qwoo0_1tzz2_274",
19
- "stretch-beyond-trigger-width": "awsui_stretch-beyond-trigger-width_qwoo0_1tzz2_277",
20
- "hide-block-border": "awsui_hide-block-border_qwoo0_1tzz2_284",
21
- "open": "awsui_open_qwoo0_1tzz2_293",
22
- "nowrap": "awsui_nowrap_qwoo0_1tzz2_302",
23
- "dropdown-content": "awsui_dropdown-content_qwoo0_1tzz2_99",
24
- "stretch-trigger-height": "awsui_stretch-trigger-height_qwoo0_1tzz2_313"
5
+ "dropdown-content-wrapper": "awsui_dropdown-content-wrapper_qwoo0_se6og_99",
6
+ "awsui-motion-fade-in-dropdown": "awsui_awsui-motion-fade-in-dropdown_qwoo0_se6og_1",
7
+ "refresh": "awsui_refresh_qwoo0_se6og_120",
8
+ "awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-0_qwoo0_se6og_1",
9
+ "root": "awsui_root_qwoo0_se6og_149",
10
+ "interior": "awsui_interior_qwoo0_se6og_185",
11
+ "dropdown": "awsui_dropdown_qwoo0_se6og_99",
12
+ "use-portal": "awsui_use-portal_qwoo0_se6og_196",
13
+ "is-empty": "awsui_is-empty_qwoo0_se6og_242",
14
+ "dropdown-drop-up": "awsui_dropdown-drop-up_qwoo0_se6og_249",
15
+ "with-limited-width": "awsui_with-limited-width_qwoo0_se6og_253",
16
+ "dropdown-drop-left": "awsui_dropdown-drop-left_qwoo0_se6og_256",
17
+ "dropdown-drop-right": "awsui_dropdown-drop-right_qwoo0_se6og_262",
18
+ "occupy-entire-width": "awsui_occupy-entire-width_qwoo0_se6og_268",
19
+ "stretch-beyond-trigger-width": "awsui_stretch-beyond-trigger-width_qwoo0_se6og_271",
20
+ "hide-block-border": "awsui_hide-block-border_qwoo0_se6og_278",
21
+ "open": "awsui_open_qwoo0_se6og_287",
22
+ "nowrap": "awsui_nowrap_qwoo0_se6og_296",
23
+ "dropdown-content": "awsui_dropdown-content_qwoo0_se6og_99",
24
+ "stretch-trigger-height": "awsui_stretch-trigger-height_qwoo0_se6og_307"
25
25
  };
26
26
 
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ export default function ResizeHandleIcon({ className }: {
3
+ className?: string;
4
+ }): JSX.Element;
5
+ //# sourceMappingURL=icon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/panel-resize-handle/icon.tsx"],"names":[],"mappings":";AAIA,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,eAe7E"}
@@ -0,0 +1,9 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import React from 'react';
4
+ export default function ResizeHandleIcon({ className }) {
5
+ return (React.createElement("svg", { focusable: false, className: className, xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", "aria-hidden": true },
6
+ React.createElement("line", { strokeWidth: "2", x1: "2", y1: "5", x2: "14", y2: "5" }),
7
+ React.createElement("line", { strokeWidth: "2", x1: "14", y1: "10", x2: "2", y2: "10" })));
8
+ }
9
+ //# sourceMappingURL=icon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icon.js","sourceRoot":"","sources":["../../../../../src/internal/components/panel-resize-handle/icon.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EAAE,SAAS,EAA0B;IAC5E,OAAO,CACL,6BACE,SAAS,EAAE,KAAK,EAChB,SAAS,EAAE,SAAS,EACpB,KAAK,EAAC,4BAA4B,EAClC,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,iBACN,IAAI;QAEjB,8BAAM,WAAW,EAAC,GAAG,EAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,GAAG,GAAG;QACrD,8BAAM,WAAW,EAAC,GAAG,EAAC,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,IAAI,GAAG,CACnD,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nexport default function ResizeHandleIcon({ className }: { className?: string }) {\n return (\n <svg\n focusable={false}\n className={className}\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n aria-hidden={true}\n >\n <line strokeWidth=\"2\" x1=\"2\" y1=\"5\" x2=\"14\" y2=\"5\" />\n <line strokeWidth=\"2\" x1=\"14\" y1=\"10\" x2=\"2\" y2=\"10\" />\n </svg>\n );\n}\n"]}
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ interface ResizeHandleProps {
3
+ className?: string;
4
+ ariaLabel: string | undefined;
5
+ position: 'side' | 'bottom';
6
+ ariaValuenow: number;
7
+ onKeyDown: (event: React.KeyboardEvent<HTMLElement>) => void;
8
+ onPointerDown: (event: React.PointerEvent<HTMLElement>) => void;
9
+ }
10
+ declare const _default: React.ForwardRefExoticComponent<ResizeHandleProps & React.RefAttributes<HTMLDivElement>>;
11
+ export default _default;
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/panel-resize-handle/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,UAAU,iBAAiB;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAC7D,aAAa,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;CACjE;;AAED,wBAoBG"}
@@ -0,0 +1,11 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import clsx from 'clsx';
4
+ import React from 'react';
5
+ import ResizeHandleIcon from './icon';
6
+ import styles from './styles.css.js';
7
+ export default React.forwardRef(function PanelResizeHandle({ className, ariaLabel, ariaValuenow, position, onKeyDown, onPointerDown }, ref) {
8
+ return (React.createElement("div", { ref: ref, className: clsx(className, styles.slider, styles[`slider-${position}`]), role: "slider", tabIndex: 0, "aria-label": ariaLabel, "aria-valuemax": 100, "aria-valuemin": 0, "aria-valuenow": ariaValuenow, onKeyDown: onKeyDown, onPointerDown: onPointerDown },
9
+ React.createElement(ResizeHandleIcon, { className: clsx(styles['slider-icon'], styles[`slider-icon-${position}`]) })));
10
+ });
11
+ //# sourceMappingURL=index.js.map