@cloudscape-design/components-themeable 3.0.1405 → 3.0.1406

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 (234) hide show
  1. package/lib/internal/manifest.json +1 -1
  2. package/lib/internal/scss/action-card/styles.scss +7 -13
  3. package/lib/internal/scss/autosuggest/styles.scss +1 -1
  4. package/lib/internal/scss/button/styles.scss +5 -1
  5. package/lib/internal/scss/button-dropdown/category-elements/styles.scss +1 -0
  6. package/lib/internal/scss/button-dropdown/styles.scss +1 -1
  7. package/lib/internal/scss/button-group/styles.scss +1 -1
  8. package/lib/internal/scss/container/styles.scss +3 -25
  9. package/lib/internal/scss/dropdown/styles.scss +1 -11
  10. package/lib/internal/scss/flashbar/collapsible.scss +1 -5
  11. package/lib/internal/scss/flashbar/styles.scss +2 -10
  12. package/lib/internal/scss/input/styles.scss +2 -3
  13. package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +1 -1
  14. package/lib/internal/scss/item-card/styles.scss +4 -21
  15. package/lib/internal/scss/multiselect/styles.scss +2 -5
  16. package/lib/internal/scss/panel-layout/styles.scss +9 -6
  17. package/lib/internal/scss/progress-bar/styles.scss +1 -1
  18. package/lib/internal/scss/prompt-input/styles.scss +3 -21
  19. package/lib/internal/scss/radio-button/styles.scss +9 -1
  20. package/lib/internal/scss/radio-group/styles.scss +1 -1
  21. package/lib/internal/scss/segmented-control/segment.scss +3 -3
  22. package/lib/internal/scss/segmented-control/styles.scss +7 -7
  23. package/lib/internal/scss/select/styles.scss +2 -5
  24. package/lib/internal/scss/slider/styles.scss +1 -1
  25. package/lib/internal/scss/table/styles.scss +7 -41
  26. package/lib/internal/scss/tabs/tab-header-bar.scss +3 -30
  27. package/lib/internal/scss/text-filter/styles.scss +1 -8
  28. package/lib/internal/scss/textarea/styles.scss +1 -1
  29. package/lib/internal/scss/toggle/styles.scss +4 -4
  30. package/lib/internal/template/action-card/index.d.ts.map +1 -1
  31. package/lib/internal/template/action-card/index.js +3 -2
  32. package/lib/internal/template/action-card/index.js.map +1 -1
  33. package/lib/internal/template/action-card/interfaces.d.ts +8 -0
  34. package/lib/internal/template/action-card/interfaces.d.ts.map +1 -1
  35. package/lib/internal/template/action-card/interfaces.js.map +1 -1
  36. package/lib/internal/template/action-card/internal.d.ts.map +1 -1
  37. package/lib/internal/template/action-card/internal.js +2 -2
  38. package/lib/internal/template/action-card/internal.js.map +1 -1
  39. package/lib/internal/template/action-card/styles.css.js +19 -18
  40. package/lib/internal/template/action-card/styles.scoped.css +116 -116
  41. package/lib/internal/template/action-card/styles.selectors.js +19 -18
  42. package/lib/internal/template/annotation-context/annotation/annotation-trigger.d.ts.map +1 -1
  43. package/lib/internal/template/annotation-context/annotation/annotation-trigger.js +1 -1
  44. package/lib/internal/template/annotation-context/annotation/annotation-trigger.js.map +1 -1
  45. package/lib/internal/template/autosuggest/styles.css.js +3 -3
  46. package/lib/internal/template/autosuggest/styles.scoped.css +4 -4
  47. package/lib/internal/template/autosuggest/styles.selectors.js +3 -3
  48. package/lib/internal/template/button/styles.css.js +24 -24
  49. package/lib/internal/template/button/styles.scoped.css +81 -81
  50. package/lib/internal/template/button/styles.selectors.js +24 -24
  51. package/lib/internal/template/button-dropdown/internal.js +1 -1
  52. package/lib/internal/template/button-dropdown/internal.js.map +1 -1
  53. package/lib/internal/template/button-dropdown/styles.css.js +23 -23
  54. package/lib/internal/template/button-dropdown/styles.scoped.css +32 -32
  55. package/lib/internal/template/button-dropdown/styles.selectors.js +23 -23
  56. package/lib/internal/template/button-group/internal-interfaces.d.ts +3 -2
  57. package/lib/internal/template/button-group/internal-interfaces.d.ts.map +1 -1
  58. package/lib/internal/template/button-group/internal-interfaces.js.map +1 -1
  59. package/lib/internal/template/button-group/item-element.d.ts.map +1 -1
  60. package/lib/internal/template/button-group/item-element.js +2 -1
  61. package/lib/internal/template/button-group/item-element.js.map +1 -1
  62. package/lib/internal/template/button-group/styles.css.js +4 -4
  63. package/lib/internal/template/button-group/styles.scoped.css +5 -5
  64. package/lib/internal/template/button-group/styles.selectors.js +4 -4
  65. package/lib/internal/template/cards/index.js +1 -1
  66. package/lib/internal/template/cards/index.js.map +1 -1
  67. package/lib/internal/template/container/styles.css.js +33 -33
  68. package/lib/internal/template/container/styles.scoped.css +67 -70
  69. package/lib/internal/template/container/styles.selectors.js +33 -33
  70. package/lib/internal/template/dropdown/internal.d.ts +1 -1
  71. package/lib/internal/template/dropdown/internal.d.ts.map +1 -1
  72. package/lib/internal/template/dropdown/internal.js +1 -1
  73. package/lib/internal/template/dropdown/internal.js.map +1 -1
  74. package/lib/internal/template/dropdown/styles.css.js +20 -20
  75. package/lib/internal/template/dropdown/styles.scoped.css +38 -40
  76. package/lib/internal/template/dropdown/styles.selectors.js +20 -20
  77. package/lib/internal/template/flashbar/collapsible-flashbar.d.ts.map +1 -1
  78. package/lib/internal/template/flashbar/collapsible-flashbar.js +3 -2
  79. package/lib/internal/template/flashbar/collapsible-flashbar.js.map +1 -1
  80. package/lib/internal/template/flashbar/internal-interfaces.d.ts +3 -2
  81. package/lib/internal/template/flashbar/internal-interfaces.d.ts.map +1 -1
  82. package/lib/internal/template/flashbar/internal-interfaces.js.map +1 -1
  83. package/lib/internal/template/flashbar/non-collapsible-flashbar.d.ts.map +1 -1
  84. package/lib/internal/template/flashbar/non-collapsible-flashbar.js +2 -1
  85. package/lib/internal/template/flashbar/non-collapsible-flashbar.js.map +1 -1
  86. package/lib/internal/template/flashbar/styles.css.js +50 -50
  87. package/lib/internal/template/flashbar/styles.scoped.css +148 -151
  88. package/lib/internal/template/flashbar/styles.selectors.js +50 -50
  89. package/lib/internal/template/i18n/messages/all.all.js +1 -1
  90. package/lib/internal/template/i18n/messages/all.all.json +1 -1
  91. package/lib/internal/template/i18n/messages/all.en.js +1 -1
  92. package/lib/internal/template/i18n/messages/all.en.json +1 -1
  93. package/lib/internal/template/i18n/messages/all.ko.js +1 -1
  94. package/lib/internal/template/i18n/messages/all.ko.json +1 -1
  95. package/lib/internal/template/input/styles.css.js +45 -45
  96. package/lib/internal/template/input/styles.scoped.css +91 -91
  97. package/lib/internal/template/input/styles.selectors.js +45 -45
  98. package/lib/internal/template/internal/base-component/styles.scoped.css +1 -1
  99. package/lib/internal/template/internal/components/autosuggest-input/index.js +1 -1
  100. package/lib/internal/template/internal/components/autosuggest-input/index.js.map +1 -1
  101. package/lib/internal/template/internal/components/listbox/use-listbox.d.ts +2 -2
  102. package/lib/internal/template/internal/components/listbox/use-listbox.d.ts.map +1 -1
  103. package/lib/internal/template/internal/components/listbox/use-listbox.js +10 -1
  104. package/lib/internal/template/internal/components/listbox/use-listbox.js.map +1 -1
  105. package/lib/internal/template/internal/environment.js +2 -2
  106. package/lib/internal/template/internal/environment.json +2 -2
  107. package/lib/internal/template/internal/utils/style-slot.d.ts +3 -0
  108. package/lib/internal/template/internal/utils/style-slot.d.ts.map +1 -0
  109. package/lib/internal/template/internal/utils/style-slot.js +6 -0
  110. package/lib/internal/template/internal/utils/style-slot.js.map +1 -0
  111. package/lib/internal/template/item-card/index.d.ts +1 -1
  112. package/lib/internal/template/item-card/index.d.ts.map +1 -1
  113. package/lib/internal/template/item-card/index.js +3 -2
  114. package/lib/internal/template/item-card/index.js.map +1 -1
  115. package/lib/internal/template/item-card/interfaces.d.ts +8 -0
  116. package/lib/internal/template/item-card/interfaces.d.ts.map +1 -1
  117. package/lib/internal/template/item-card/interfaces.js.map +1 -1
  118. package/lib/internal/template/item-card/internal-interfaces.d.ts +0 -4
  119. package/lib/internal/template/item-card/internal-interfaces.d.ts.map +1 -1
  120. package/lib/internal/template/item-card/internal-interfaces.js.map +1 -1
  121. package/lib/internal/template/item-card/internal.d.ts +1 -1
  122. package/lib/internal/template/item-card/internal.d.ts.map +1 -1
  123. package/lib/internal/template/item-card/internal.js +2 -2
  124. package/lib/internal/template/item-card/internal.js.map +1 -1
  125. package/lib/internal/template/item-card/styles.css.js +14 -14
  126. package/lib/internal/template/item-card/styles.scoped.css +61 -66
  127. package/lib/internal/template/item-card/styles.selectors.js +14 -14
  128. package/lib/internal/template/multiselect/internal.js +1 -1
  129. package/lib/internal/template/multiselect/internal.js.map +1 -1
  130. package/lib/internal/template/multiselect/styles.css.js +5 -5
  131. package/lib/internal/template/multiselect/styles.scoped.css +7 -9
  132. package/lib/internal/template/multiselect/styles.selectors.js +5 -5
  133. package/lib/internal/template/option-list/use-option-list.d.ts +2 -2
  134. package/lib/internal/template/option-list/use-option-list.d.ts.map +1 -1
  135. package/lib/internal/template/option-list/use-option-list.js +5 -22
  136. package/lib/internal/template/option-list/use-option-list.js.map +1 -1
  137. package/lib/internal/template/panel-layout/index.d.ts.map +1 -1
  138. package/lib/internal/template/panel-layout/index.js +3 -3
  139. package/lib/internal/template/panel-layout/index.js.map +1 -1
  140. package/lib/internal/template/panel-layout/interfaces.d.ts +9 -2
  141. package/lib/internal/template/panel-layout/interfaces.d.ts.map +1 -1
  142. package/lib/internal/template/panel-layout/interfaces.js.map +1 -1
  143. package/lib/internal/template/panel-layout/internal.d.ts.map +1 -1
  144. package/lib/internal/template/panel-layout/internal.js +3 -3
  145. package/lib/internal/template/panel-layout/internal.js.map +1 -1
  146. package/lib/internal/template/panel-layout/styles.css.js +8 -7
  147. package/lib/internal/template/panel-layout/styles.scoped.css +20 -16
  148. package/lib/internal/template/panel-layout/styles.selectors.js +8 -7
  149. package/lib/internal/template/progress-bar/internal.d.ts +1 -1
  150. package/lib/internal/template/progress-bar/internal.js +1 -1
  151. package/lib/internal/template/progress-bar/internal.js.map +1 -1
  152. package/lib/internal/template/progress-bar/styles.css.js +20 -20
  153. package/lib/internal/template/progress-bar/styles.scoped.css +32 -32
  154. package/lib/internal/template/progress-bar/styles.selectors.js +20 -20
  155. package/lib/internal/template/prompt-input/components/token-mode.js +1 -1
  156. package/lib/internal/template/prompt-input/components/token-mode.js.map +1 -1
  157. package/lib/internal/template/prompt-input/styles.css.js +26 -26
  158. package/lib/internal/template/prompt-input/styles.scoped.css +55 -57
  159. package/lib/internal/template/prompt-input/styles.selectors.js +26 -26
  160. package/lib/internal/template/radio-button/styles.css.js +1 -1
  161. package/lib/internal/template/radio-button/styles.scoped.css +2 -1
  162. package/lib/internal/template/radio-button/styles.selectors.js +1 -1
  163. package/lib/internal/template/radio-group/internal.d.ts +1 -1
  164. package/lib/internal/template/radio-group/internal.d.ts.map +1 -1
  165. package/lib/internal/template/radio-group/internal.js +1 -1
  166. package/lib/internal/template/radio-group/internal.js.map +1 -1
  167. package/lib/internal/template/radio-group/styles.css.js +5 -5
  168. package/lib/internal/template/radio-group/styles.scoped.css +7 -7
  169. package/lib/internal/template/radio-group/styles.selectors.js +5 -5
  170. package/lib/internal/template/segmented-control/styles.css.js +31 -31
  171. package/lib/internal/template/segmented-control/styles.scoped.css +75 -77
  172. package/lib/internal/template/segmented-control/styles.selectors.js +31 -31
  173. package/lib/internal/template/select/internal.js +1 -1
  174. package/lib/internal/template/select/internal.js.map +1 -1
  175. package/lib/internal/template/select/styles.css.js +3 -3
  176. package/lib/internal/template/select/styles.scoped.css +5 -7
  177. package/lib/internal/template/select/styles.selectors.js +3 -3
  178. package/lib/internal/template/slider/styles.css.js +26 -26
  179. package/lib/internal/template/slider/styles.scoped.css +78 -78
  180. package/lib/internal/template/slider/styles.selectors.js +26 -26
  181. package/lib/internal/template/styling/button.scss +7 -1
  182. package/lib/internal/template/styling/dropdown.scss +2 -2
  183. package/lib/internal/template/styling/progress-bar.scss +2 -2
  184. package/lib/internal/template/styling/segmented-control.scss +4 -4
  185. package/lib/internal/template/styling/table.scss +1 -3
  186. package/lib/internal/template/styling/toggle.scss +2 -2
  187. package/lib/internal/template/table/body-cell/disabled-inline-editor.d.ts.map +1 -1
  188. package/lib/internal/template/table/body-cell/disabled-inline-editor.js +1 -1
  189. package/lib/internal/template/table/body-cell/disabled-inline-editor.js.map +1 -1
  190. package/lib/internal/template/table/body-cell/index.d.ts.map +1 -1
  191. package/lib/internal/template/table/body-cell/index.js +1 -1
  192. package/lib/internal/template/table/body-cell/index.js.map +1 -1
  193. package/lib/internal/template/table/header-cell/group-header-cell.d.ts.map +1 -1
  194. package/lib/internal/template/table/header-cell/group-header-cell.js +1 -1
  195. package/lib/internal/template/table/header-cell/group-header-cell.js.map +1 -1
  196. package/lib/internal/template/table/header-cell/index.d.ts.map +1 -1
  197. package/lib/internal/template/table/header-cell/index.js +1 -1
  198. package/lib/internal/template/table/header-cell/index.js.map +1 -1
  199. package/lib/internal/template/table/internal.d.ts.map +1 -1
  200. package/lib/internal/template/table/internal.js +1 -1
  201. package/lib/internal/template/table/internal.js.map +1 -1
  202. package/lib/internal/template/table/selection/selection-cell.d.ts.map +1 -1
  203. package/lib/internal/template/table/selection/selection-cell.js +1 -1
  204. package/lib/internal/template/table/selection/selection-cell.js.map +1 -1
  205. package/lib/internal/template/table/style-api.d.ts +1 -3
  206. package/lib/internal/template/table/style-api.d.ts.map +1 -1
  207. package/lib/internal/template/table/style-api.js +1 -3
  208. package/lib/internal/template/table/style-api.js.map +1 -1
  209. package/lib/internal/template/table/styles.css.js +37 -37
  210. package/lib/internal/template/table/styles.scoped.css +49 -59
  211. package/lib/internal/template/table/styles.selectors.js +37 -37
  212. package/lib/internal/template/tabs/styles.css.js +30 -30
  213. package/lib/internal/template/tabs/styles.scoped.css +50 -57
  214. package/lib/internal/template/tabs/styles.selectors.js +30 -30
  215. package/lib/internal/template/tabs/tab-header-bar.d.ts +3 -2
  216. package/lib/internal/template/tabs/tab-header-bar.d.ts.map +1 -1
  217. package/lib/internal/template/tabs/tab-header-bar.js +2 -1
  218. package/lib/internal/template/tabs/tab-header-bar.js.map +1 -1
  219. package/lib/internal/template/text-filter/styles.css.js +3 -3
  220. package/lib/internal/template/text-filter/styles.scoped.css +3 -4
  221. package/lib/internal/template/text-filter/styles.selectors.js +3 -3
  222. package/lib/internal/template/textarea/styles.css.js +9 -9
  223. package/lib/internal/template/textarea/styles.scoped.css +18 -18
  224. package/lib/internal/template/textarea/styles.selectors.js +9 -9
  225. package/lib/internal/template/toggle/internal.d.ts.map +1 -1
  226. package/lib/internal/template/toggle/internal.js +1 -1
  227. package/lib/internal/template/toggle/internal.js.map +1 -1
  228. package/lib/internal/template/toggle/styles.css.js +10 -10
  229. package/lib/internal/template/toggle/styles.scoped.css +26 -26
  230. package/lib/internal/template/toggle/styles.selectors.js +10 -10
  231. package/lib/internal/template/top-navigation/parts/overflow-menu/menu-item.d.ts.map +1 -1
  232. package/lib/internal/template/top-navigation/parts/overflow-menu/menu-item.js +2 -2
  233. package/lib/internal/template/top-navigation/parts/overflow-menu/menu-item.js.map +1 -1
  234. package/package.json +1 -1
@@ -11,14 +11,12 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
11
11
  inherits: false;
12
12
  }
13
13
  /* awsui:style-api-slot name=trigger tokens=placeholder-color properties=color, background, border, border-radius, box-shadow, padding, font-family, font-size, font-weight */
14
- /* awsui:style-api-description slot=trigger kind=slot name=trigger text=The trigger button, which is also the field box. Pass a different class for the states you control (`invalid`, `warning`, `disabled`, `readOnly`); use `:hover` and `:focus` for interaction states. */
15
- /* awsui:style-api-description slot=trigger kind=property name=color text=The placeholder is styled with `--awsui-style-placeholder-color`. */
16
- /* awsui:style-api-description slot=trigger kind=property name=box-shadow text=Also draws the focus ring under `:focus`. */
14
+ /* awsui:style-api-description slot=trigger kind=property name=box-shadow text=Also draws the focus ring. */
17
15
  /* awsui:style-api-slot name=inlineLabel tokens= properties=color, background, font-family, font-size, font-weight */
18
16
  /* awsui:style-api-slot name=filter component=input */
19
- /* awsui:style-api-slot name=dropdown component=dropdown slot=container */
17
+ /* awsui:style-api-slot name=dropdown component=dropdown slot=root */
20
18
  /* awsui:style-api-slot name=token component=token */
21
- .awsui_root_f8g6q_1fz2e_21:not(#\9) {
19
+ .awsui_root_f8g6q_v0dc1_19:not(#\9) {
22
20
  border-collapse: separate;
23
21
  border-spacing: 0;
24
22
  box-sizing: border-box;
@@ -50,7 +48,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
50
48
  -moz-osx-font-smoothing: auto;
51
49
  }
52
50
 
53
- .awsui_embedded_f8g6q_1fz2e_53:not(#\9) {
51
+ .awsui_embedded_f8g6q_v0dc1_51:not(#\9) {
54
52
  border-collapse: separate;
55
53
  border-spacing: 0;
56
54
  box-sizing: border-box;
@@ -83,16 +81,16 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
83
81
  display: contents;
84
82
  }
85
83
 
86
- .awsui_tokens_f8g6q_1fz2e_86:not(#\9) {
84
+ .awsui_tokens_f8g6q_v0dc1_84:not(#\9) {
87
85
  margin-block-start: var(--space-scaled-xs-pajbd1, 8px);
88
86
  }
89
87
 
90
- .awsui_dropdown-header_f8g6q_1fz2e_90:not(#\9) {
88
+ .awsui_dropdown-header_f8g6q_v0dc1_88:not(#\9) {
91
89
  inline-size: 100%;
92
90
  position: relative;
93
91
  z-index: 4;
94
92
  }
95
93
 
96
- .awsui_dropdown-footer_f8g6q_1fz2e_96:not(#\9) {
94
+ .awsui_dropdown-footer_f8g6q_v0dc1_94:not(#\9) {
97
95
  inline-size: 100%;
98
96
  }
@@ -2,10 +2,10 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "root": "awsui_root_f8g6q_1fz2e_21",
6
- "embedded": "awsui_embedded_f8g6q_1fz2e_53",
7
- "tokens": "awsui_tokens_f8g6q_1fz2e_86",
8
- "dropdown-header": "awsui_dropdown-header_f8g6q_1fz2e_90",
9
- "dropdown-footer": "awsui_dropdown-footer_f8g6q_1fz2e_96"
5
+ "root": "awsui_root_f8g6q_v0dc1_19",
6
+ "embedded": "awsui_embedded_f8g6q_v0dc1_51",
7
+ "tokens": "awsui_tokens_f8g6q_v0dc1_84",
8
+ "dropdown-header": "awsui_dropdown-header_f8g6q_v0dc1_88",
9
+ "dropdown-footer": "awsui_dropdown-footer_f8g6q_v0dc1_94"
10
10
  };
11
11
 
@@ -11,8 +11,8 @@ interface UseOptionListProps extends Pick<UseListboxProps, 'getParent' | 'select
11
11
  }
12
12
  /**
13
13
  * The list state of OptionList: the shared `useListbox` with OptionList's settings, plus the parts of a list that is
14
- * always visible. The list is a tab stop; keyboard, mouse and aria-activedescendant come from `useListbox`.
15
- * This hook adds focus and blur, the mouse-leave reset and type-ahead.
14
+ * always visible. The list is a tab stop; keyboard, mouse, focus, blur and aria-activedescendant come from
15
+ * `useListbox`. This hook adds the mouse-leave reset and type-ahead.
16
16
  */
17
17
  export declare function useOptionList({ options, selection, onSelect, getParent, selectedAriaLabel, renderHighlightedAriaLive, }: UseOptionListProps): {
18
18
  listRef: import("react").RefObject<HTMLDivElement>;
@@ -1 +1 @@
1
- {"version":3,"file":"use-option-list.d.ts","sourceRoot":"","sources":["../../../src/option-list/use-option-list.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,qDAAqD,CAAC;AACrF,OAAO,EAAc,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAEzF,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAE1E,UAAU,kBACR,SAAQ,IAAI,CAAC,eAAe,EAAE,WAAW,GAAG,mBAAmB,GAAG,2BAA2B,CAAC;IAC9F,uCAAuC;IACvC,OAAO,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC;IACvC,SAAS,EAAE,cAAc,CAAC;IAC1B,yDAAyD;IACzD,QAAQ,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,CAAC;CAC5C;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,SAAS,EACT,QAAQ,EACR,SAAS,EACT,iBAAiB,EACjB,yBAAyB,GAC1B,EAAE,kBAAkB;;;;;;;;;;;EA0EpB"}
1
+ {"version":3,"file":"use-option-list.d.ts","sourceRoot":"","sources":["../../../src/option-list/use-option-list.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,qDAAqD,CAAC;AACrF,OAAO,EAAc,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAEzF,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAE1E,UAAU,kBACR,SAAQ,IAAI,CAAC,eAAe,EAAE,WAAW,GAAG,mBAAmB,GAAG,2BAA2B,CAAC;IAC9F,uCAAuC;IACvC,OAAO,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC;IACvC,SAAS,EAAE,cAAc,CAAC;IAC1B,yDAAyD;IACzD,QAAQ,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,CAAC;CAC5C;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,SAAS,EACT,QAAQ,EACR,SAAS,EACT,iBAAiB,EACjB,yBAAyB,GAC1B,EAAE,kBAAkB;;;;;;;;;;;EAwDpB"}
@@ -2,11 +2,11 @@ import { useListbox } from '../internal/components/listbox/use-listbox';
2
2
  import { useTypeAhead } from '../internal/components/listbox/use-type-ahead';
3
3
  /**
4
4
  * The list state of OptionList: the shared `useListbox` with OptionList's settings, plus the parts of a list that is
5
- * always visible. The list is a tab stop; keyboard, mouse and aria-activedescendant come from `useListbox`.
6
- * This hook adds focus and blur, the mouse-leave reset and type-ahead.
5
+ * always visible. The list is a tab stop; keyboard, mouse, focus, blur and aria-activedescendant come from
6
+ * `useListbox`. This hook adds the mouse-leave reset and type-ahead.
7
7
  */
8
8
  export function useOptionList({ options, selection, onSelect, getParent, selectedAriaLabel, renderHighlightedAriaLive, }) {
9
- const { listRef, getListProps, scrollToIndex, highlightType, announcement, getOptionProps, highlightedOption, highlight, selectedOptions, } = useListbox({
9
+ const { listRef, getListProps, scrollToIndex, highlightType, announcement, getOptionProps, highlightedOption, highlight, } = useListbox({
10
10
  options,
11
11
  selectedOptions: selection.selectedOptions,
12
12
  selection,
@@ -18,26 +18,9 @@ export function useOptionList({ options, selection, onSelect, getParent, selecte
18
18
  selectedAriaLabel,
19
19
  renderHighlightedAriaLive,
20
20
  });
21
- // Focus entry, like opening Select or Multiselect with the keyboard: highlight the first selected option (in
22
- // selection order) and scroll it into view, or the first option when nothing in the list is selected.
23
- // A highlight that is already there, such as a hover highlight, is kept, so a click selects the hovered option.
24
- const onFocus = () => {
25
- if (highlightedOption) {
26
- return;
27
- }
28
- const firstSelected = selectedOptions.find(option => options.includes(option));
29
- if (firstSelected) {
30
- highlight.highlightOptionWithKeyboard(firstSelected);
31
- }
32
- else {
33
- highlight.goHomeWithKeyboard();
34
- }
35
- };
36
21
  const listProps = {
37
- ...getListProps({ withKeyboard: true }),
38
- onFocus,
39
- // Like closing Select or Multiselect, leaving the list clears the highlight.
40
- onBlur: () => highlight.resetHighlightWithKeyboard(),
22
+ // Focus highlights the first selected option, and blur clears the highlight.
23
+ ...getListProps({ withKeyboard: true, embedded: true }),
41
24
  open: true,
42
25
  // The list element is a tab stop without dropdown corners.
43
26
  embedded: true,
@@ -1 +1 @@
1
- {"version":3,"file":"use-option-list.js","sourceRoot":"","sources":["../../../src/option-list/use-option-list.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAmB,MAAM,4CAA4C,CAAC;AACzF,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAY7E;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,EAC5B,OAAO,EACP,SAAS,EACT,QAAQ,EACR,SAAS,EACT,iBAAiB,EACjB,yBAAyB,GACN;IACnB,MAAM,EACJ,OAAO,EACP,YAAY,EACZ,aAAa,EACb,aAAa,EACb,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,SAAS,EACT,eAAe,GAChB,GAAG,UAAU,CAAC;QACb,OAAO;QACP,eAAe,EAAE,SAAS,CAAC,eAAe;QAC1C,SAAS;Q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AAjB,iBAAiB,CAAE,MAAM;QAC5C,iBAAiB,EAAE,SAAS,CAAC,iBAAiB;KAC/C,CAAC,CAAC;IAEH,OAAO;QACL,OAAO;QACP,SAAS;QACT,aAAa;QACb,aAAa;QACb,YAAY;QACZ,cAAc;QACd,YAAY,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC;KAC/D,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ListElementProps } from '../internal/components/listbox/interfaces';\nimport { SelectionModel } from '../internal/components/listbox/selection/interfaces';\nimport { useListbox, UseListboxProps } from '../internal/components/listbox/use-listbox';\nimport { useTypeAhead } from '../internal/components/listbox/use-type-ahead';\nimport { DropdownOption } from '../internal/components/option/interfaces';\n\ninterface UseOptionListProps\n extends Pick<UseListboxProps, 'getParent' | 'selectedAriaLabel' | 'renderHighlightedAriaLive'> {\n /** Flattened options in list order. */\n options: ReadonlyArray<DropdownOption>;\n selection: SelectionModel;\n /** Called with the interactive option the user chose. */\n onSelect: (option: DropdownOption) => void;\n}\n\n/**\n * The list state of OptionList: the shared `useListbox` with OptionList's settings, plus the parts of a list that is\n * always visible. The list is a tab stop; keyboard, mouse and aria-activedescendant come from `useListbox`.\n * This hook adds focus and blur, the mouse-leave reset and type-ahead.\n */\nexport function useOptionList({\n options,\n selection,\n onSelect,\n getParent,\n selectedAriaLabel,\n renderHighlightedAriaLive,\n}: UseOptionListProps) {\n const {\n listRef,\n getListProps,\n scrollToIndex,\n highlightType,\n announcement,\n getOptionProps,\n highlightedOption,\n highlight,\n selectedOptions,\n } = useListbox({\n options,\n selectedOptions: selection.selectedOptions,\n selection,\n interactiveGroups: selection.interactiveGroups,\n onSelect,\n // When the list has focus, Space always chooses.\n spaceSelects: 'always',\n getParent,\n selectedAriaLabel,\n renderHighlightedAriaLive,\n });\n\n // Focus entry, like opening Select or Multiselect with the keyboard: highlight the first selected option (in\n // selection order) and scroll it into view, or the first option when nothing in the list is selected.\n // A highlight that is already there, such as a hover highlight, is kept, so a click selects the hovered option.\n const onFocus = () => {\n if (highlightedOption) {\n return;\n }\n const firstSelected = selectedOptions.find(option => options.includes(option));\n if (firstSelected) {\n highlight.highlightOptionWithKeyboard(firstSelected);\n } else {\n highlight.goHomeWithKeyboard();\n }\n };\n\n const listProps: ListElementProps = {\n ...getListProps({ withKeyboard: true }),\n onFocus,\n // Like closing Select or Multiselect, leaving the list clears the highlight.\n onBlur: () => highlight.resetHighlightWithKeyboard(),\n open: true,\n // The list element is a tab stop without dropdown corners.\n embedded: true,\n isMultiSelect: selection.selectionType === 'multi' || undefined,\n };\n\n // Attached to the root, not the list, so leaving the whole component clears a hover highlight.\n const onMouseLeave = () => {\n if (listRef.current !== document.activeElement) {\n highlight.resetHighlightWithKeyboard();\n }\n };\n\n const onTypeAhead = useTypeAhead({\n isEnabled: true,\n options,\n highlightOption: highlight.highlightOptionWithKeyboard,\n highlightedOption: highlightedOption?.option,\n interactiveGroups: selection.interactiveGroups,\n });\n\n return {\n listRef,\n listProps,\n scrollToIndex,\n highlightType,\n announcement,\n getOptionProps,\n getRootProps: () => ({ onKeyDown: onTypeAhead, onMouseLeave }),\n };\n}\n"]}
1
+ {"version":3,"file":"use-option-list.js","sourceRoot":"","sources":["../../../src/option-list/use-option-list.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAmB,MAAM,4CAA4C,CAAC;AACzF,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAY7E;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,EAC5B,OAAO,EACP,SAAS,EACT,QAAQ,EACR,SAAS,EACT,iBAAiB,EACjB,yBAAyB,GACN;IACnB,MAAM,EACJ,OAAO,EACP,YAAY,EACZ,aAAa,EACb,aAAa,EACb,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,SAAS,GACV,GAAG,UAAU,CAAC;QACb,OAAO;QACP,eAAe,EAAE,SAAS,CAAC,eAAe;QAC1C,SAAS;QACT,iBAAiB,EAAE,SAAS,CAAC,iBAAiB;QAC9C,QAAQ;QACR,iDAAiD;QACjD,YAAY,EAAE,QAAQ;QACtB,SAAS;QACT,iBAAiB;QACjB,yBAAyB;KAC1B,CAAC,CAAC;IAEH,MAAM,SAAS,GAAqB;QAClC,6EAA6E;QAC7E,GAAG,YAAY,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;QACvD,IAAI,EAAE,IAAI;QACV,2DAA2D;QAC3D,QAAQ,EAAE,IAAI;QACd,aAAa,EAAE,SAAS,CAAC,aAAa,KAAK,OAAO,IAAI,SAAS;KAChE,CAAC;IAEF,+FAA+F;IAC/F,MAAM,YAAY,GAAG,GAAG,EAAE;QACxB,IAAI,OAAO,CAAC,OAAO,KAAK,QAAQ,CAAC,aAAa,EAAE,CAAC;YAC/C,SAAS,CAAC,0BAA0B,EAAE,CAAC;QACzC,CAAC;IACH,CAAC,CAAC;IAEF,MAAM,WAAW,GAAG,YAAY,CAAC;QAC/B,SAAS,EAAE,IAAI;QACf,OAAO;QACP,eAAe,EAAE,SAAS,CAAC,2BAA2B;QACtD,iBAAiB,EAAE,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAE,MAAM;QAC5C,iBAAiB,EAAE,SAAS,CAAC,iBAAiB;KAC/C,CAAC,CAAC;IAEH,OAAO;QACL,OAAO;QACP,SAAS;QACT,aAAa;QACb,aAAa;QACb,YAAY;QACZ,cAAc;QACd,YAAY,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC;KAC/D,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ListElementProps } from '../internal/components/listbox/interfaces';\nimport { SelectionModel } from '../internal/components/listbox/selection/interfaces';\nimport { useListbox, UseListboxProps } from '../internal/components/listbox/use-listbox';\nimport { useTypeAhead } from '../internal/components/listbox/use-type-ahead';\nimport { DropdownOption } from '../internal/components/option/interfaces';\n\ninterface UseOptionListProps\n extends Pick<UseListboxProps, 'getParent' | 'selectedAriaLabel' | 'renderHighlightedAriaLive'> {\n /** Flattened options in list order. */\n options: ReadonlyArray<DropdownOption>;\n selection: SelectionModel;\n /** Called with the interactive option the user chose. */\n onSelect: (option: DropdownOption) => void;\n}\n\n/**\n * The list state of OptionList: the shared `useListbox` with OptionList's settings, plus the parts of a list that is\n * always visible. The list is a tab stop; keyboard, mouse, focus, blur and aria-activedescendant come from\n * `useListbox`. This hook adds the mouse-leave reset and type-ahead.\n */\nexport function useOptionList({\n options,\n selection,\n onSelect,\n getParent,\n selectedAriaLabel,\n renderHighlightedAriaLive,\n}: UseOptionListProps) {\n const {\n listRef,\n getListProps,\n scrollToIndex,\n highlightType,\n announcement,\n getOptionProps,\n highlightedOption,\n highlight,\n } = useListbox({\n options,\n selectedOptions: selection.selectedOptions,\n selection,\n interactiveGroups: selection.interactiveGroups,\n onSelect,\n // When the list has focus, Space always chooses.\n spaceSelects: 'always',\n getParent,\n selectedAriaLabel,\n renderHighlightedAriaLive,\n });\n\n const listProps: ListElementProps = {\n // Focus highlights the first selected option, and blur clears the highlight.\n ...getListProps({ withKeyboard: true, embedded: true }),\n open: true,\n // The list element is a tab stop without dropdown corners.\n embedded: true,\n isMultiSelect: selection.selectionType === 'multi' || undefined,\n };\n\n // Attached to the root, not the list, so leaving the whole component clears a hover highlight.\n const onMouseLeave = () => {\n if (listRef.current !== document.activeElement) {\n highlight.resetHighlightWithKeyboard();\n }\n };\n\n const onTypeAhead = useTypeAhead({\n isEnabled: true,\n options,\n highlightOption: highlight.highlightOptionWithKeyboard,\n highlightedOption: highlightedOption?.option,\n interactiveGroups: selection.interactiveGroups,\n });\n\n return {\n listRef,\n listProps,\n scrollToIndex,\n highlightType,\n announcement,\n getOptionProps,\n getRootProps: () => ({ onKeyDown: onTypeAhead, onMouseLeave }),\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/panel-layout/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGhD,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAE5B,QAAA,MAAM,WAAW,+FAyBf,CAAC;AAEH,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/panel-layout/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGhD,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAE5B,QAAA,MAAM,WAAW,+FA0Bf,CAAC;AAEH,eAAe,WAAW,CAAC"}
@@ -6,9 +6,9 @@ import useBaseComponent from '../internal/hooks/use-base-component';
6
6
  import { applyDisplayName } from '../internal/utils/apply-display-name';
7
7
  import { getExternalProps } from '../internal/utils/external-props';
8
8
  import InternalPanelLayout from './internal';
9
- const PanelLayout = React.forwardRef(function PanelLayout({ panelPosition = 'side-start', resizable = false, display = 'all', ...props }, ref) {
9
+ const PanelLayout = React.forwardRef(function PanelLayout({ panelPosition = 'side-start', resizable = false, scrollable = false, display = 'all', ...props }, ref) {
10
10
  const baseComponentProps = useBaseComponent('PanelLayout', {
11
- props: { panelPosition, resizable },
11
+ props: { panelPosition, resizable, scrollable },
12
12
  metadata: {
13
13
  mainFocusable: props.mainFocusable !== undefined,
14
14
  panelFocusable: props.panelFocusable !== undefined,
@@ -18,7 +18,7 @@ const PanelLayout = React.forwardRef(function PanelLayout({ panelPosition = 'sid
18
18
  hasMaxPanelSize: props.maxPanelSize !== undefined,
19
19
  },
20
20
  });
21
- return (React.createElement(InternalPanelLayout, { ref: ref, panelPosition: panelPosition, resizable: resizable, display: display, ...getExternalProps(props), ...baseComponentProps }));
21
+ return (React.createElement(InternalPanelLayout, { ref: ref, panelPosition: panelPosition, resizable: resizable, scrollable: scrollable, display: display, ...getExternalProps(props), ...baseComponentProps }));
22
22
  });
23
23
  export default PanelLayout;
24
24
  applyDisplayName(PanelLayout, 'PanelLayout');
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/panel-layout/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEpE,OAAO,mBAAmB,MAAM,YAAY,CAAC;AAI7C,MAAM,WAAW,GAAG,KAAK,CAAC,UAAU,CAAyC,SAAS,WAAW,CAC/F,EAAE,aAAa,GAAG,YAAY,EAAE,SAAS,GAAG,KAAK,EAAE,OAAO,GAAG,KAAK,EAAE,GAAG,KAAK,EAAE,EAC9E,GAAG;IAEH,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,aAAa,EAAE;QACzD,KAAK,EAAE,EAAE,aAAa,EAAE,SAAS,EAAE;QACnC,QAAQ,EAAE;YACR,aAAa,EAAE,KAAK,CAAC,aAAa,KAAK,SAAS;YAChD,cAAc,EAAE,KAAK,CAAC,cAAc,KAAK,SAAS;YAClD,mBAAmB,EAAE,KAAK,CAAC,gBAAgB,KAAK,SAAS;YACzD,YAAY,EAAE,KAAK,CAAC,SAAS,KAAK,SAAS;YAC3C,eAAe,EAAE,KAAK,CAAC,YAAY,KAAK,SAAS;YACjD,eAAe,EAAE,KAAK,CAAC,YAAY,KAAK,SAAS;SAClD;KACF,CAAC,CAAC;IACH,OAAO,CACL,oBAAC,mBAAmB,IAClB,GAAG,EAAE,GAAG,EACR,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,OAAO,KACZ,gBAAgB,CAAC,KAAK,CAAC,KACvB,kBAAkB,GACtB,CACH,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,WAAW,CAAC;AAE3B,gBAAgB,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n'use client';\nimport React from 'react';\n\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { getExternalProps } from '../internal/utils/external-props';\nimport { PanelLayoutProps } from './interfaces';\nimport InternalPanelLayout from './internal';\n\nexport { PanelLayoutProps };\n\nconst PanelLayout = React.forwardRef<PanelLayoutProps.Ref, PanelLayoutProps>(function PanelLayout(\n { panelPosition = 'side-start', resizable = false, display = 'all', ...props },\n ref\n) {\n const baseComponentProps = useBaseComponent('PanelLayout', {\n props: { panelPosition, resizable },\n metadata: {\n mainFocusable: props.mainFocusable !== undefined,\n panelFocusable: props.panelFocusable !== undefined,\n hasDefaultPanelSize: props.defaultPanelSize !== undefined,\n hasPanelSize: props.panelSize !== undefined,\n hasMinPanelSize: props.minPanelSize !== undefined,\n hasMaxPanelSize: props.maxPanelSize !== undefined,\n },\n });\n return (\n <InternalPanelLayout\n ref={ref}\n panelPosition={panelPosition}\n resizable={resizable}\n display={display}\n {...getExternalProps(props)}\n {...baseComponentProps}\n />\n );\n});\n\nexport default PanelLayout;\n\napplyDisplayName(PanelLayout, 'PanelLayout');\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/panel-layout/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEpE,OAAO,mBAAmB,MAAM,YAAY,CAAC;AAI7C,MAAM,WAAW,GAAG,KAAK,CAAC,UAAU,CAAyC,SAAS,WAAW,CAC/F,EAAE,aAAa,GAAG,YAAY,EAAE,SAAS,GAAG,KAAK,EAAE,UAAU,GAAG,KAAK,EAAE,OAAO,GAAG,KAAK,EAAE,GAAG,KAAK,EAAE,EAClG,GAAG;IAEH,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,aAAa,EAAE;QACzD,KAAK,EAAE,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE;QAC/C,QAAQ,EAAE;YACR,aAAa,EAAE,KAAK,CAAC,aAAa,KAAK,SAAS;YAChD,cAAc,EAAE,KAAK,CAAC,cAAc,KAAK,SAAS;YAClD,mBAAmB,EAAE,KAAK,CAAC,gBAAgB,KAAK,SAAS;YACzD,YAAY,EAAE,KAAK,CAAC,SAAS,KAAK,SAAS;YAC3C,eAAe,EAAE,KAAK,CAAC,YAAY,KAAK,SAAS;YACjD,eAAe,EAAE,KAAK,CAAC,YAAY,KAAK,SAAS;SAClD;KACF,CAAC,CAAC;IACH,OAAO,CACL,oBAAC,mBAAmB,IAClB,GAAG,EAAE,GAAG,EACR,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,OAAO,KACZ,gBAAgB,CAAC,KAAK,CAAC,KACvB,kBAAkB,GACtB,CACH,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,WAAW,CAAC;AAE3B,gBAAgB,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n'use client';\nimport React from 'react';\n\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { getExternalProps } from '../internal/utils/external-props';\nimport { PanelLayoutProps } from './interfaces';\nimport InternalPanelLayout from './internal';\n\nexport { PanelLayoutProps };\n\nconst PanelLayout = React.forwardRef<PanelLayoutProps.Ref, PanelLayoutProps>(function PanelLayout(\n { panelPosition = 'side-start', resizable = false, scrollable = false, display = 'all', ...props },\n ref\n) {\n const baseComponentProps = useBaseComponent('PanelLayout', {\n props: { panelPosition, resizable, scrollable },\n metadata: {\n mainFocusable: props.mainFocusable !== undefined,\n panelFocusable: props.panelFocusable !== undefined,\n hasDefaultPanelSize: props.defaultPanelSize !== undefined,\n hasPanelSize: props.panelSize !== undefined,\n hasMinPanelSize: props.minPanelSize !== undefined,\n hasMaxPanelSize: props.maxPanelSize !== undefined,\n },\n });\n return (\n <InternalPanelLayout\n ref={ref}\n panelPosition={panelPosition}\n resizable={resizable}\n scrollable={scrollable}\n display={display}\n {...getExternalProps(props)}\n {...baseComponentProps}\n />\n );\n});\n\nexport default PanelLayout;\n\napplyDisplayName(PanelLayout, 'PanelLayout');\n"]}
@@ -39,16 +39,23 @@ export interface PanelLayoutProps extends BaseComponentProps {
39
39
  * Main content area displayed next to the panel.
40
40
  */
41
41
  mainContent: ReactNode;
42
+ /**
43
+ * Makes the panel and main content areas scrollable.
44
+ *
45
+ * When setting this property to `true`, make sure that all content, including focus rings of interactive elements,
46
+ * fits within the panels, otherwise it will be clipped.
47
+ */
48
+ scrollable?: boolean;
42
49
  /**
43
50
  * Makes the panel content focusable. This should be used if there are no focusable elements
44
- * inside the panel, to ensure it is keyboard scrollable.
51
+ * inside the panel, to ensure it is keyboard scrollable when `scrollable` is set.
45
52
  *
46
53
  * Provide either `{ariaLabel: "Panel label"}` or `{ariaLabelledby: "panel-label-id"}`
47
54
  */
48
55
  panelFocusable?: PanelLayoutProps.FocusableConfig;
49
56
  /**
50
57
  * Makes the main content area focusable. This should be used if there are no focusable elements
51
- * inside the content, to ensure it is keyboard scrollable.
58
+ * inside the content, to ensure it is keyboard scrollable when `scrollable` is set.
52
59
  *
53
60
  * Provide either `{ariaLabel: "Main label"}` or `{ariaLabelledby: "main-label-id"}`
54
61
  */
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/panel-layout/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAE5D,MAAM,WAAW,gBAAiB,SAAQ,kBAAkB;IAC1D;;OAEG;IACH,aAAa,CAAC,EAAE,gBAAgB,CAAC,aAAa,CAAC;IAE/C;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,YAAY,EAAE,SAAS,CAAC;IAExB;;OAEG;IACH,WAAW,EAAE,SAAS,CAAC;IAEvB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,gBAAgB,CAAC,eAAe,CAAC;IAElD;;;;;OAKG;IACH,aAAa,CAAC,EAAE,gBAAgB,CAAC,eAAe,CAAC;IAEjD;;;;;OAKG;IACH,OAAO,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC;IAEnC;;;OAGG;IACH,WAAW,CAAC,EAAE,gBAAgB,CAAC,WAAW,CAAC;IAE3C;;OAEG;IACH,aAAa,CAAC,EAAE,yBAAyB,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,CAAC;IAE9E;;;OAGG;IACH,c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ACH,WAAW,EAAE,SAAS,CAAC;IAEvB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,gBAAgB,CAAC,eAAe,CAAC;IAElD;;;;;OAKG;IACH,aAAa,CAAC,EAAE,gBAAgB,CAAC,eAAe,CAAC;IAEjD;;;;;OAKG;IACH,OAAO,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC;IAEnC;;;OAGG;IACH,WAAW,CAAC,EAAE,gBAAgB,CAAC,WAAW,CAAC;IAE3C;;OAEG;IACH,aAAa,CAAC,EAAE,yBAAyB,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,CAAC;IAE9E;;;OAGG;IACH,cAAc,CAAC,EAAE,yBAAyB,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,CAAC;CAChF;AAED,yBAAiB,gBAAgB,CAAC;IAChC,KAAY,aAAa,GAAG,YAAY,GAAG,UAAU,CAAC;IACtD,KAAY,OAAO,GAAG,KAAK,GAAG,YAAY,GAAG,WAAW,CAAC;IAEzD,UAAiB,iBAAiB;QAChC,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,MAAM,CAAC;KACnB;IAED,UAAiB,eAAe;QAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB;IAED,UAAiB,WAAW;QAC1B,qBAAqB,CAAC,EAAE,MAAM,CAAC;QAC/B,uBAAuB,CAAC,EAAE,MAAM,CAAC;KAClC;IAED,UAAiB,GAAG;QAClB;;WAEG;QACH,iBAAiB,IAAI,IAAI,CAAC;KAC3B;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/panel-layout/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ReactNode } from 'react';\n\nimport { BaseComponentProps } from '../types/base-component';\nimport { NonCancelableEventHandler } from '../types/events';\n\nexport interface PanelLayoutProps extends BaseComponentProps {\n /**\n * Position of the panel with respect to the main content\n */\n panelPosition?: PanelLayoutProps.PanelPosition;\n\n /**\n * Initial panel size, for uncontrolled behavior.\n *\n * The actual size will be constrained by `minPanelSize` and `maxPanelSize`, if set.\n */\n defaultPanelSize?: number;\n\n /**\n * Size of the panel. If provided, and panel is resizable, the component is controlled,\n * so you must also provide `onPanelResize`.\n *\n * The actual size will be constrained by `minPanelSize` and `maxPanelSize`, if set.\n */\n panelSize?: number;\n\n /**\n * The minimum size of the panel.\n */\n minPanelSize?: number;\n\n /**\n * The maximum size of the panel.\n */\n maxPanelSize?: number;\n\n /**\n * Indicates whether the panel is resizable.\n */\n resizable?: boolean;\n\n /**\n * Panel contents.\n */\n panelContent: ReactNode;\n\n /**\n * Main content area displayed next to the panel.\n */\n mainContent: ReactNode;\n\n /**\n * Makes the panel content focusable. This should be used if there are no focusable elements\n * inside the panel, to ensure it is keyboard scrollable.\n *\n * Provide either `{ariaLabel: \"Panel label\"}` or `{ariaLabelledby: \"panel-label-id\"}`\n */\n panelFocusable?: PanelLayoutProps.FocusableConfig;\n\n /**\n * Makes the main content area focusable. This should be used if there are no focusable elements\n * inside the content, to ensure it is keyboard scrollable.\n *\n * Provide either `{ariaLabel: \"Main label\"}` or `{ariaLabelledby: \"main-label-id\"}`\n */\n mainFocusable?: PanelLayoutProps.FocusableConfig;\n\n /**\n * Determines which content is displayed:\n * - 'all': Both panel and main content are displayed.\n * - 'panel-only': Only panel is displayed.\n * - 'main-only': Only main content is displayed.\n */\n display?: PanelLayoutProps.Display;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n * @i18n\n */\n i18nStrings?: PanelLayoutProps.I18nStrings;\n\n /**\n * Called when the user resizes the panel.\n */\n onPanelResize?: NonCancelableEventHandler<PanelLayoutProps.PanelResizeDetail>;\n\n /**\n * Called when the panel and/or main content size changes. This can be due\n * to user resizing or changes to the available space on the page.\n */\n onLayoutChange?: NonCancelableEventHandler<PanelLayoutProps.PanelResizeDetail>;\n}\n\nexport namespace PanelLayoutProps {\n export type PanelPosition = 'side-start' | 'side-end';\n export type Display = 'all' | 'panel-only' | 'main-only';\n\n export interface PanelResizeDetail {\n totalSize: number;\n panelSize: number;\n }\n\n export interface FocusableConfig {\n ariaLabel?: string;\n ariaLabelledby?: string;\n }\n\n export interface I18nStrings {\n resizeHandleAriaLabel?: string;\n resizeHandleTooltipText?: string;\n }\n\n export interface Ref {\n /**\n * Focuses the resize handle of the panel layout.\n */\n focusResizeHandle(): void;\n }\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/panel-layout/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ReactNode } from 'react';\n\nimport { BaseComponentProps } from '../types/base-component';\nimport { NonCancelableEventHandler } from '../types/events';\n\nexport interface PanelLayoutProps extends BaseComponentProps {\n /**\n * Position of the panel with respect to the main content\n */\n panelPosition?: PanelLayoutProps.PanelPosition;\n\n /**\n * Initial panel size, for uncontrolled behavior.\n *\n * The actual size will be constrained by `minPanelSize` and `maxPanelSize`, if set.\n */\n defaultPanelSize?: number;\n\n /**\n * Size of the panel. If provided, and panel is resizable, the component is controlled,\n * so you must also provide `onPanelResize`.\n *\n * The actual size will be constrained by `minPanelSize` and `maxPanelSize`, if set.\n */\n panelSize?: number;\n\n /**\n * The minimum size of the panel.\n */\n minPanelSize?: number;\n\n /**\n * The maximum size of the panel.\n */\n maxPanelSize?: number;\n\n /**\n * Indicates whether the panel is resizable.\n */\n resizable?: boolean;\n\n /**\n * Panel contents.\n */\n panelContent: ReactNode;\n\n /**\n * Main content area displayed next to the panel.\n */\n mainContent: ReactNode;\n\n /**\n * Makes the panel and main content areas scrollable.\n *\n * When setting this property to `true`, make sure that all content, including focus rings of interactive elements,\n * fits within the panels, otherwise it will be clipped.\n */\n scrollable?: boolean;\n\n /**\n * Makes the panel content focusable. This should be used if there are no focusable elements\n * inside the panel, to ensure it is keyboard scrollable when `scrollable` is set.\n *\n * Provide either `{ariaLabel: \"Panel label\"}` or `{ariaLabelledby: \"panel-label-id\"}`\n */\n panelFocusable?: PanelLayoutProps.FocusableConfig;\n\n /**\n * Makes the main content area focusable. This should be used if there are no focusable elements\n * inside the content, to ensure it is keyboard scrollable when `scrollable` is set.\n *\n * Provide either `{ariaLabel: \"Main label\"}` or `{ariaLabelledby: \"main-label-id\"}`\n */\n mainFocusable?: PanelLayoutProps.FocusableConfig;\n\n /**\n * Determines which content is displayed:\n * - 'all': Both panel and main content are displayed.\n * - 'panel-only': Only panel is displayed.\n * - 'main-only': Only main content is displayed.\n */\n display?: PanelLayoutProps.Display;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n * @i18n\n */\n i18nStrings?: PanelLayoutProps.I18nStrings;\n\n /**\n * Called when the user resizes the panel.\n */\n onPanelResize?: NonCancelableEventHandler<PanelLayoutProps.PanelResizeDetail>;\n\n /**\n * Called when the panel and/or main content size changes. This can be due\n * to user resizing or changes to the available space on the page.\n */\n onLayoutChange?: NonCancelableEventHandler<PanelLayoutProps.PanelResizeDetail>;\n}\n\nexport namespace PanelLayoutProps {\n export type PanelPosition = 'side-start' | 'side-end';\n export type Display = 'all' | 'panel-only' | 'main-only';\n\n export interface PanelResizeDetail {\n totalSize: number;\n panelSize: number;\n }\n\n export interface FocusableConfig {\n ariaLabel?: string;\n ariaLabelledby?: string;\n }\n\n export interface I18nStrings {\n resizeHandleAriaLabel?: string;\n resizeHandleTooltipText?: string;\n }\n\n export interface Ref {\n /**\n * Focuses the resize handle of the panel layout.\n */\n focusResizeHandle(): void;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/panel-layout/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAoB,MAAM,OAAO,CAAC;AASzC,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAIlF,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAUhD,QAAA,MAAM,mBAAmB;;;;2EAsIxB,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/panel-layout/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAoB,MAAM,OAAO,CAAC;AASzC,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAIlF,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAUhD,QAAA,MAAM,mBAAmB;;;;2EA+IxB,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -12,7 +12,7 @@ import useContainerWidth from '../internal/utils/use-container-width';
12
12
  import styles from './styles.css.js';
13
13
  import testStyles from './test-classes/styles.css.js';
14
14
  const DEFAULT_PANEL_SIZE = 200;
15
- const InternalPanelLayout = React.forwardRef(({ panelPosition, panelContent, mainContent, defaultPanelSize, panelSize: controlledPanelSize, resizable, onPanelResize, onLayoutChange, minPanelSize, maxPanelSize, i18nStrings, display, panelFocusable, mainFocusable, __internalRootRef, ...props }, ref) => {
15
+ const InternalPanelLayout = React.forwardRef(({ panelPosition, panelContent, mainContent, defaultPanelSize, panelSize: controlledPanelSize, resizable, onPanelResize, onLayoutChange, minPanelSize, maxPanelSize, i18nStrings, display, scrollable, panelFocusable, mainFocusable, __internalRootRef, ...props }, ref) => {
16
16
  const baseProps = getBaseProps(props);
17
17
  const resizeHandleRef = React.useRef(null);
18
18
  const panelRef = React.useRef(null);
@@ -49,8 +49,8 @@ const InternalPanelLayout = React.forwardRef(({ panelPosition, panelContent, mai
49
49
  },
50
50
  });
51
51
  const mergedRef = useMergeRefs(rootRef, __internalRootRef, ref);
52
- const wrappedPanelContent = (React.createElement("div", { className: clsx(styles['panel-content'], display !== 'main-only' && testStyles.panel), tabIndex: panelFocusable && 0, role: panelFocusable && 'region', "aria-label": panelFocusable === null || panelFocusable === void 0 ? void 0 : panelFocusable.ariaLabel, "aria-labelledby": panelFocusable === null || panelFocusable === void 0 ? void 0 : panelFocusable.ariaLabelledby }, panelContent));
53
- const wrappedMainContent = (React.createElement("div", { className: clsx(styles.content, display !== 'panel-only' && testStyles.content), tabIndex: mainFocusable && 0, role: mainFocusable && 'region', "aria-label": mainFocusable === null || mainFocusable === void 0 ? void 0 : mainFocusable.ariaLabel, "aria-labelledby": mainFocusable === null || mainFocusable === void 0 ? void 0 : mainFocusable.ariaLabelledby }, mainContent));
52
+ const wrappedPanelContent = (React.createElement("div", { className: clsx(styles['panel-content'], scrollable && styles.scrollable, display !== 'main-only' && testStyles.panel), tabIndex: panelFocusable && 0, role: panelFocusable && 'region', "aria-label": panelFocusable === null || panelFocusable === void 0 ? void 0 : panelFocusable.ariaLabel, "aria-labelledby": panelFocusable === null || panelFocusable === void 0 ? void 0 : panelFocusable.ariaLabelledby }, panelContent));
53
+ const wrappedMainContent = (React.createElement("div", { className: clsx(styles.content, scrollable && styles.scrollable, display !== 'panel-only' && testStyles.content), tabIndex: mainFocusable && 0, role: mainFocusable && 'region', "aria-label": mainFocusable === null || mainFocusable === void 0 ? void 0 : mainFocusable.ariaLabel, "aria-labelledby": mainFocusable === null || mainFocusable === void 0 ? void 0 : mainFocusable.ariaLabelledby }, mainContent));
54
54
  const handle = (React.createElement("div", { className: styles.handle },
55
55
  React.createElement(PanelResizeHandle, { ref: resizeHandleRef, className: testStyles['resize-handle'], position: resizeHandlePosition, ariaLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.resizeHandleAriaLabel, tooltipText: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.resizeHandleTooltipText, ariaValuenow: resizeProps.relativeSize, onKeyDown: resizeProps.onKeyDown, onDirectionClick: resizeProps.onDirectionClick, onPointerDown: resizeProps.onPointerDown })));
56
56
  return (React.createElement("div", { ...baseProps, ref: mergedRef, className: clsx(baseProps.className, styles.root, testStyles.root, styles[`display-${display}`]) },
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/panel-layout/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAEhG,OAAO,EAAE,SAAS,EAAE,MAAM,wDAAwD,CAAC;AACnF,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,iBAAiB,MAAM,4CAA4C,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAErE,OAAO,iBAAiB,MAAM,uCAAuC,CAAC;AAGtE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,UAAU,MAAM,8BAA8B,CAAC;AAEtD,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAK/B,MAAM,mBAAmB,GAAG,KAAK,CAAC,UAAU,CAC1C,CACE,EACE,aAAa,EACb,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,SAAS,EAAE,mBAAmB,EAC9B,SAAS,EACT,aAAa,EACb,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,OAAO,EACP,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,MAAM,SAAS,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IAEtC,MAAM,eAAe,GAAG,KAAK,CAAC,MAAM,CAAiB,IAAI,CAAC,CAAC;IAC3D,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAiB,IAAI,CAAC,CAAC;IACpD,MAAM,C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AChB,GAAG,EAAE,eAAe,EACpB,SAAS,EAAE,UAAU,CAAC,eAAe,CAAC,EACtC,QAAQ,EAAE,oBAAoB,EAC9B,SAAS,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,qBAAqB,EAC7C,WAAW,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,uBAAuB,EACjD,YAAY,EAAE,WAAW,CAAC,YAAY,EACtC,SAAS,EAAE,WAAW,CAAC,SAAS,EAChC,gBAAgB,EAAE,WAAW,CAAC,gBAAgB,EAC9C,aAAa,EAAE,WAAW,CAAC,aAAa,GACxC,CACE,CACP,CAAC;IAEF,OAAO,CACL,gCACM,SAAS,EACb,GAAG,EAAE,SAAS,EACd,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,WAAW,OAAO,EAAE,CAAC,CAAC;QAE/F,aAAa,KAAK,UAAU,IAAI,kBAAkB;QACnD,6BACE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,EAC7B,GAAG,EAAE,QAAQ,EACb,KAAK,EAAE,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,GAAG,eAAe,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS;YAE5E,aAAa,KAAK,YAAY,IAAI,mBAAmB;YACrD,SAAS,IAAI,OAAO,KAAK,KAAK,IAAI,MAAM;YACxC,aAAa,KAAK,UAAU,IAAI,mBAAmB,CAChD;QACL,aAAa,KAAK,YAAY,IAAI,kBAAkB,CACjD,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,mBAAmB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect } from 'react';\nimport clsx from 'clsx';\n\nimport { useMergeRefs, useStableCallback } from '@cloudscape-design/component-toolkit/internal';\n\nimport { useResize } from '../app-layout/visual-refresh-toolbar/drawer/use-resize';\nimport { getBaseProps } from '../internal/base-component';\nimport PanelResizeHandle from '../internal/components/panel-resize-handle';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useControllable } from '../internal/hooks/use-controllable';\nimport { SomeRequired } from '../internal/types';\nimport useContainerWidth from '../internal/utils/use-container-width';\nimport { PanelLayoutProps } from './interfaces';\n\nimport styles from './styles.css.js';\nimport testStyles from './test-classes/styles.css.js';\n\nconst DEFAULT_PANEL_SIZE = 200;\n\ntype InternalPanelLayoutProps = SomeRequired<PanelLayoutProps, 'panelPosition' | 'resizable' | 'display'> &\n InternalBaseComponentProps;\n\nconst InternalPanelLayout = React.forwardRef<PanelLayoutProps.Ref, InternalPanelLayoutProps>(\n (\n {\n panelPosition,\n panelContent,\n mainContent,\n defaultPanelSize,\n panelSize: controlledPanelSize,\n resizable,\n onPanelResize,\n onLayoutChange,\n minPanelSize,\n maxPanelSize,\n i18nStrings,\n display,\n panelFocusable,\n mainFocusable,\n __internalRootRef,\n ...props\n },\n ref\n ) => {\n const baseProps = getBaseProps(props);\n\n const resizeHandleRef = React.useRef<HTMLDivElement>(null);\n const panelRef = React.useRef<HTMLDivElement>(null);\n const [containerWidth, rootRef] = useContainerWidth();\n\n React.useImperativeHandle(\n ref,\n () => ({\n focusResizeHandle() {\n resizeHandleRef.current?.focus();\n },\n }),\n []\n );\n\n const [panelSize = DEFAULT_PANEL_SIZE, setPanelSize] = useControllable(\n controlledPanelSize,\n onPanelResize,\n defaultPanelSize ?? minPanelSize,\n {\n componentName: 'PanelLayout',\n controlledProp: 'panelSize',\n changeHandler: 'onPanelResize',\n }\n );\n\n const actualMaxSize = Math.min(maxPanelSize ?? containerWidth, containerWidth);\n const actualMinSize = minPanelSize ?? 0;\n const actualPanelSize = Math.max(Math.min(panelSize, actualMaxSize), actualMinSize);\n\n const stableLayoutChangeEvent = useStableCallback((details: PanelLayoutProps.PanelResizeDetail) =>\n fireNonCancelableEvent(onLayoutChange, details)\n );\n useEffect(() => {\n stableLayoutChangeEvent({ totalSize: containerWidth, panelSize: actualPanelSize });\n }, [containerWidth, actualPanelSize, stableLayoutChangeEvent]);\n\n const resizeHandlePosition = panelPosition === 'side-end' ? 'side' : panelPosition;\n const resizeProps = useResize({\n currentWidth: actualPanelSize,\n minWidth: actualMinSize,\n maxWidth: actualMaxSize,\n panelRef: panelRef,\n handleRef: resizeHandleRef,\n position: resizeHandlePosition,\n onResize: size => {\n setPanelSize(size);\n fireNonCancelableEvent(onPanelResize, { totalSize: containerWidth, panelSize: size });\n },\n });\n\n const mergedRef = useMergeRefs(rootRef, __internalRootRef, ref);\n\n const wrappedPanelContent = (\n <div\n className={clsx(styles['panel-content'], display !== 'main-only' && testStyles.panel)}\n tabIndex={panelFocusable && 0}\n role={panelFocusable && 'region'}\n aria-label={panelFocusable?.ariaLabel}\n aria-labelledby={panelFocusable?.ariaLabelledby}\n >\n {panelContent}\n </div>\n );\n const wrappedMainContent = (\n <div\n className={clsx(styles.content, display !== 'panel-only' && testStyles.content)}\n tabIndex={mainFocusable && 0}\n role={mainFocusable && 'region'}\n aria-label={mainFocusable?.ariaLabel}\n aria-labelledby={mainFocusable?.ariaLabelledby}\n >\n {mainContent}\n </div>\n );\n const handle = (\n <div className={styles.handle}>\n <PanelResizeHandle\n ref={resizeHandleRef}\n className={testStyles['resize-handle']}\n position={resizeHandlePosition}\n ariaLabel={i18nStrings?.resizeHandleAriaLabel}\n tooltipText={i18nStrings?.resizeHandleTooltipText}\n ariaValuenow={resizeProps.relativeSize}\n onKeyDown={resizeProps.onKeyDown}\n onDirectionClick={resizeProps.onDirectionClick}\n onPointerDown={resizeProps.onPointerDown}\n />\n </div>\n );\n\n return (\n <div\n {...baseProps}\n ref={mergedRef}\n className={clsx(baseProps.className, styles.root, testStyles.root, styles[`display-${display}`])}\n >\n {panelPosition === 'side-end' && wrappedMainContent}\n <div\n className={clsx(styles.panel)}\n ref={panelRef}\n style={display === 'all' ? { inlineSize: `${actualPanelSize}px` } : undefined}\n >\n {panelPosition === 'side-start' && wrappedPanelContent}\n {resizable && display === 'all' && handle}\n {panelPosition === 'side-end' && wrappedPanelContent}\n </div>\n {panelPosition === 'side-start' && wrappedMainContent}\n </div>\n );\n }\n);\n\nexport default InternalPanelLayout;\n"]}
1
+ {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/panel-layout/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAEhG,OAAO,EAAE,SAAS,EAAE,MAAM,wDAAwD,CAAC;AACnF,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,iBAAiB,MAAM,4CAA4C,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAErE,OAAO,iBAAiB,MAAM,uCAAuC,CAAC;AAGtE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,UAAU,MAAM,8BAA8B,CAAC;AAEtD,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAK/B,MAAM,mBAAmB,GAAG,KAAK,CAAC,UAAU,CAC1C,CACE,EACE,aAAa,EACb,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,SAAS,EAAE,mBAAmB,EAC9B,SAAS,EACT,aAAa,EACb,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,OAAO,EACP,UAAU,EACV,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,MAAM,SAAS,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Aa,KAAK,YAAY,IAAI,kBAAkB,CACjD,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,mBAAmB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect } from 'react';\nimport clsx from 'clsx';\n\nimport { useMergeRefs, useStableCallback } from '@cloudscape-design/component-toolkit/internal';\n\nimport { useResize } from '../app-layout/visual-refresh-toolbar/drawer/use-resize';\nimport { getBaseProps } from '../internal/base-component';\nimport PanelResizeHandle from '../internal/components/panel-resize-handle';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useControllable } from '../internal/hooks/use-controllable';\nimport { SomeRequired } from '../internal/types';\nimport useContainerWidth from '../internal/utils/use-container-width';\nimport { PanelLayoutProps } from './interfaces';\n\nimport styles from './styles.css.js';\nimport testStyles from './test-classes/styles.css.js';\n\nconst DEFAULT_PANEL_SIZE = 200;\n\ntype InternalPanelLayoutProps = SomeRequired<PanelLayoutProps, 'panelPosition' | 'resizable' | 'display'> &\n InternalBaseComponentProps;\n\nconst InternalPanelLayout = React.forwardRef<PanelLayoutProps.Ref, InternalPanelLayoutProps>(\n (\n {\n panelPosition,\n panelContent,\n mainContent,\n defaultPanelSize,\n panelSize: controlledPanelSize,\n resizable,\n onPanelResize,\n onLayoutChange,\n minPanelSize,\n maxPanelSize,\n i18nStrings,\n display,\n scrollable,\n panelFocusable,\n mainFocusable,\n __internalRootRef,\n ...props\n },\n ref\n ) => {\n const baseProps = getBaseProps(props);\n\n const resizeHandleRef = React.useRef<HTMLDivElement>(null);\n const panelRef = React.useRef<HTMLDivElement>(null);\n const [containerWidth, rootRef] = useContainerWidth();\n\n React.useImperativeHandle(\n ref,\n () => ({\n focusResizeHandle() {\n resizeHandleRef.current?.focus();\n },\n }),\n []\n );\n\n const [panelSize = DEFAULT_PANEL_SIZE, setPanelSize] = useControllable(\n controlledPanelSize,\n onPanelResize,\n defaultPanelSize ?? minPanelSize,\n {\n componentName: 'PanelLayout',\n controlledProp: 'panelSize',\n changeHandler: 'onPanelResize',\n }\n );\n\n const actualMaxSize = Math.min(maxPanelSize ?? containerWidth, containerWidth);\n const actualMinSize = minPanelSize ?? 0;\n const actualPanelSize = Math.max(Math.min(panelSize, actualMaxSize), actualMinSize);\n\n const stableLayoutChangeEvent = useStableCallback((details: PanelLayoutProps.PanelResizeDetail) =>\n fireNonCancelableEvent(onLayoutChange, details)\n );\n useEffect(() => {\n stableLayoutChangeEvent({ totalSize: containerWidth, panelSize: actualPanelSize });\n }, [containerWidth, actualPanelSize, stableLayoutChangeEvent]);\n\n const resizeHandlePosition = panelPosition === 'side-end' ? 'side' : panelPosition;\n const resizeProps = useResize({\n currentWidth: actualPanelSize,\n minWidth: actualMinSize,\n maxWidth: actualMaxSize,\n panelRef: panelRef,\n handleRef: resizeHandleRef,\n position: resizeHandlePosition,\n onResize: size => {\n setPanelSize(size);\n fireNonCancelableEvent(onPanelResize, { totalSize: containerWidth, panelSize: size });\n },\n });\n\n const mergedRef = useMergeRefs(rootRef, __internalRootRef, ref);\n\n const wrappedPanelContent = (\n <div\n className={clsx(\n styles['panel-content'],\n scrollable && styles.scrollable,\n display !== 'main-only' && testStyles.panel\n )}\n tabIndex={panelFocusable && 0}\n role={panelFocusable && 'region'}\n aria-label={panelFocusable?.ariaLabel}\n aria-labelledby={panelFocusable?.ariaLabelledby}\n >\n {panelContent}\n </div>\n );\n const wrappedMainContent = (\n <div\n className={clsx(\n styles.content,\n scrollable && styles.scrollable,\n display !== 'panel-only' && testStyles.content\n )}\n tabIndex={mainFocusable && 0}\n role={mainFocusable && 'region'}\n aria-label={mainFocusable?.ariaLabel}\n aria-labelledby={mainFocusable?.ariaLabelledby}\n >\n {mainContent}\n </div>\n );\n const handle = (\n <div className={styles.handle}>\n <PanelResizeHandle\n ref={resizeHandleRef}\n className={testStyles['resize-handle']}\n position={resizeHandlePosition}\n ariaLabel={i18nStrings?.resizeHandleAriaLabel}\n tooltipText={i18nStrings?.resizeHandleTooltipText}\n ariaValuenow={resizeProps.relativeSize}\n onKeyDown={resizeProps.onKeyDown}\n onDirectionClick={resizeProps.onDirectionClick}\n onPointerDown={resizeProps.onPointerDown}\n />\n </div>\n );\n\n return (\n <div\n {...baseProps}\n ref={mergedRef}\n className={clsx(baseProps.className, styles.root, testStyles.root, styles[`display-${display}`])}\n >\n {panelPosition === 'side-end' && wrappedMainContent}\n <div\n className={clsx(styles.panel)}\n ref={panelRef}\n style={display === 'all' ? { inlineSize: `${actualPanelSize}px` } : undefined}\n >\n {panelPosition === 'side-start' && wrappedPanelContent}\n {resizable && display === 'all' && handle}\n {panelPosition === 'side-end' && wrappedPanelContent}\n </div>\n {panelPosition === 'side-start' && wrappedMainContent}\n </div>\n );\n }\n);\n\nexport default InternalPanelLayout;\n"]}
@@ -1,12 +1,13 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "root": "awsui_root_1ksu1_r6xtl_9",
5
- "panel": "awsui_panel_1ksu1_r6xtl_44",
6
- "handle": "awsui_handle_1ksu1_r6xtl_48",
7
- "panel-content": "awsui_panel-content_1ksu1_r6xtl_52",
8
- "display-main-only": "awsui_display-main-only_1ksu1_r6xtl_65",
9
- "display-panel-only": "awsui_display-panel-only_1ksu1_r6xtl_68",
10
- "content": "awsui_content_1ksu1_r6xtl_74"
4
+ "root": "awsui_root_1ksu1_139yc_9",
5
+ "panel-content": "awsui_panel-content_1ksu1_139yc_43",
6
+ "content": "awsui_content_1ksu1_139yc_44",
7
+ "scrollable": "awsui_scrollable_1ksu1_139yc_47",
8
+ "panel": "awsui_panel_1ksu1_139yc_43",
9
+ "handle": "awsui_handle_1ksu1_139yc_56",
10
+ "display-main-only": "awsui_display-main-only_1ksu1_139yc_71",
11
+ "display-panel-only": "awsui_display-panel-only_1ksu1_139yc_74"
11
12
  };
12
13
 
@@ -6,7 +6,7 @@
6
6
  /* stylelint-enable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
7
7
  /* Style used for links in slots/components that are text heavy, to help links stand out among
8
8
  surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F73#description */
9
- .awsui_root_1ksu1_r6xtl_9:not(#\9) {
9
+ .awsui_root_1ksu1_139yc_9:not(#\9) {
10
10
  border-collapse: separate;
11
11
  border-spacing: 0;
12
12
  box-sizing: border-box;
@@ -37,24 +37,30 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
37
37
  -webkit-font-smoothing: auto;
38
38
  -moz-osx-font-smoothing: auto;
39
39
  block-size: 100%;
40
- overflow: hidden;
41
40
  display: flex;
42
41
  }
43
42
 
44
- .awsui_panel_1ksu1_r6xtl_44:not(#\9) {
43
+ .awsui_panel-content_1ksu1_139yc_43:not(#\9),
44
+ .awsui_content_1ksu1_139yc_44:not(#\9) {
45
+ min-inline-size: 0;
46
+ }
47
+ .awsui_panel-content_1ksu1_139yc_43.awsui_scrollable_1ksu1_139yc_47:not(#\9),
48
+ .awsui_content_1ksu1_139yc_44.awsui_scrollable_1ksu1_139yc_47:not(#\9) {
49
+ overflow-y: auto;
50
+ }
51
+
52
+ .awsui_panel_1ksu1_139yc_43:not(#\9) {
45
53
  display: flex;
46
54
  flex-shrink: 0;
47
55
  }
48
- .awsui_panel_1ksu1_r6xtl_44 > .awsui_handle_1ksu1_r6xtl_48:not(#\9) {
56
+ .awsui_panel_1ksu1_139yc_43 > .awsui_handle_1ksu1_139yc_56:not(#\9) {
49
57
  display: flex;
50
58
  align-items: center;
51
59
  }
52
- .awsui_panel_1ksu1_r6xtl_44 > .awsui_panel-content_1ksu1_r6xtl_52:not(#\9) {
53
- overflow-y: auto;
54
- overflow-x: visible;
60
+ .awsui_panel_1ksu1_139yc_43 > .awsui_panel-content_1ksu1_139yc_43:not(#\9) {
55
61
  flex-grow: 1;
56
62
  }
57
- body[data-awsui-focus-visible=true] .awsui_panel_1ksu1_r6xtl_44 > .awsui_panel-content_1ksu1_r6xtl_52:not(#\9):focus {
63
+ body[data-awsui-focus-visible=true] .awsui_panel_1ksu1_139yc_43 > .awsui_panel-content_1ksu1_139yc_43:not(#\9):focus {
58
64
  border-start-start-radius: calc(var(--border-radius-control-default-focus-ring-akwhsf, 2px) + 2px);
59
65
  border-start-end-radius: calc(var(--border-radius-control-default-focus-ring-akwhsf, 2px) + 2px);
60
66
  border-end-start-radius: calc(var(--border-radius-control-default-focus-ring-akwhsf, 2px) + 2px);
@@ -62,24 +68,22 @@ body[data-awsui-focus-visible=true] .awsui_panel_1ksu1_r6xtl_44 > .awsui_panel-c
62
68
  outline: 2px solid var(--color-border-item-focused-sewkzn, #0073bb);
63
69
  outline-offset: calc(-1 * 2px);
64
70
  }
65
- .awsui_display-main-only_1ksu1_r6xtl_65 > .awsui_panel_1ksu1_r6xtl_44:not(#\9) {
71
+ .awsui_display-main-only_1ksu1_139yc_71 > .awsui_panel_1ksu1_139yc_43:not(#\9) {
66
72
  display: none;
67
73
  }
68
- .awsui_display-panel-only_1ksu1_r6xtl_68 > .awsui_panel_1ksu1_r6xtl_44:not(#\9) {
74
+ .awsui_display-panel-only_1ksu1_139yc_74 > .awsui_panel_1ksu1_139yc_43:not(#\9) {
69
75
  flex: 1;
70
- overflow-y: auto;
71
- overflow-x: visible;
76
+ min-inline-size: 0;
72
77
  }
73
78
 
74
- .awsui_content_1ksu1_r6xtl_74:not(#\9) {
75
- overflow-y: auto;
79
+ .awsui_content_1ksu1_139yc_44:not(#\9) {
76
80
  flex-grow: 1;
77
81
  flex-shrink: 1;
78
82
  }
79
- .awsui_display-panel-only_1ksu1_r6xtl_68 > .awsui_content_1ksu1_r6xtl_74:not(#\9) {
83
+ .awsui_display-panel-only_1ksu1_139yc_74 > .awsui_content_1ksu1_139yc_44:not(#\9) {
80
84
  display: none;
81
85
  }
82
- body[data-awsui-focus-visible=true] .awsui_content_1ksu1_r6xtl_74:not(#\9):focus {
86
+ body[data-awsui-focus-visible=true] .awsui_content_1ksu1_139yc_44:not(#\9):focus {
83
87
  border-start-start-radius: calc(var(--border-radius-control-default-focus-ring-akwhsf, 2px) + 2px);
84
88
  border-start-end-radius: calc(var(--border-radius-control-default-focus-ring-akwhsf, 2px) + 2px);
85
89
  border-end-start-radius: calc(var(--border-radius-control-default-focus-ring-akwhsf, 2px) + 2px);
@@ -2,12 +2,13 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "root": "awsui_root_1ksu1_r6xtl_9",
6
- "panel": "awsui_panel_1ksu1_r6xtl_44",
7
- "handle": "awsui_handle_1ksu1_r6xtl_48",
8
- "panel-content": "awsui_panel-content_1ksu1_r6xtl_52",
9
- "display-main-only": "awsui_display-main-only_1ksu1_r6xtl_65",
10
- "display-panel-only": "awsui_display-panel-only_1ksu1_r6xtl_68",
11
- "content": "awsui_content_1ksu1_r6xtl_74"
5
+ "root": "awsui_root_1ksu1_139yc_9",
6
+ "panel-content": "awsui_panel-content_1ksu1_139yc_43",
7
+ "content": "awsui_content_1ksu1_139yc_44",
8
+ "scrollable": "awsui_scrollable_1ksu1_139yc_47",
9
+ "panel": "awsui_panel_1ksu1_139yc_43",
10
+ "handle": "awsui_handle_1ksu1_139yc_56",
11
+ "display-main-only": "awsui_display-main-only_1ksu1_139yc_71",
12
+ "display-panel-only": "awsui_display-panel-only_1ksu1_139yc_74"
12
13
  };
13
14
 
@@ -12,7 +12,7 @@ interface ProgressProps {
12
12
  }
13
13
  export interface StyleClassNames {
14
14
  root?: string;
15
- percentage?: string;
15
+ valueLabel?: string;
16
16
  }
17
17
  export declare const Progress: ({ value, isInFlash, ariaLabel, ariaLabelledby, ariaDescribedby, style, styleClassNames, }: ProgressProps) => JSX.Element;
18
18
  interface SmallTextProps {
@@ -23,7 +23,7 @@ export const Progress = ({ value, isInFlash, ariaLabel, ariaLabelledby, ariaDesc
23
23
  ...(progressValueStyles || {}),
24
24
  } }),
25
25
  React.createElement("span", { "aria-hidden": "true", className: styles['percentage-container'] },
26
- React.createElement("small", { className: clsx(styleClassNames === null || styleClassNames === void 0 ? void 0 : styleClassNames.percentage, styles.percentage, isInFlash && styles['percentage-flash']), style: progressPercentageStyles }, `${progressValue}%`))));
26
+ React.createElement("small", { className: clsx(styleClassNames === null || styleClassNames === void 0 ? void 0 : styleClassNames.valueLabel, styles.percentage, isInFlash && styles['percentage-flash']), style: progressPercentageStyles }, `${progressValue}%`))));
27
27
  };
28
28
  export const SmallText = ({ color, children, className, id }) => {
29
29
  return (React.createElement(InternalBox, { className: clsx(styles['word-wrap'], className), variant: "small", display: "block", color: color, id: id }, children));
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/progress-bar/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAE1C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,uBAAuB,MAAM,8BAA8B,CAAC;AAEnE,OAAO,EAAE,2BAA2B,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAElG,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,MAAM,SAAS,GAAG,GAAG,CAAC;AAEtB,MAAM,KAAK,GAAG,CAAC,KAAa,EAAE,UAAkB,EAAE,UAAkB,EAAE,EAAE;IACtE,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,UAAU,CAAC,EAAE,UAAU,CAAC,CAAC;AAC3D,CAAC,CAAC;AAkBF,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,EACvB,KAAK,EACL,SAAS,EACT,SAAS,EACT,cAA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AAC,IAAG,UAAU,CAAQ,CACnC,CACrB;QACN,eAAe,IAAI,oBAAC,YAAY,IAAC,OAAO,EAAE,OAAO,IAAG,gBAAgB,CAAgB,CACjF,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport { BoxProps } from '../box/interfaces';\nimport InternalBox from '../box/internal';\nimport { ButtonProps } from '../button/interfaces';\nimport { InternalButton } from '../button/internal';\nimport InternalStatusIndicator from '../status-indicator/internal';\nimport { ProgressBarProps } from './interfaces';\nimport { getProgressPercentageStyles, getProgressStyles, getProgressValueStyles } from './styles';\n\nimport styles from './styles.css.js';\n\nconst MAX_VALUE = 100;\n\nconst clamp = (value: number, lowerLimit: number, upperLimit: number) => {\n return Math.max(Math.min(value, upperLimit), lowerLimit);\n};\n\ninterface ProgressProps {\n value: number;\n isInFlash: boolean;\n ariaLabel?: string;\n ariaLabelledby?: string;\n ariaDescribedby?: string;\n style?: ProgressBarProps.Style;\n styleClassNames?: StyleClassNames;\n}\n\n// Style API v2\nexport interface StyleClassNames {\n root?: string;\n percentage?: string;\n}\n\nexport const Progress = ({\n value,\n isInFlash,\n ariaLabel,\n ariaLabelledby,\n ariaDescribedby,\n style,\n styleClassNames,\n}: ProgressProps) => {\n const roundedValue = Math.round(value);\n const progressValue = clamp(roundedValue, 0, MAX_VALUE);\n\n const progressBarStyles = getProgressStyles(style);\n const progressValueStyles = getProgressValueStyles(style);\n const progressPercentageStyles = getProgressPercentageStyles(style);\n\n return (\n <div className={styles['progress-container']}>\n <progress\n className={clsx(\n styles.progress,\n progressValue >= MAX_VALUE && styles.complete,\n isInFlash && styles['progress-flash']\n )}\n max={MAX_VALUE}\n value={progressValue}\n aria-label={ariaLabel}\n // Ensures aria-label takes precedence over aria-labelledby\n aria-labelledby={!ariaLabel ? ariaLabelledby : undefined}\n aria-describedby={ariaDescribedby}\n style={{\n ...(progressBarStyles || {}),\n ...(progressValueStyles || {}),\n }}\n />\n <span aria-hidden=\"true\" className={styles['percentage-container']}>\n <small\n className={clsx(styleClassNames?.percentage, styles.percentage, isInFlash && styles['percentage-flash'])}\n style={progressPercentageStyles}\n >\n {`${progressValue}%`}\n </small>\n </span>\n </div>\n );\n};\n\ninterface SmallTextProps {\n color?: BoxProps.Color;\n id?: string;\n children: React.ReactNode;\n className?: string;\n}\n\nexport const SmallText = ({ color, children, className, id }: SmallTextProps) => {\n return (\n <InternalBox className={clsx(styles['word-wrap'], className)} variant=\"small\" display=\"block\" color={color} id={id}>\n {children}\n </InternalBox>\n );\n};\n\nconst ResultButton = ({ onClick, children }: ButtonProps) => {\n return (\n <div className={styles['result-button']}>\n <InternalButton formAction=\"none\" onClick={onClick}>\n {children}\n </InternalButton>\n </div>\n );\n};\n\ninterface ResultStateProps {\n isInFlash: boolean;\n resultText: React.ReactNode;\n resultButtonText?: string;\n status: ProgressBarProps.Status;\n onClick: () => void;\n}\n\nexport const ResultState = ({ isInFlash, resultText, resultButtonText, status, onClick }: ResultStateProps) => {\n const hasResultButton = !!resultButtonText;\n\n if (isInFlash) {\n return (\n <div className={styles[`result-container-${status}`]}>\n <span className={styles['result-text']}>{resultText}</span>\n </div>\n );\n }\n\n return (\n <div className={styles[`result-container-${status}`]}>\n <span className={clsx(hasResultButton && styles['with-result-button'])}>\n <InternalStatusIndicator type={status === 'success' ? 'success' : 'error'}>\n <span className={styles['result-text']}>{resultText}</span>\n </InternalStatusIndicator>\n </span>\n {hasResultButton && <ResultButton onClick={onClick}>{resultButtonText}</ResultButton>}\n </div>\n );\n};\n"]}
1
+ {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/progress-bar/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,WAAW,MAAM,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AAM,eAAe,GAAG,CAAC,CAAC,gBAAgB,CAAC;IAE3C,IAAI,SAAS,EAAE,CAAC;QACd,OAAO,CACL,6BAAK,SAAS,EAAE,MAAM,CAAC,oBAAoB,MAAM,EAAE,CAAC;YAClD,8BAAM,SAAS,EAAE,MAAM,CAAC,aAAa,CAAC,IAAG,UAAU,CAAQ,CACvD,CACP,CAAC;IACJ,CAAC;IAED,OAAO,CACL,6BAAK,SAAS,EAAE,MAAM,CAAC,oBAAoB,MAAM,EAAE,CAAC;QAClD,8BAAM,SAAS,EAAE,IAAI,CAAC,eAAe,IAAI,MAAM,CAAC,oBAAoB,CAAC,CAAC;YACpE,oBAAC,uBAAuB,IAAC,IAAI,EAAE,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO;gBACvE,8BAAM,SAAS,EAAE,MAAM,CAAC,aAAa,CAAC,IAAG,UAAU,CAAQ,CACnC,CACrB;QACN,eAAe,IAAI,oBAAC,YAAY,IAAC,OAAO,EAAE,OAAO,IAAG,gBAAgB,CAAgB,CACjF,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport { BoxProps } from '../box/interfaces';\nimport InternalBox from '../box/internal';\nimport { ButtonProps } from '../button/interfaces';\nimport { InternalButton } from '../button/internal';\nimport InternalStatusIndicator from '../status-indicator/internal';\nimport { ProgressBarProps } from './interfaces';\nimport { getProgressPercentageStyles, getProgressStyles, getProgressValueStyles } from './styles';\n\nimport styles from './styles.css.js';\n\nconst MAX_VALUE = 100;\n\nconst clamp = (value: number, lowerLimit: number, upperLimit: number) => {\n return Math.max(Math.min(value, upperLimit), lowerLimit);\n};\n\ninterface ProgressProps {\n value: number;\n isInFlash: boolean;\n ariaLabel?: string;\n ariaLabelledby?: string;\n ariaDescribedby?: string;\n style?: ProgressBarProps.Style;\n styleClassNames?: StyleClassNames;\n}\n\n// Style API v2\nexport interface StyleClassNames {\n root?: string;\n valueLabel?: string;\n}\n\nexport const Progress = ({\n value,\n isInFlash,\n ariaLabel,\n ariaLabelledby,\n ariaDescribedby,\n style,\n styleClassNames,\n}: ProgressProps) => {\n const roundedValue = Math.round(value);\n const progressValue = clamp(roundedValue, 0, MAX_VALUE);\n\n const progressBarStyles = getProgressStyles(style);\n const progressValueStyles = getProgressValueStyles(style);\n const progressPercentageStyles = getProgressPercentageStyles(style);\n\n return (\n <div className={styles['progress-container']}>\n <progress\n className={clsx(\n styles.progress,\n progressValue >= MAX_VALUE && styles.complete,\n isInFlash && styles['progress-flash']\n )}\n max={MAX_VALUE}\n value={progressValue}\n aria-label={ariaLabel}\n // Ensures aria-label takes precedence over aria-labelledby\n aria-labelledby={!ariaLabel ? ariaLabelledby : undefined}\n aria-describedby={ariaDescribedby}\n style={{\n ...(progressBarStyles || {}),\n ...(progressValueStyles || {}),\n }}\n />\n <span aria-hidden=\"true\" className={styles['percentage-container']}>\n <small\n className={clsx(styleClassNames?.valueLabel, styles.percentage, isInFlash && styles['percentage-flash'])}\n style={progressPercentageStyles}\n >\n {`${progressValue}%`}\n </small>\n </span>\n </div>\n );\n};\n\ninterface SmallTextProps {\n color?: BoxProps.Color;\n id?: string;\n children: React.ReactNode;\n className?: string;\n}\n\nexport const SmallText = ({ color, children, className, id }: SmallTextProps) => {\n return (\n <InternalBox className={clsx(styles['word-wrap'], className)} variant=\"small\" display=\"block\" color={color} id={id}>\n {children}\n </InternalBox>\n );\n};\n\nconst ResultButton = ({ onClick, children }: ButtonProps) => {\n return (\n <div className={styles['result-button']}>\n <InternalButton formAction=\"none\" onClick={onClick}>\n {children}\n </InternalButton>\n </div>\n );\n};\n\ninterface ResultStateProps {\n isInFlash: boolean;\n resultText: React.ReactNode;\n resultButtonText?: string;\n status: ProgressBarProps.Status;\n onClick: () => void;\n}\n\nexport const ResultState = ({ isInFlash, resultText, resultButtonText, status, onClick }: ResultStateProps) => {\n const hasResultButton = !!resultButtonText;\n\n if (isInFlash) {\n return (\n <div className={styles[`result-container-${status}`]}>\n <span className={styles['result-text']}>{resultText}</span>\n </div>\n );\n }\n\n return (\n <div className={styles[`result-container-${status}`]}>\n <span className={clsx(hasResultButton && styles['with-result-button'])}>\n <InternalStatusIndicator type={status === 'success' ? 'success' : 'error'}>\n <span className={styles['result-text']}>{resultText}</span>\n </InternalStatusIndicator>\n </span>\n {hasResultButton && <ResultButton onClick={onClick}>{resultButtonText}</ResultButton>}\n </div>\n );\n};\n"]}
@@ -1,25 +1,25 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "progress": "awsui_progress_11huc_c1vbq_13",
5
- "result-state": "awsui_result-state_11huc_c1vbq_27",
6
- "awsui-motion-fade-in": "awsui_awsui-motion-fade-in_11huc_c1vbq_1",
7
- "root": "awsui_root_11huc_c1vbq_67",
8
- "with-result-button": "awsui_with-result-button_11huc_c1vbq_103",
9
- "result-text": "awsui_result-text_11huc_c1vbq_107",
10
- "result-container-error": "awsui_result-container-error_11huc_c1vbq_111",
11
- "result-container-success": "awsui_result-container-success_11huc_c1vbq_111",
12
- "result-button": "awsui_result-button_11huc_c1vbq_115",
13
- "word-wrap": "awsui_word-wrap_11huc_c1vbq_121",
14
- "label-flash": "awsui_label-flash_11huc_c1vbq_126",
15
- "label-key-value": "awsui_label-key-value_11huc_c1vbq_130",
16
- "flash": "awsui_flash_11huc_c1vbq_138",
17
- "progress-container": "awsui_progress-container_11huc_c1vbq_142",
18
- "percentage-container": "awsui_percentage-container_11huc_c1vbq_149",
19
- "percentage": "awsui_percentage_11huc_c1vbq_149",
20
- "percentage-flash": "awsui_percentage-flash_11huc_c1vbq_170",
21
- "complete": "awsui_complete_11huc_c1vbq_206",
22
- "progress-flash": "awsui_progress-flash_11huc_c1vbq_219",
23
- "additional-info": "awsui_additional-info_11huc_c1vbq_232"
4
+ "progress": "awsui_progress_11huc_j6la2_13",
5
+ "result-state": "awsui_result-state_11huc_j6la2_27",
6
+ "awsui-motion-fade-in": "awsui_awsui-motion-fade-in_11huc_j6la2_1",
7
+ "root": "awsui_root_11huc_j6la2_67",
8
+ "with-result-button": "awsui_with-result-button_11huc_j6la2_103",
9
+ "result-text": "awsui_result-text_11huc_j6la2_107",
10
+ "result-container-error": "awsui_result-container-error_11huc_j6la2_111",
11
+ "result-container-success": "awsui_result-container-success_11huc_j6la2_111",
12
+ "result-button": "awsui_result-button_11huc_j6la2_115",
13
+ "word-wrap": "awsui_word-wrap_11huc_j6la2_121",
14
+ "label-flash": "awsui_label-flash_11huc_j6la2_126",
15
+ "label-key-value": "awsui_label-key-value_11huc_j6la2_130",
16
+ "flash": "awsui_flash_11huc_j6la2_138",
17
+ "progress-container": "awsui_progress-container_11huc_j6la2_142",
18
+ "percentage-container": "awsui_percentage-container_11huc_j6la2_149",
19
+ "percentage": "awsui_percentage_11huc_j6la2_149",
20
+ "percentage-flash": "awsui_percentage-flash_11huc_j6la2_170",
21
+ "complete": "awsui_complete_11huc_j6la2_206",
22
+ "progress-flash": "awsui_progress-flash_11huc_j6la2_219",
23
+ "additional-info": "awsui_additional-info_11huc_j6la2_232"
24
24
  };
25
25