@cloudscape-design/components 3.0.873 → 3.0.875

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 (107) hide show
  1. package/app-layout/visual-refresh-toolbar/toolbar/trigger-button/index.js +4 -4
  2. package/app-layout/visual-refresh-toolbar/toolbar/trigger-button/index.js.map +1 -1
  3. package/attribute-editor/grid-defaults.d.ts +3 -0
  4. package/attribute-editor/grid-defaults.d.ts.map +1 -0
  5. package/attribute-editor/grid-defaults.js +122 -0
  6. package/attribute-editor/grid-defaults.js.map +1 -0
  7. package/attribute-editor/interfaces.d.ts +49 -2
  8. package/attribute-editor/interfaces.d.ts.map +1 -1
  9. package/attribute-editor/interfaces.js.map +1 -1
  10. package/attribute-editor/internal.d.ts.map +1 -1
  11. package/attribute-editor/internal.js +35 -15
  12. package/attribute-editor/internal.js.map +1 -1
  13. package/attribute-editor/row.d.ts +5 -3
  14. package/attribute-editor/row.d.ts.map +1 -1
  15. package/attribute-editor/row.js +29 -26
  16. package/attribute-editor/row.js.map +1 -1
  17. package/attribute-editor/styles.css.js +15 -14
  18. package/attribute-editor/styles.scoped.css +49 -41
  19. package/attribute-editor/styles.selectors.js +15 -14
  20. package/attribute-editor/utils.d.ts +11 -0
  21. package/attribute-editor/utils.d.ts.map +1 -0
  22. package/attribute-editor/utils.js +43 -0
  23. package/attribute-editor/utils.js.map +1 -0
  24. package/button-dropdown/interfaces.d.ts +6 -2
  25. package/button-dropdown/interfaces.d.ts.map +1 -1
  26. package/button-dropdown/interfaces.js.map +1 -1
  27. package/button-dropdown/internal.d.ts.map +1 -1
  28. package/button-dropdown/internal.js +11 -3
  29. package/button-dropdown/internal.js.map +1 -1
  30. package/button-dropdown/utils/use-button-dropdown.js +1 -1
  31. package/button-dropdown/utils/use-button-dropdown.js.map +1 -1
  32. package/button-group/item-element.d.ts.map +1 -1
  33. package/button-group/item-element.js +15 -11
  34. package/button-group/item-element.js.map +1 -1
  35. package/code-editor/resizable-box/index.js +4 -4
  36. package/code-editor/resizable-box/index.js.map +1 -1
  37. package/container/use-sticky-header.js +4 -4
  38. package/container/use-sticky-header.js.map +1 -1
  39. package/file-dropzone/use-files-dragging.d.ts.map +1 -1
  40. package/file-dropzone/use-files-dragging.js +5 -6
  41. package/file-dropzone/use-files-dragging.js.map +1 -1
  42. package/form-field/interfaces.d.ts +2 -1
  43. package/form-field/interfaces.d.ts.map +1 -1
  44. package/form-field/interfaces.js.map +1 -1
  45. package/form-field/internal.d.ts +1 -1
  46. package/form-field/internal.d.ts.map +1 -1
  47. package/form-field/internal.js +2 -2
  48. package/form-field/internal.js.map +1 -1
  49. package/internal/analytics/components/analytics-funnel.js +4 -4
  50. package/internal/analytics/components/analytics-funnel.js.map +1 -1
  51. package/internal/animate.js +1 -1
  52. package/internal/animate.js.map +1 -1
  53. package/internal/components/chart-plot/focus-outline.js +4 -4
  54. package/internal/components/chart-plot/focus-outline.js.map +1 -1
  55. package/internal/components/dropdown/dropdown-fit-handler.d.ts +2 -1
  56. package/internal/components/dropdown/dropdown-fit-handler.d.ts.map +1 -1
  57. package/internal/components/dropdown/dropdown-fit-handler.js +1 -1
  58. package/internal/components/dropdown/dropdown-fit-handler.js.map +1 -1
  59. package/internal/components/dropdown/dropdown-position.d.ts +16 -0
  60. package/internal/components/dropdown/dropdown-position.d.ts.map +1 -0
  61. package/internal/components/dropdown/dropdown-position.js +27 -0
  62. package/internal/components/dropdown/dropdown-position.js.map +1 -0
  63. package/internal/components/dropdown/index.d.ts.map +1 -1
  64. package/internal/components/dropdown/index.js +19 -35
  65. package/internal/components/dropdown/index.js.map +1 -1
  66. package/internal/components/transition/index.js +4 -4
  67. package/internal/components/transition/index.js.map +1 -1
  68. package/internal/environment.js +1 -1
  69. package/internal/environment.json +1 -1
  70. package/internal/focus-tracker.d.ts +1 -0
  71. package/internal/focus-tracker.d.ts.map +1 -1
  72. package/internal/focus-tracker.js +4 -4
  73. package/internal/focus-tracker.js.map +1 -1
  74. package/internal/hooks/use-mouse-down-target.js +4 -4
  75. package/internal/hooks/use-mouse-down-target.js.map +1 -1
  76. package/internal/manifest.json +1 -1
  77. package/multiselect/interfaces.d.ts +4 -0
  78. package/multiselect/interfaces.d.ts.map +1 -1
  79. package/multiselect/interfaces.js.map +1 -1
  80. package/multiselect/internal.d.ts +1 -3
  81. package/multiselect/internal.d.ts.map +1 -1
  82. package/multiselect/internal.js.map +1 -1
  83. package/package.json +1 -1
  84. package/popover/container.d.ts.map +1 -1
  85. package/popover/container.js +5 -6
  86. package/popover/container.js.map +1 -1
  87. package/table/resizer/index.d.ts.map +1 -1
  88. package/table/resizer/index.js +5 -6
  89. package/table/resizer/index.js.map +1 -1
  90. package/table/table-role/grid-navigation.js +5 -6
  91. package/table/table-role/grid-navigation.js.map +1 -1
  92. package/test-utils/dom/attribute-editor/index.d.ts +1 -0
  93. package/test-utils/dom/attribute-editor/index.js +4 -2
  94. package/test-utils/dom/attribute-editor/index.js.map +1 -1
  95. package/test-utils/dom/index.d.ts +78 -78
  96. package/test-utils/dom/index.js +9 -3
  97. package/test-utils/dom/index.js.map +1 -1
  98. package/test-utils/selectors/attribute-editor/index.d.ts +1 -0
  99. package/test-utils/selectors/attribute-editor/index.js +4 -2
  100. package/test-utils/selectors/attribute-editor/index.js.map +1 -1
  101. package/test-utils/selectors/index.d.ts +78 -78
  102. package/test-utils/selectors/index.js +5 -1
  103. package/test-utils/selectors/index.js.map +1 -1
  104. package/test-utils/tsconfig.tsbuildinfo +1 -1
  105. package/top-navigation/styles.css.js +47 -47
  106. package/top-navigation/styles.scoped.css +66 -65
  107. package/top-navigation/styles.selectors.js +47 -47
@@ -2,16 +2,13 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import React, { useCallback } from 'react';
4
4
  import clsx from 'clsx';
5
- import InternalBox from '../box/internal';
6
5
  import { InternalButton } from '../button/internal';
7
- import InternalColumnLayout from '../column-layout/internal';
8
6
  import InternalFormField from '../form-field/internal';
9
- import InternalGrid from '../grid/internal';
10
7
  import { useInternalI18n } from '../i18n/context';
11
8
  import { fireNonCancelableEvent } from '../internal/events';
12
9
  import { useUniqueId } from '../internal/hooks/use-unique-id';
10
+ import { getItemGridColumns, getRemoveButtonGridColumns, isRemoveButtonOnSameLine } from './utils';
13
11
  import styles from './styles.css.js';
14
- const Divider = () => React.createElement(InternalBox, { className: styles.divider, padding: { top: 'l' } });
15
12
  function render(item, itemIndex, slot) {
16
13
  if (isSlotFunction(slot)) {
17
14
  return slot(item, itemIndex);
@@ -21,33 +18,39 @@ function render(item, itemIndex, slot) {
21
18
  return typeof slot === 'function';
22
19
  }
23
20
  }
24
- const GRID_DEFINITION = [{ colspan: { default: 12, xs: 9 } }];
25
- const REMOVABLE_GRID_DEFINITION = [{ colspan: { default: 12, xs: 9 } }, { colspan: { default: 12, xs: 3 } }];
26
- export const Row = React.memo(({ breakpoint, item, definition, i18nStrings = {}, index, removable, removeButtonText, removeButtonRefs, onRemoveButtonClick, removeButtonAriaLabel, }) => {
21
+ export const Row = React.memo(({ breakpoint, item, definition, layout, i18nStrings = {}, index, removable, removeButtonText, removeButtonRefs, customRowActions, onRemoveButtonClick, removeButtonAriaLabel, }) => {
27
22
  var _a;
28
23
  const i18n = useInternalI18n('attribute-editor');
29
- const isNarrowViewport = breakpoint === 'default' || breakpoint === 'xxs';
30
- const isWideViewport = !isNarrowViewport;
31
24
  const handleRemoveClick = useCallback(() => {
32
25
  fireNonCancelableEvent(onRemoveButtonClick, { itemIndex: index });
33
26
  }, [onRemoveButtonClick, index]);
34
27
  const firstControlId = useUniqueId('first-control-id-');
35
- return (React.createElement(InternalBox, { className: styles.row, margin: { bottom: 's' } },
36
- React.createElement("div", { role: "group", "aria-labelledby": `${firstControlId}-label ${firstControlId}` },
37
- React.createElement(InternalGrid, { __breakpoint: breakpoint, gridDefinition: removable ? REMOVABLE_GRID_DEFINITION : GRID_DEFINITION },
38
- React.createElement(InternalColumnLayout, { className: styles['row-control'], columns: definition.length, __breakpoint: breakpoint }, definition.map(({ info, label, constraintText, errorText, warningText, control }, defIndex) => (React.createElement(InternalFormField, { key: defIndex, className: styles.field, label: label, info: info, constraintText: render(item, index, constraintText), errorText: render(item, index, errorText), warningText: render(item, index, warningText), stretch: true, i18nStrings: {
39
- errorIconAriaLabel: i18nStrings.errorIconAriaLabel,
40
- warningIconAriaLabel: i18nStrings.warningIconAriaLabel,
41
- }, __hideLabel: isWideViewport && index > 0, controlId: defIndex === 0 ? firstControlId : undefined }, render(item, index, control))))),
42
- removable && (React.createElement(ButtonContainer, { index: index, isNarrowViewport: isNarrowViewport, hasLabel: definition.some(row => row.label) },
43
- React.createElement(InternalButton, { className: styles['remove-button'], formAction: "none", ref: ref => {
44
- removeButtonRefs[index] = ref !== null && ref !== void 0 ? ref : undefined;
45
- }, ariaLabel: (_a = (removeButtonAriaLabel !== null && removeButtonAriaLabel !== void 0 ? removeButtonAriaLabel : i18nStrings.removeButtonAriaLabel)) === null || _a === void 0 ? void 0 : _a(item), onClick: handleRemoveClick }, i18n('removeButtonText', removeButtonText)))))),
46
- isNarrowViewport && React.createElement(Divider, null)));
28
+ const buttonRef = (ref) => {
29
+ removeButtonRefs[index] = ref !== null && ref !== void 0 ? ref : undefined;
30
+ };
31
+ let gridColumnStart = 1;
32
+ let gridColumnEnd = 1;
33
+ const removeButtonOnSameLine = isRemoveButtonOnSameLine(layout);
34
+ const customActions = customRowActions === null || customRowActions === void 0 ? void 0 : customRowActions({
35
+ item,
36
+ itemIndex: index,
37
+ ref: buttonRef,
38
+ breakpoint,
39
+ ownRow: !removeButtonOnSameLine,
40
+ });
41
+ return (React.createElement("div", { className: clsx(styles.row, layout.rows.length === 1 && styles['single-row']), role: "group", "aria-labelledby": `${firstControlId}-label ${firstControlId}` },
42
+ definition.map(({ info, label, constraintText, errorText, warningText, control }, defIndex) => {
43
+ ({ gridColumnStart, gridColumnEnd } = getItemGridColumns(layout, defIndex));
44
+ return (React.createElement(InternalFormField, { key: defIndex, className: styles.field, __style: { gridColumnStart, gridColumnEnd }, label: label, info: info, constraintText: render(item, index, constraintText), errorText: render(item, index, errorText), warningText: render(item, index, warningText), stretch: true, i18nStrings: {
45
+ errorIconAriaLabel: i18nStrings.errorIconAriaLabel,
46
+ warningIconAriaLabel: i18nStrings.warningIconAriaLabel,
47
+ }, __hideLabel: index !== 0 && removeButtonOnSameLine, controlId: defIndex === 0 ? firstControlId : undefined }, render(item, index, control)));
48
+ }),
49
+ React.createElement("div", { className: clsx(styles['remove-button-container'], {
50
+ [styles['remove-button-field-padding']]: removeButtonOnSameLine && index === 0,
51
+ [styles['remove-button-own-row']]: !removeButtonOnSameLine,
52
+ }), style: Object.assign({}, getRemoveButtonGridColumns(layout, gridColumnEnd)) }, removable &&
53
+ (customActions !== undefined ? (customActions) : (React.createElement(InternalButton, { className: styles['remove-button'], formAction: "none", ref: buttonRef, ariaLabel: (_a = (removeButtonAriaLabel !== null && removeButtonAriaLabel !== void 0 ? removeButtonAriaLabel : i18nStrings.removeButtonAriaLabel)) === null || _a === void 0 ? void 0 : _a(item), onClick: handleRemoveClick }, i18n('removeButtonText', removeButtonText))))),
54
+ !removeButtonOnSameLine && React.createElement("div", { className: styles.divider })));
47
55
  });
48
- const ButtonContainer = ({ index, children, isNarrowViewport, hasLabel }) => (React.createElement("div", { className: clsx({
49
- [styles['button-container-haslabel']]: !isNarrowViewport && index === 0 && hasLabel,
50
- [styles['button-container-nolabel']]: !isNarrowViewport && index === 0 && !hasLabel,
51
- [styles['right-align']]: isNarrowViewport,
52
- }) }, children));
53
56
  //# sourceMappingURL=row.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"row.js","sourceRoot":"","sources":["../../../src/attribute-editor/row.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAE1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;AACJ,CAAC,CACwC,CAAC;AAS5C,MAAM,eAAe,GAAG,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAE,QAAQ,EAAmB,EAAE,EAAE,CAAC,CAC5F,6BACE,SAAS,EAAE,IAAI,CAAC;QACd,CAAC,MAAM,CAAC,2BAA2B,CAAC,CAAC,EAAE,CAAC,gBAAgB,IAAI,KAAK,KAAK,CAAC,IAAI,QAAQ;QACnF,CAAC,MAAM,CAAC,0BAA0B,CAAC,CAAC,EAAE,CAAC,gBAAgB,IAAI,KAAK,KAAK,CAAC,IAAI,CAAC,QAAQ;QACnF,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,EAAE,gBAAgB;KAC1C,CAAC,IAED,QAAQ,CACL,CACP,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useCallback } from 'react';\nimport clsx from 'clsx';\n\nimport InternalBox from '../box/internal';\nimport { ButtonProps } from '../button/interfaces';\nimport { InternalButton } from '../button/internal';\nimport InternalColumnLayout, { ColumnLayoutBreakpoint } from '../column-layout/internal';\nimport InternalFormField from '../form-field/internal';\nimport InternalGrid from '../grid/internal';\nimport { useInternalI18n } from '../i18n/context';\nimport { fireNonCancelableEvent, NonCancelableEventHandler } from '../internal/events';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { AttributeEditorProps } from './interfaces';\n\nimport styles from './styles.css.js';\n\nconst Divider = () => <InternalBox className={styles.divider} padding={{ top: 'l' }} />;\n\ninterface RowProps<T> {\n breakpoint: ColumnLayoutBreakpoint | null;\n item: T;\n definition: ReadonlyArray<AttributeEditorProps.FieldDefinition<T>>;\n i18nStrings: AttributeEditorProps.I18nStrings | undefined;\n index: number;\n removable: boolean;\n removeButtonText?: string;\n removeButtonRefs: Array<ButtonProps.Ref | undefined>;\n onRemoveButtonClick?: NonCancelableEventHandler<AttributeEditorProps.RemoveButtonClickDetail>;\n removeButtonAriaLabel?: (item: T) => string;\n}\n\nfunction render<T>(\n item: T,\n itemIndex: number,\n slot: AttributeEditorProps.FieldRenderable<T> | React.ReactNode | undefined\n) {\n if (isSlotFunction(slot)) {\n return slot(item, itemIndex);\n }\n return slot;\n\n function isSlotFunction(slot: unknown): slot is AttributeEditorProps.FieldRenderable<T> {\n return typeof slot === 'function';\n }\n}\n\nconst GRID_DEFINITION = [{ colspan: { default: 12, xs: 9 } }];\nconst REMOVABLE_GRID_DEFINITION = [{ colspan: { default: 12, xs: 9 } }, { colspan: { default: 12, xs: 3 } }];\nexport const Row = React.memo(\n <T,>({\n breakpoint,\n item,\n definition,\n i18nStrings = {},\n index,\n removable,\n removeButtonText,\n removeButtonRefs,\n onRemoveButtonClick,\n removeButtonAriaLabel,\n }: RowProps<T>) => {\n const i18n = useInternalI18n('attribute-editor');\n const isNarrowViewport = breakpoint === 'default' || breakpoint === 'xxs';\n const isWideViewport = !isNarrowViewport;\n\n const handleRemoveClick = useCallback(() => {\n fireNonCancelableEvent(onRemoveButtonClick, { itemIndex: index });\n }, [onRemoveButtonClick, index]);\n\n const firstControlId = useUniqueId('first-control-id-');\n\n return (\n <InternalBox className={styles.row} margin={{ bottom: 's' }}>\n <div role=\"group\" aria-labelledby={`${firstControlId}-label ${firstControlId}`}>\n <InternalGrid\n __breakpoint={breakpoint}\n gridDefinition={removable ? REMOVABLE_GRID_DEFINITION : GRID_DEFINITION}\n >\n <InternalColumnLayout\n className={styles['row-control']}\n columns={definition.length}\n __breakpoint={breakpoint}\n >\n {definition.map(({ info, label, constraintText, errorText, warningText, control }, defIndex) => (\n <InternalFormField\n key={defIndex}\n className={styles.field}\n label={label}\n info={info}\n constraintText={render(item, index, constraintText)}\n errorText={render(item, index, errorText)}\n warningText={render(item, index, warningText)}\n stretch={true}\n i18nStrings={{\n errorIconAriaLabel: i18nStrings.errorIconAriaLabel,\n warningIconAriaLabel: i18nStrings.warningIconAriaLabel,\n }}\n __hideLabel={isWideViewport && index > 0}\n controlId={defIndex === 0 ? firstControlId : undefined}\n >\n {render(item, index, control)}\n </InternalFormField>\n ))}\n </InternalColumnLayout>\n {removable && (\n <ButtonContainer\n index={index}\n isNarrowViewport={isNarrowViewport}\n hasLabel={definition.some(row => row.label)}\n >\n <InternalButton\n className={styles['remove-button']}\n formAction=\"none\"\n ref={ref => {\n removeButtonRefs[index] = ref ?? undefined;\n }}\n ariaLabel={(removeButtonAriaLabel ?? i18nStrings.removeButtonAriaLabel)?.(item)}\n onClick={handleRemoveClick}\n >\n {i18n('removeButtonText', removeButtonText)}\n </InternalButton>\n </ButtonContainer>\n )}\n </InternalGrid>\n </div>\n {isNarrowViewport && <Divider />}\n </InternalBox>\n );\n }\n) as <T>(props: RowProps<T>) => JSX.Element;\n\ninterface ButtonContainer {\n index: number;\n children: React.ReactNode;\n isNarrowViewport: boolean;\n hasLabel: boolean;\n}\n\nconst ButtonContainer = ({ index, children, isNarrowViewport, hasLabel }: ButtonContainer) => (\n <div\n className={clsx({\n [styles['button-container-haslabel']]: !isNarrowViewport && index === 0 && hasLabel,\n [styles['button-container-nolabel']]: !isNarrowViewport && index === 0 && !hasLabel,\n [styles['right-align']]: isNarrowViewport,\n })}\n >\n {children}\n </div>\n);\n"]}
1
+ {"version":3,"file":"row.js","sourceRoot":"","sources":["../../../src/attribute-editor/row.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,EAAE,sBAAsB,EAA6B,MAAM,oBAAoB,CAAC;AACvF,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAE9D,OAAO,EAAE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K,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,IAErD,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,CACX,CACrB,CAAC;QACJ,CAAC,CAAC;QACF,6BACE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,yBAAyB,CAAC,EAAE;gBACjD,CAAC,MAAM,CAAC,6BAA6B,CAAC,CAAC,EAAE,sBAAsB,IAAI,KAAK,KAAK,CAAC;gBAC9E,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC,EAAE,CAAC,sBAAsB;aAC3D,CAAC,EACF,KAAK,oBAAO,0BAA0B,CAAC,MAAM,EAAE,aAAa,CAAC,KAE5D,SAAS;YACR,CAAC,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,CAC7B,aAAa,CACd,CAAC,CAAC,CAAC,CACF,oBAAC,cAAc,IACb,SAAS,EAAE,MAAM,CAAC,eAAe,CAAC,EAClC,UAAU,EAAC,MAAM,EACjB,GAAG,EAAE,SAAS,EACd,SAAS,EAAE,MAAA,CAAC,qBAAqB,aAArB,qBAAqB,cAArB,qBAAqB,GAAI,WAAW,CAAC,qBAAqB,CAAC,0CAAG,IAAI,CAAC,EAC/E,OAAO,EAAE,iBAAiB,IAEzB,IAAI,CAAC,kBAAkB,EAAE,gBAAgB,CAAC,CAC5B,CAClB,CAAC,CACA;QACL,CAAC,sBAAsB,IAAI,6BAAK,SAAS,EAAE,MAAM,CAAC,OAAO,GAAI,CAC1D,CACP,CAAC;AACJ,CAAC,CACwC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useCallback } from 'react';\nimport clsx from 'clsx';\n\nimport { ButtonProps } from '../button/interfaces';\nimport { InternalButton } from '../button/internal';\nimport InternalFormField from '../form-field/internal';\nimport { useInternalI18n } from '../i18n/context';\nimport { Breakpoint } from '../internal/breakpoints';\nimport { fireNonCancelableEvent, NonCancelableEventHandler } from '../internal/events';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { AttributeEditorProps } from './interfaces';\nimport { getItemGridColumns, getRemoveButtonGridColumns, isRemoveButtonOnSameLine } from './utils';\n\nimport styles from './styles.css.js';\n\ninterface RowProps<T> {\n breakpoint: Breakpoint | null;\n layout: AttributeEditorProps.GridLayout;\n item: T;\n definition: ReadonlyArray<AttributeEditorProps.FieldDefinition<T>>;\n i18nStrings: AttributeEditorProps.I18nStrings | undefined;\n index: number;\n removable: boolean;\n removeButtonText?: string;\n removeButtonRefs: Array<ButtonProps.Ref | undefined>;\n customRowActions?: (props: AttributeEditorProps.RowActionsProps<T>) => React.ReactNode;\n onRemoveButtonClick?: NonCancelableEventHandler<AttributeEditorProps.RemoveButtonClickDetail>;\n removeButtonAriaLabel?: (item: T) => string;\n}\n\nfunction render<T>(\n item: T,\n itemIndex: number,\n slot: AttributeEditorProps.FieldRenderable<T> | React.ReactNode | undefined\n) {\n if (isSlotFunction(slot)) {\n return slot(item, itemIndex);\n }\n return slot;\n\n function isSlotFunction(slot: unknown): slot is AttributeEditorProps.FieldRenderable<T> {\n return typeof slot === 'function';\n }\n}\n\nexport const Row = React.memo(\n <T,>({\n breakpoint,\n item,\n definition,\n layout,\n i18nStrings = {},\n index,\n removable,\n removeButtonText,\n removeButtonRefs,\n customRowActions,\n onRemoveButtonClick,\n removeButtonAriaLabel,\n }: RowProps<T>) => {\n const i18n = useInternalI18n('attribute-editor');\n\n const handleRemoveClick = useCallback(() => {\n fireNonCancelableEvent(onRemoveButtonClick, { itemIndex: index });\n }, [onRemoveButtonClick, index]);\n\n const firstControlId = useUniqueId('first-control-id-');\n\n const buttonRef = (ref: ButtonProps.Ref | null) => {\n removeButtonRefs[index] = ref ?? undefined;\n };\n\n let gridColumnStart = 1;\n let gridColumnEnd = 1;\n const removeButtonOnSameLine = isRemoveButtonOnSameLine(layout);\n\n const customActions = customRowActions?.({\n item,\n itemIndex: index,\n ref: buttonRef,\n breakpoint,\n ownRow: !removeButtonOnSameLine,\n });\n\n return (\n <div\n className={clsx(styles.row, layout.rows.length === 1 && styles['single-row'])}\n role=\"group\"\n aria-labelledby={`${firstControlId}-label ${firstControlId}`}\n >\n {definition.map(({ info, label, constraintText, errorText, warningText, control }, defIndex) => {\n ({ gridColumnStart, gridColumnEnd } = getItemGridColumns(layout, defIndex));\n return (\n <InternalFormField\n key={defIndex}\n className={styles.field}\n __style={{ gridColumnStart, gridColumnEnd }}\n label={label}\n info={info}\n constraintText={render(item, index, constraintText)}\n errorText={render(item, index, errorText)}\n warningText={render(item, index, warningText)}\n stretch={true}\n i18nStrings={{\n errorIconAriaLabel: i18nStrings.errorIconAriaLabel,\n warningIconAriaLabel: i18nStrings.warningIconAriaLabel,\n }}\n __hideLabel={index !== 0 && removeButtonOnSameLine}\n controlId={defIndex === 0 ? firstControlId : undefined}\n >\n {render(item, index, control)}\n </InternalFormField>\n );\n })}\n <div\n className={clsx(styles['remove-button-container'], {\n [styles['remove-button-field-padding']]: removeButtonOnSameLine && index === 0,\n [styles['remove-button-own-row']]: !removeButtonOnSameLine,\n })}\n style={{ ...getRemoveButtonGridColumns(layout, gridColumnEnd) }}\n >\n {removable &&\n (customActions !== undefined ? (\n customActions\n ) : (\n <InternalButton\n className={styles['remove-button']}\n formAction=\"none\"\n ref={buttonRef}\n ariaLabel={(removeButtonAriaLabel ?? i18nStrings.removeButtonAriaLabel)?.(item)}\n onClick={handleRemoveClick}\n >\n {i18n('removeButtonText', removeButtonText)}\n </InternalButton>\n ))}\n </div>\n {!removeButtonOnSameLine && <div className={styles.divider} />}\n </div>\n );\n }\n) as <T>(props: RowProps<T>) => JSX.Element;\n"]}
@@ -1,19 +1,20 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "empty-appear": "awsui_empty-appear_n4qlp_1nsib_153",
5
- "awsui-motion-fade-in": "awsui_awsui-motion-fade-in_n4qlp_1nsib_1",
6
- "root": "awsui_root_n4qlp_1nsib_175",
7
- "empty": "awsui_empty_n4qlp_1nsib_153",
8
- "row": "awsui_row_n4qlp_1nsib_214",
9
- "row-control": "awsui_row-control_n4qlp_1nsib_218",
10
- "field": "awsui_field_n4qlp_1nsib_222",
11
- "add-button": "awsui_add-button_n4qlp_1nsib_226",
12
- "remove-button": "awsui_remove-button_n4qlp_1nsib_230",
13
- "button-container-haslabel": "awsui_button-container-haslabel_n4qlp_1nsib_234",
14
- "button-container-nolabel": "awsui_button-container-nolabel_n4qlp_1nsib_238",
15
- "divider": "awsui_divider_n4qlp_1nsib_242",
16
- "additional-info": "awsui_additional-info_n4qlp_1nsib_246",
17
- "right-align": "awsui_right-align_n4qlp_1nsib_292"
4
+ "empty-appear": "awsui_empty-appear_n4qlp_1j0l4_153",
5
+ "awsui-motion-fade-in": "awsui_awsui-motion-fade-in_n4qlp_1j0l4_1",
6
+ "root": "awsui_root_n4qlp_1j0l4_175",
7
+ "empty": "awsui_empty_n4qlp_1j0l4_153",
8
+ "row": "awsui_row_n4qlp_1j0l4_218",
9
+ "divider": "awsui_divider_n4qlp_1j0l4_222",
10
+ "row-control": "awsui_row-control_n4qlp_1j0l4_227",
11
+ "field": "awsui_field_n4qlp_1j0l4_231",
12
+ "additional-info": "awsui_additional-info_n4qlp_1j0l4_235",
13
+ "add-row": "awsui_add-row_n4qlp_1j0l4_281",
14
+ "add-button": "awsui_add-button_n4qlp_1j0l4_285",
15
+ "remove-button-container": "awsui_remove-button-container_n4qlp_1j0l4_289",
16
+ "remove-button-field-padding": "awsui_remove-button-field-padding_n4qlp_1j0l4_293",
17
+ "remove-button-own-row": "awsui_remove-button-own-row_n4qlp_1j0l4_297",
18
+ "remove-button": "awsui_remove-button_n4qlp_1j0l4_289"
18
19
  };
19
20
 
@@ -150,10 +150,10 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
150
150
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
151
151
  SPDX-License-Identifier: Apache-2.0
152
152
  */
153
- .awsui_empty-appear_n4qlp_1nsib_153:not(#\9) {
154
- animation: awsui_awsui-motion-fade-in_n4qlp_1nsib_1 var(--motion-duration-transition-show-paced-9s9l5z, 180ms) var(--motion-easing-transition-show-paced-eobwvi, ease-out);
153
+ .awsui_empty-appear_n4qlp_1j0l4_153:not(#\9) {
154
+ animation: awsui_awsui-motion-fade-in_n4qlp_1j0l4_1 var(--motion-duration-transition-show-paced-9s9l5z, 180ms) var(--motion-easing-transition-show-paced-eobwvi, ease-out);
155
155
  }
156
- @keyframes awsui_awsui-motion-fade-in_n4qlp_1nsib_1 {
156
+ @keyframes awsui_awsui-motion-fade-in_n4qlp_1j0l4_1 {
157
157
  from {
158
158
  opacity: 0.2;
159
159
  }
@@ -162,17 +162,17 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
162
162
  }
163
163
  }
164
164
  @media (prefers-reduced-motion: reduce) {
165
- .awsui_empty-appear_n4qlp_1nsib_153:not(#\9) {
165
+ .awsui_empty-appear_n4qlp_1j0l4_153:not(#\9) {
166
166
  animation: none;
167
167
  transition: none;
168
168
  }
169
169
  }
170
- .awsui-motion-disabled .awsui_empty-appear_n4qlp_1nsib_153:not(#\9), .awsui-mode-entering .awsui_empty-appear_n4qlp_1nsib_153:not(#\9) {
170
+ .awsui-motion-disabled .awsui_empty-appear_n4qlp_1j0l4_153:not(#\9), .awsui-mode-entering .awsui_empty-appear_n4qlp_1j0l4_153:not(#\9) {
171
171
  animation: none;
172
172
  transition: none;
173
173
  }
174
174
 
175
- .awsui_root_n4qlp_1nsib_175:not(#\9) {
175
+ .awsui_root_n4qlp_1j0l4_175:not(#\9) {
176
176
  border-collapse: separate;
177
177
  border-spacing: 0;
178
178
  box-sizing: border-box;
@@ -203,48 +203,37 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
203
203
  font-family: var(--font-family-base-dnvic8, "Open Sans", "Helvetica Neue", Roboto, Arial, sans-serif);
204
204
  -webkit-font-smoothing: auto;
205
205
  -moz-osx-font-smoothing: auto;
206
- display: block;
206
+ display: grid;
207
+ grid-template-rows: min-content;
208
+ gap: var(--space-grid-gutter-ieqn7e, 20px);
209
+ align-items: start;
207
210
  }
208
211
 
209
- .awsui_empty_n4qlp_1nsib_153:not(#\9) {
212
+ .awsui_empty_n4qlp_1j0l4_153:not(#\9) {
210
213
  font-size: var(--font-size-body-m-x4okxb, 14px);
211
214
  line-height: var(--line-height-body-m-30ar75, 20px);
212
215
  color: var(--color-text-empty-o6660v, #656871);
216
+ grid-column: 1/-1;
213
217
  }
214
218
 
215
- .awsui_row_n4qlp_1nsib_214:not(#\9) {
216
- /* used in test-utils */
219
+ .awsui_row_n4qlp_1j0l4_218:not(#\9) {
220
+ display: contents;
217
221
  }
218
222
 
219
- .awsui_row-control_n4qlp_1nsib_218:not(#\9) {
220
- /* used in test-utils */
223
+ .awsui_divider_n4qlp_1j0l4_222:not(#\9) {
224
+ grid-column: 1/-1;
225
+ border-block-start: var(--border-divider-section-width-1061zr, 1px) solid var(--color-border-divider-default-cx07f2, #c6c6cd);
221
226
  }
222
227
 
223
- .awsui_field_n4qlp_1nsib_222:not(#\9) {
228
+ .awsui_row-control_n4qlp_1j0l4_227:not(#\9) {
224
229
  /* used in test-utils */
225
230
  }
226
231
 
227
- .awsui_add-button_n4qlp_1nsib_226:not(#\9) {
232
+ .awsui_field_n4qlp_1j0l4_231:not(#\9) {
228
233
  /* used in test-utils */
229
234
  }
230
235
 
231
- .awsui_remove-button_n4qlp_1nsib_230:not(#\9) {
232
- /* used in test-utils */
233
- }
234
-
235
- .awsui_button-container-haslabel_n4qlp_1nsib_234:not(#\9) {
236
- padding-block-start: calc(var(--space-xxs-p8yyaw, 4px) + var(--line-height-body-m-30ar75, 20px));
237
- }
238
-
239
- .awsui_button-container-nolabel_n4qlp_1nsib_238:not(#\9) {
240
- padding-block-start: var(--space-xxs-p8yyaw, 4px);
241
- }
242
-
243
- .awsui_divider_n4qlp_1nsib_242:not(#\9) {
244
- border-block-end: var(--border-divider-section-width-1061zr, 1px) solid var(--color-border-divider-default-cx07f2, #c6c6cd);
245
- }
246
-
247
- .awsui_additional-info_n4qlp_1nsib_246:not(#\9) {
236
+ .awsui_additional-info_n4qlp_1j0l4_235:not(#\9) {
248
237
  color: var(--color-text-form-secondary-54emib, #656871);
249
238
  font-size: var(--font-size-body-s-asqx2i, 12px);
250
239
  line-height: var(--line-height-body-s-7zv1j5, 16px);
@@ -254,7 +243,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
254
243
  margin-block-start: var(--space-xxs-p8yyaw, 4px);
255
244
  /* stylelint-disable-next-line selector-max-type */
256
245
  }
257
- .awsui_additional-info_n4qlp_1nsib_246 > a:not(#\9) {
246
+ .awsui_additional-info_n4qlp_1j0l4_235 > a:not(#\9) {
258
247
  text-underline-offset: 0.3em;
259
248
  text-decoration-thickness: 1px;
260
249
  color: var(--color-text-link-default-enwvrt, #006ce0);
@@ -268,31 +257,50 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
268
257
  transition-duration: var(--motion-duration-refresh-only-medium-nf6485, 165ms);
269
258
  }
270
259
  @media (prefers-reduced-motion: reduce) {
271
- .awsui_additional-info_n4qlp_1nsib_246 > a:not(#\9) {
260
+ .awsui_additional-info_n4qlp_1j0l4_235 > a:not(#\9) {
272
261
  animation: none;
273
262
  transition: none;
274
263
  }
275
264
  }
276
- .awsui-motion-disabled .awsui_additional-info_n4qlp_1nsib_246 > a:not(#\9), .awsui-mode-entering .awsui_additional-info_n4qlp_1nsib_246 > a:not(#\9) {
265
+ .awsui-motion-disabled .awsui_additional-info_n4qlp_1j0l4_235 > a:not(#\9), .awsui-mode-entering .awsui_additional-info_n4qlp_1j0l4_235 > a:not(#\9) {
277
266
  animation: none;
278
267
  transition: none;
279
268
  }
280
- .awsui_additional-info_n4qlp_1nsib_246 > a:not(#\9):hover {
269
+ .awsui_additional-info_n4qlp_1j0l4_235 > a:not(#\9):hover {
281
270
  cursor: pointer;
282
271
  color: var(--color-text-link-hover-49uoe9, #002b66);
283
272
  }
284
- .awsui_additional-info_n4qlp_1nsib_246 > a:not(#\9):focus {
273
+ .awsui_additional-info_n4qlp_1j0l4_235 > a:not(#\9):focus {
285
274
  outline: none;
286
275
  }
287
- .awsui_additional-info_n4qlp_1nsib_246 > a:not(#\9):active {
276
+ .awsui_additional-info_n4qlp_1j0l4_235 > a:not(#\9):active {
288
277
  color: var(--color-text-link-hover-49uoe9, #002b66);
289
278
  }
290
- .awsui_additional-info_n4qlp_1nsib_246 > a:not(#\9):active, .awsui_additional-info_n4qlp_1nsib_246 > a:not(#\9):focus, .awsui_additional-info_n4qlp_1nsib_246 > a:not(#\9):hover {
279
+ .awsui_additional-info_n4qlp_1j0l4_235 > a:not(#\9):active, .awsui_additional-info_n4qlp_1j0l4_235 > a:not(#\9):focus, .awsui_additional-info_n4qlp_1j0l4_235 > a:not(#\9):hover {
291
280
  text-decoration-line: underline;
292
281
  text-decoration-color: currentColor;
293
282
  }
294
283
 
295
- .awsui_right-align_n4qlp_1nsib_292:not(#\9) {
296
- display: flex;
297
- justify-content: flex-end;
284
+ .awsui_add-row_n4qlp_1j0l4_281:not(#\9) {
285
+ grid-column: 1/-1;
286
+ }
287
+
288
+ .awsui_add-button_n4qlp_1j0l4_285:not(#\9) {
289
+ /* used in test-utils */
290
+ }
291
+
292
+ .awsui_remove-button-container_n4qlp_1j0l4_289:not(#\9) {
293
+ display: inline-block;
294
+ }
295
+
296
+ .awsui_remove-button-field-padding_n4qlp_1j0l4_293:not(#\9) {
297
+ padding-block-start: calc(var(--space-xxs-p8yyaw, 4px) + var(--line-height-body-m-30ar75, 20px));
298
+ }
299
+
300
+ .awsui_remove-button-own-row_n4qlp_1j0l4_297:not(#\9) {
301
+ justify-self: end;
302
+ }
303
+
304
+ .awsui_remove-button_n4qlp_1j0l4_289:not(#\9) {
305
+ /* used in test-utils */
298
306
  }
@@ -2,19 +2,20 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "empty-appear": "awsui_empty-appear_n4qlp_1nsib_153",
6
- "awsui-motion-fade-in": "awsui_awsui-motion-fade-in_n4qlp_1nsib_1",
7
- "root": "awsui_root_n4qlp_1nsib_175",
8
- "empty": "awsui_empty_n4qlp_1nsib_153",
9
- "row": "awsui_row_n4qlp_1nsib_214",
10
- "row-control": "awsui_row-control_n4qlp_1nsib_218",
11
- "field": "awsui_field_n4qlp_1nsib_222",
12
- "add-button": "awsui_add-button_n4qlp_1nsib_226",
13
- "remove-button": "awsui_remove-button_n4qlp_1nsib_230",
14
- "button-container-haslabel": "awsui_button-container-haslabel_n4qlp_1nsib_234",
15
- "button-container-nolabel": "awsui_button-container-nolabel_n4qlp_1nsib_238",
16
- "divider": "awsui_divider_n4qlp_1nsib_242",
17
- "additional-info": "awsui_additional-info_n4qlp_1nsib_246",
18
- "right-align": "awsui_right-align_n4qlp_1nsib_292"
5
+ "empty-appear": "awsui_empty-appear_n4qlp_1j0l4_153",
6
+ "awsui-motion-fade-in": "awsui_awsui-motion-fade-in_n4qlp_1j0l4_1",
7
+ "root": "awsui_root_n4qlp_1j0l4_175",
8
+ "empty": "awsui_empty_n4qlp_1j0l4_153",
9
+ "row": "awsui_row_n4qlp_1j0l4_218",
10
+ "divider": "awsui_divider_n4qlp_1j0l4_222",
11
+ "row-control": "awsui_row-control_n4qlp_1j0l4_227",
12
+ "field": "awsui_field_n4qlp_1j0l4_231",
13
+ "additional-info": "awsui_additional-info_n4qlp_1j0l4_235",
14
+ "add-row": "awsui_add-row_n4qlp_1j0l4_281",
15
+ "add-button": "awsui_add-button_n4qlp_1j0l4_285",
16
+ "remove-button-container": "awsui_remove-button-container_n4qlp_1j0l4_289",
17
+ "remove-button-field-padding": "awsui_remove-button-field-padding_n4qlp_1j0l4_293",
18
+ "remove-button-own-row": "awsui_remove-button-own-row_n4qlp_1j0l4_297",
19
+ "remove-button": "awsui_remove-button_n4qlp_1j0l4_289"
19
20
  };
20
21
 
@@ -0,0 +1,11 @@
1
+ import { AttributeEditorProps } from './interfaces';
2
+ interface GridColumns {
3
+ gridColumnStart: number;
4
+ gridColumnEnd: number;
5
+ }
6
+ export declare function getItemGridColumns(layout: AttributeEditorProps.GridLayout, itemIndex: number): GridColumns;
7
+ export declare function getRemoveButtonGridColumns(layout: AttributeEditorProps.GridLayout, previousGridColumnEnd: number): GridColumns;
8
+ export declare function isRemoveButtonOnSameLine(layout: AttributeEditorProps.GridLayout): boolean;
9
+ export declare function getGridTemplateColumns(layout: AttributeEditorProps.GridLayout): string;
10
+ export {};
11
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/attribute-editor/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEpD,UAAU,WAAW;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,oBAAoB,CAAC,UAAU,EAAE,SAAS,EAAE,MAAM,GAAG,WAAW,CAc1G;AAED,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,oBAAoB,CAAC,UAAU,EACvC,qBAAqB,EAAE,MAAM,GAC5B,WAAW,CAiBb;AAED,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,oBAAoB,CAAC,UAAU,WAE/E;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,oBAAoB,CAAC,UAAU,UAiB7E"}
@@ -0,0 +1,43 @@
1
+ export function getItemGridColumns(layout, itemIndex) {
2
+ let i = 0;
3
+ for (const row of layout.rows) {
4
+ let gridColumnStart = 1;
5
+ for (const columnWidth of row) {
6
+ if (i === itemIndex) {
7
+ return { gridColumnStart, gridColumnEnd: gridColumnStart + columnWidth };
8
+ }
9
+ else {
10
+ gridColumnStart += columnWidth;
11
+ }
12
+ i++;
13
+ }
14
+ }
15
+ return { gridColumnStart: 1, gridColumnEnd: 1 };
16
+ }
17
+ export function getRemoveButtonGridColumns(layout, previousGridColumnEnd) {
18
+ var _a, _b;
19
+ const maxColumns = layout.rows.reduce((max, columns) => Math.max(max, columns.reduce((sum, col) => sum + col, 0)), 0);
20
+ if (isRemoveButtonOnSameLine(layout)) {
21
+ const removeButtonWidth = typeof ((_a = layout.removeButton) === null || _a === void 0 ? void 0 : _a.width) === 'number' ? (_b = layout.removeButton) === null || _b === void 0 ? void 0 : _b.width : 1;
22
+ return {
23
+ gridColumnStart: previousGridColumnEnd,
24
+ gridColumnEnd: previousGridColumnEnd + removeButtonWidth,
25
+ };
26
+ }
27
+ return { gridColumnStart: 1, gridColumnEnd: maxColumns + 1 };
28
+ }
29
+ export function isRemoveButtonOnSameLine(layout) {
30
+ var _a;
31
+ return layout.rows.length === 1 && !((_a = layout.removeButton) === null || _a === void 0 ? void 0 : _a.ownRow);
32
+ }
33
+ export function getGridTemplateColumns(layout) {
34
+ var _a, _b, _c;
35
+ const totalColumnUnits = layout.rows.reduce((maxCols, row) => Math.max(maxCols, row.reduce((cols, col) => cols + col, 0)), 0);
36
+ const removeButtonColumn = isRemoveButtonOnSameLine(layout)
37
+ ? ((_a = layout.removeButton) === null || _a === void 0 ? void 0 : _a.width) === 'auto'
38
+ ? 'max-content'
39
+ : `${(_c = (_b = layout.removeButton) === null || _b === void 0 ? void 0 : _b.width) !== null && _c !== void 0 ? _c : 1}fr`
40
+ : '';
41
+ return `repeat(${totalColumnUnits}, 1fr) ${removeButtonColumn}`;
42
+ }
43
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/attribute-editor/utils.ts"],"names":[],"mappings":"AASA,MAAM,UAAU,kBAAkB,CAAC,MAAuC,EAAE,SAAiB;IAC3F,IAAI,CAA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IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,CAAA,MAAA,MAAM,CAAC,YAAY,0CAAE,MAAM,CAAA,CAAC;AAClE,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,MAAuC;;IAC5E,MAAM,gBAAgB,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CACzC,CAAC,OAAO,EAAE,GAAG,EAAE,EAAE,CACf,IAAI,CAAC,GAAG,CACN,OAAO,EACP,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,IAAI,GAAG,GAAG,EAAE,CAAC,CAAC,CACzC,EACH,CAAC,CACF,CAAC;IAEF,MAAM,kBAAkB,GAAG,wBAAwB,CAAC,MAAM,CAAC;QACzD,CAAC,CAAC,CAAA,MAAA,MAAM,CAAC,YAAY,0CAAE,KAAK,MAAK,MAAM;YACrC,CAAC,CAAC,aAAa;YACf,CAAC,CAAC,GAAG,MAAA,MAAA,MAAM,CAAC,YAAY,0CAAE,KAAK,mCAAI,CAAC,IAAI;QAC1C,CAAC,CAAC,EAAE,CAAC;IAEP,OAAO,UAAU,gBAAgB,UAAU,kBAAkB,EAAE,CAAC;AAClE,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { AttributeEditorProps } from './interfaces';\n\ninterface GridColumns {\n gridColumnStart: number;\n gridColumnEnd: number;\n}\n\nexport function getItemGridColumns(layout: AttributeEditorProps.GridLayout, itemIndex: number): GridColumns {\n let i = 0;\n for (const row of layout.rows) {\n let gridColumnStart = 1;\n for (const columnWidth of row) {\n if (i === itemIndex) {\n return { gridColumnStart, gridColumnEnd: gridColumnStart + columnWidth };\n } else {\n gridColumnStart += columnWidth;\n }\n i++;\n }\n }\n return { gridColumnStart: 1, gridColumnEnd: 1 };\n}\n\nexport function getRemoveButtonGridColumns(\n layout: AttributeEditorProps.GridLayout,\n previousGridColumnEnd: number\n): GridColumns {\n const maxColumns = layout.rows.reduce(\n (max, columns) =>\n Math.max(\n max,\n columns.reduce((sum, col) => sum + col, 0)\n ),\n 0\n );\n if (isRemoveButtonOnSameLine(layout)) {\n const removeButtonWidth = typeof layout.removeButton?.width === 'number' ? layout.removeButton?.width : 1;\n return {\n gridColumnStart: previousGridColumnEnd,\n gridColumnEnd: previousGridColumnEnd + removeButtonWidth,\n };\n }\n return { gridColumnStart: 1, gridColumnEnd: maxColumns + 1 };\n}\n\nexport function isRemoveButtonOnSameLine(layout: AttributeEditorProps.GridLayout) {\n return layout.rows.length === 1 && !layout.removeButton?.ownRow;\n}\n\nexport function getGridTemplateColumns(layout: AttributeEditorProps.GridLayout) {\n const totalColumnUnits = layout.rows.reduce(\n (maxCols, row) =>\n Math.max(\n maxCols,\n row.reduce((cols, col) => cols + col, 0)\n ),\n 0\n );\n\n const removeButtonColumn = isRemoveButtonOnSameLine(layout)\n ? layout.removeButton?.width === 'auto'\n ? 'max-content'\n : `${layout.removeButton?.width ?? 1}fr`\n : '';\n\n return `repeat(${totalColumnUnits}, 1fr) ${removeButtonColumn}`;\n}\n"]}
@@ -172,9 +172,13 @@ export declare namespace ButtonDropdownProps {
172
172
  }
173
173
  interface Ref {
174
174
  /**
175
- * Focuses the underlying native button.
175
+ * Focuses the underlying native button. If a main action is defined this will focus that button.
176
176
  */
177
- focus(): void;
177
+ focus(options?: FocusOptions): void;
178
+ /**
179
+ * Focuses the underlying native button for the dropdown.
180
+ */
181
+ focusDropdownTrigger(options?: FocusOptions): void;
178
182
  }
179
183
  }
180
184
  export interface ButtonDropdownSettings {
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/button-dropdown/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kCAAkC,EAAE,MAAM,kEAAkE,CAAC;AAEtH,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD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AO,CAAC;CACvB"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/button-dropdown/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { GeneratedAnalyticsMetadataFragment } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport { ButtonProps } from '../button/interfaces';\nimport { IconProps } from '../icon/interfaces';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { ExpandToViewport } from '../internal/components/dropdown/interfaces';\nimport { BaseNavigationDetail, CancelableEventHandler } from '../internal/events';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\n\nexport interface ButtonDropdownProps extends BaseComponentProps, ExpandToViewport {\n /**\n * Array of objects with a number of supported types.\n *\n * The following properties are supported across all types:\n *\n * - `type` (string) - The type of the item. Can be `action`, `group`, `checkbox`. Defaults to `action` if `items` undefined and `group` otherwise.\n * - `id` (string) - allows to identify the item that the user clicked on. Mandatory for individual items, optional for categories.\n * - `text` (string) - description shown in the menu for this item. Mandatory for individual items, optional for categories.\n * - `lang` (string) - (Optional) The language of the item, provided as a BCP 47 language tag.\n * - `disabled` (boolean) - whether the item is disabled. Disabled items are not clickable, but they can be highlighted with the keyboard to make them accessible.\n * - `disabledReason` (string) - (Optional) Displays text near the `text` property when item is disabled. Use to provide additional context.\n * - `description` (string) - additional data that will be passed to a `data-description` attribute.\n * - `ariaLabel` (string) - (Optional) - ARIA label of the item element.\n *\n * ### action\n *\n * - `href` (string) - (Optional) Defines the target URL of the menu item, turning it into a link.\n * - `external` (boolean) - Marks a menu item as external by adding an icon after the menu item text. The link will open in a new tab when clicked. Note that this only works when `href` is also provided.\n * - `externalIconAriaLabel` (string) - Adds an `aria-label` to the external icon.\n * - `iconName` (string) - (Optional) Specifies the name of the icon, used with the [icon component](/components/icon/).\n * - `iconAlt` (string) - (Optional) Specifies alternate text for the icon when using `iconUrl`.\n * - `iconUrl` (string) - (Optional) Specifies the URL of a custom icon.\n * - `iconSvg` (ReactNode) - (Optional) Custom SVG icon. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n *\n * ### checkbox\n *\n * When `type` is set to \"checkbox\", the values set to `href`, `external` and `externalIconAriaLabel` will be ignored.\n *\n * - `checked` (boolean) - Controls the state of the checkbox item.\n * - `iconName` (string) - (Optional) Specifies the name of the icon, used with the [icon component](/components/icon/).\n * - `iconAlt` (string) - (Optional) Specifies alternate text for the icon when using `iconUrl`.\n * - `iconUrl` (string) - (Optional) Specifies the URL of a custom icon.\n * - `iconSvg` (ReactNode) - (Optional) Custom SVG icon. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n *\n * ### group\n *\n * - `items` (ReadonlyArray<Item>) - an array of item objects. Items will be rendered as nested menu items but only for the first nesting level, multi-nesting is not supported.\n * An item which belongs to nested group has the following properties: `id`, `text`, `disabled`, and `description`.\n *\n */\n items: ReadonlyArray<ButtonDropdownProps.ItemOrGroup>;\n /**\n * Determines whether the button dropdown is disabled. Users cannot interact with the control if it's disabled.\n */\n disabled?: boolean;\n /**\n * Provides a reason why the button dropdown is disabled (only when `disabled` is `true`).\n * If provided, the disabled button becomes focusable.\n */\n disabledReason?: string;\n /**\n * Renders the button as being in a loading state. It takes precedence over the `disabled` if both are set to `true`.\n * It prevents clicks.\n */\n loading?: boolean;\n /**\n * Specifies the text that screen reader announces when the button dropdown is in a loading state.\n */\n loadingText?: string;\n /** Determines the general styling of the button dropdown.\n * * `primary` for primary buttons\n * * `normal` for secondary buttons\n * * `icon` for icon buttons\n * * `inline-icon` for icon buttons with no outer padding\n */\n variant?: ButtonDropdownProps.Variant;\n /**\n * Controls expandability of the item groups.\n */\n expandableGroups?: boolean;\n /**\n * Adds `aria-label` to the button dropdown trigger.\n * Use this to provide an accessible name for buttons that don't have visible text.\n */\n ariaLabel?: string;\n /**\n * Text displayed in the button dropdown trigger.\n * @displayname text\n */\n children?: React.ReactNode;\n /**\n * Called when the user clicks on an item, and the item is not disabled. The event detail object contains the id of the clicked item.\n */\n onItemClick?: CancelableEventHandler<ButtonDropdownProps.ItemClickDetails>;\n /**\n * Called when the user clicks on an item with the left mouse button without pressing\n * modifier keys (that is, CTRL, ALT, SHIFT, META), and the item has an `href` set.\n */\n onItemFollow?: CancelableEventHandler<ButtonDropdownProps.ItemClickDetails>;\n /**\n * A standalone action that is shown prior to the dropdown trigger.\n * Use it with \"primary\" and \"normal\" variant only.\n *\n * Main action properties:\n * * `text` (string) - Specifies the text shown in the main action.\n * * `external` (boolean) - Marks the main action as external by adding an icon after the text. The link will open in a new tab when clicked. Note that this only works when `href` is also provided.\n * * `externalIconAriaLabel` (string) - Adds an ARIA label to the external icon.\n *\n * The main action also supports the following properties of the [button](/components/button/?tabId=api) component:\n * `ariaLabel`, `disabled`, `loading`, `loadingText`, `href`, `target`, `rel`, `download`, `iconAlt`, `iconName`, `iconUrl`, `iconSvg`, `onClick`, `onFollow`.\n */\n mainAction?: ButtonDropdownProps.MainAction;\n\n /**\n * Sets the button width to be 100% of the parent container width. Button content is centered.\n */\n fullWidth?: boolean;\n}\n\nexport namespace ButtonDropdownProps {\n export type Variant = 'normal' | 'primary' | 'icon' | 'inline-icon';\n export type ItemType = 'action' | 'group';\n\n export interface MainAction {\n text?: string;\n ariaLabel?: string;\n onClick?: CancelableEventHandler<ButtonProps.ClickDetail>;\n onFollow?: CancelableEventHandler<ButtonProps.FollowDetail>;\n disabled?: boolean;\n disabledReason?: string;\n loading?: boolean;\n loadingText?: string;\n href?: string;\n target?: string;\n rel?: string;\n download?: boolean | string;\n external?: boolean;\n externalIconAriaLabel?: string;\n iconAlt?: string;\n iconName?: IconProps.Name;\n iconUrl?: string;\n iconSvg?: React.ReactNode;\n }\n\n export interface Item {\n itemType?: ItemType;\n id: string;\n text: string;\n ariaLabel?: string;\n lang?: string;\n disabled?: boolean;\n disabledReason?: string;\n description?: string;\n href?: string;\n external?: boolean;\n externalIconAriaLabel?: string;\n iconAlt?: string;\n iconName?: IconProps.Name;\n iconUrl?: string;\n iconSvg?: React.ReactNode;\n }\n\n export interface CheckboxItem\n extends Omit<ButtonDropdownProps.Item, 'href' | 'external' | 'externalIconAriaLabel' | 'itemType'> {\n itemType: 'checkbox';\n checked: boolean;\n }\n\n export interface ItemGroup extends Omit<Item, 'id' | 'text' | 'itemType'> {\n itemType?: 'group';\n id?: string;\n text?: string;\n items: Items;\n }\n\n export type ItemOrGroup = Item | CheckboxItem | ItemGroup;\n\n export type Items = ReadonlyArray<ItemOrGroup>;\n\n export interface ItemClickDetails extends BaseNavigationDetail {\n id: string;\n checked?: boolean;\n }\n\n export interface Ref {\n /**\n * Focuses the underlying native button.\n */\n focus(): void;\n }\n}\n\nexport interface ButtonDropdownSettings {\n // this means whether action is required to make group expand\n hasExpandableGroups: boolean;\n // on smaller screens expandable groups are integrated into parent dropdown\n // this changes keyboard navigation, highlight and activation behavior for parent dropdown\n isInRestrictedView?: boolean;\n}\n\nexport interface HighlightProps {\n targetItem: ButtonDropdownProps.ItemOrGroup | null;\n isHighlighted: (item: ButtonDropdownProps.ItemOrGroup) => boolean;\n isKeyboardHighlight: (item: ButtonDropdownProps.ItemOrGroup) => boolean;\n isExpanded: (group: ButtonDropdownProps.ItemGroup) => boolean;\n highlightItem: (item: ButtonDropdownProps.ItemOrGroup) => void;\n}\n\nexport type GroupToggle = (item: ButtonDropdownProps.ItemGroup, event: React.SyntheticEvent) => void;\nexport type ItemActivate = (\n item: ButtonDropdownProps.Item | ButtonDropdownProps.CheckboxItem,\n event: React.MouseEvent | React.KeyboardEvent\n) => void;\n\nexport interface CategoryProps extends HighlightProps {\n item: ButtonDropdownProps.ItemGroup;\n onGroupToggle: GroupToggle;\n onItemActivate: ItemActivate;\n disabled: boolean;\n lastInDropdown: boolean;\n expandToViewport?: boolean;\n variant?: ItemListProps['variant'];\n position?: string;\n}\n\nexport interface ItemListProps extends HighlightProps {\n items: ButtonDropdownProps.Items;\n onGroupToggle: GroupToggle;\n onItemActivate: ItemActivate;\n categoryDisabled?: boolean;\n hasExpandableGroups?: boolean;\n hasCategoryHeader?: boolean;\n lastInDropdown: boolean;\n expandToViewport?: boolean;\n variant?: InternalButtonDropdownProps['variant'];\n position?: string;\n analyticsMetadataTransformer?: InternalButtonDropdownProps['analyticsMetadataTransformer'];\n linkStyle?: boolean;\n}\n\nexport interface LinkItem extends ButtonDropdownProps.Item {\n href: string;\n}\n\nexport interface ItemProps {\n item: ButtonDropdownProps.Item | ButtonDropdownProps.CheckboxItem | LinkItem;\n disabled: boolean;\n highlighted: boolean;\n onItemActivate: ItemActivate;\n highlightItem: (item: ButtonDropdownProps.ItemOrGroup) => void;\n showDivider: boolean;\n hasCategoryHeader: boolean;\n isKeyboardHighlighted?: boolean;\n variant?: ItemListProps['variant'];\n position?: string;\n analyticsMetadataTransformer?: InternalButtonDropdownProps['analyticsMetadataTransformer'];\n linkStyle?: boolean;\n}\n\nexport interface InternalItem extends ButtonDropdownProps.Item {\n badge?: boolean;\n /**\n * Used in breadcrumb-group: indicates that this breadcrumb item is the current page\n */\n isCurrentBreadcrumb?: boolean;\n}\n\nexport interface InternalCheckboxItem extends ButtonDropdownProps.CheckboxItem {\n badge?: boolean;\n}\n\ninterface InternalItemGroup extends Omit<ButtonDropdownProps.ItemGroup, 'items'> {\n items: InternalItems;\n}\n\ntype InternalItems = ReadonlyArray<InternalItemOrGroup>;\n\nexport type InternalItemOrGroup = InternalItem | InternalCheckboxItem | InternalItemGroup;\n\nexport interface InternalButtonDropdownProps\n extends Omit<ButtonDropdownProps, 'variant' | 'items'>,\n InternalBaseComponentProps {\n customTriggerBuilder?: (props: CustomTriggerProps) => React.ReactNode;\n variant?: ButtonDropdownProps['variant'] | 'navigation';\n items: ReadonlyArray<InternalItemOrGroup>;\n\n /**\n * Optional text that is displayed as the title at the top of the dropdown.\n */\n title?: string;\n\n /**\n * Optional text that is displayed underneath the title at the top of the dropdown.\n */\n description?: string;\n\n /**\n * Only show main action button as a regular, non-split button.\n * That is needed so that button dropdown test utils wrapper can still be used.\n */\n showMainActionOnly?: boolean;\n\n /**\n * Determines that the dropdown should preferably be aligned to the center of the trigger\n * instead of dropping left or right.\n */\n preferCenter?: boolean;\n\n /**\n * Determines whether simple items should be displayed with the link styles.\n * Used in Breadcrumb group component for collapsed breadcrumbs\n */\n linkStyle?: boolean;\n\n /**\n * Determines whether the dropdown should take up the full available width.\n * Used in Breadcrumb group component for collapsed breadcrumbs\n */\n fullWidth?: boolean;\n\n analyticsMetadataTransformer?: (input: GeneratedAnalyticsMetadataFragment) => GeneratedAnalyticsMetadataFragment;\n}\n\nexport interface CustomTriggerProps {\n triggerRef: React.Ref<HTMLElement>;\n testUtilsClass: string;\n ariaLabel: string | undefined;\n disabled: boolean;\n disabledReason?: string;\n isOpen: boolean;\n onClick: () => void;\n ariaExpanded: boolean;\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/button-dropdown/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { GeneratedAnalyticsMetadataFragment } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport { ButtonProps } from '../button/interfaces';\nimport { IconProps } from '../icon/interfaces';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { ExpandToViewport } from '../internal/components/dropdown/interfaces';\nimport { BaseNavigationDetail, CancelableEventHandler } from '../internal/events';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\n\nexport interface ButtonDropdownProps extends BaseComponentProps, ExpandToViewport {\n /**\n * Array of objects with a number of supported types.\n *\n * The following properties are supported across all types:\n *\n * - `type` (string) - The type of the item. Can be `action`, `group`, `checkbox`. Defaults to `action` if `items` undefined and `group` otherwise.\n * - `id` (string) - allows to identify the item that the user clicked on. Mandatory for individual items, optional for categories.\n * - `text` (string) - description shown in the menu for this item. Mandatory for individual items, optional for categories.\n * - `lang` (string) - (Optional) The language of the item, provided as a BCP 47 language tag.\n * - `disabled` (boolean) - whether the item is disabled. Disabled items are not clickable, but they can be highlighted with the keyboard to make them accessible.\n * - `disabledReason` (string) - (Optional) Displays text near the `text` property when item is disabled. Use to provide additional context.\n * - `description` (string) - additional data that will be passed to a `data-description` attribute.\n * - `ariaLabel` (string) - (Optional) - ARIA label of the item element.\n *\n * ### action\n *\n * - `href` (string) - (Optional) Defines the target URL of the menu item, turning it into a link.\n * - `external` (boolean) - Marks a menu item as external by adding an icon after the menu item text. The link will open in a new tab when clicked. Note that this only works when `href` is also provided.\n * - `externalIconAriaLabel` (string) - Adds an `aria-label` to the external icon.\n * - `iconName` (string) - (Optional) Specifies the name of the icon, used with the [icon component](/components/icon/).\n * - `iconAlt` (string) - (Optional) Specifies alternate text for the icon when using `iconUrl`.\n * - `iconUrl` (string) - (Optional) Specifies the URL of a custom icon.\n * - `iconSvg` (ReactNode) - (Optional) Custom SVG icon. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n *\n * ### checkbox\n *\n * When `type` is set to \"checkbox\", the values set to `href`, `external` and `externalIconAriaLabel` will be ignored.\n *\n * - `checked` (boolean) - Controls the state of the checkbox item.\n * - `iconName` (string) - (Optional) Specifies the name of the icon, used with the [icon component](/components/icon/).\n * - `iconAlt` (string) - (Optional) Specifies alternate text for the icon when using `iconUrl`.\n * - `iconUrl` (string) - (Optional) Specifies the URL of a custom icon.\n * - `iconSvg` (ReactNode) - (Optional) Custom SVG icon. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n *\n * ### group\n *\n * - `items` (ReadonlyArray<Item>) - an array of item objects. Items will be rendered as nested menu items but only for the first nesting level, multi-nesting is not supported.\n * An item which belongs to nested group has the following properties: `id`, `text`, `disabled`, and `description`.\n *\n */\n items: ReadonlyArray<ButtonDropdownProps.ItemOrGroup>;\n /**\n * Determines whether the button dropdown is disabled. Users cannot interact with the control if it's disabled.\n */\n disabled?: boolean;\n /**\n * Provides a reason why the button dropdown is disabled (only when `disabled` is `true`).\n * If provided, the disabled button becomes focusable.\n */\n disabledReason?: string;\n /**\n * Renders the button as being in a loading state. It takes precedence over the `disabled` if both are set to `true`.\n * It prevents clicks.\n */\n loading?: boolean;\n /**\n * Specifies the text that screen reader announces when the button dropdown is in a loading state.\n */\n loadingText?: string;\n /** Determines the general styling of the button dropdown.\n * * `primary` for primary buttons\n * * `normal` for secondary buttons\n * * `icon` for icon buttons\n * * `inline-icon` for icon buttons with no outer padding\n */\n variant?: ButtonDropdownProps.Variant;\n /**\n * Controls expandability of the item groups.\n */\n expandableGroups?: boolean;\n /**\n * Adds `aria-label` to the button dropdown trigger.\n * Use this to provide an accessible name for buttons that don't have visible text.\n */\n ariaLabel?: string;\n /**\n * Text displayed in the button dropdown trigger.\n * @displayname text\n */\n children?: React.ReactNode;\n /**\n * Called when the user clicks on an item, and the item is not disabled. The event detail object contains the id of the clicked item.\n */\n onItemClick?: CancelableEventHandler<ButtonDropdownProps.ItemClickDetails>;\n /**\n * Called when the user clicks on an item with the left mouse button without pressing\n * modifier keys (that is, CTRL, ALT, SHIFT, META), and the item has an `href` set.\n */\n onItemFollow?: CancelableEventHandler<ButtonDropdownProps.ItemClickDetails>;\n /**\n * A standalone action that is shown prior to the dropdown trigger.\n * Use it with \"primary\" and \"normal\" variant only.\n *\n * Main action properties:\n * * `text` (string) - Specifies the text shown in the main action.\n * * `external` (boolean) - Marks the main action as external by adding an icon after the text. The link will open in a new tab when clicked. Note that this only works when `href` is also provided.\n * * `externalIconAriaLabel` (string) - Adds an ARIA label to the external icon.\n *\n * The main action also supports the following properties of the [button](/components/button/?tabId=api) component:\n * `ariaLabel`, `disabled`, `loading`, `loadingText`, `href`, `target`, `rel`, `download`, `iconAlt`, `iconName`, `iconUrl`, `iconSvg`, `onClick`, `onFollow`.\n */\n mainAction?: ButtonDropdownProps.MainAction;\n\n /**\n * Sets the button width to be 100% of the parent container width. Button content is centered.\n */\n fullWidth?: boolean;\n}\n\nexport namespace ButtonDropdownProps {\n export type Variant = 'normal' | 'primary' | 'icon' | 'inline-icon';\n export type ItemType = 'action' | 'group';\n\n export interface MainAction {\n text?: string;\n ariaLabel?: string;\n onClick?: CancelableEventHandler<ButtonProps.ClickDetail>;\n onFollow?: CancelableEventHandler<ButtonProps.FollowDetail>;\n disabled?: boolean;\n disabledReason?: string;\n loading?: boolean;\n loadingText?: string;\n href?: string;\n target?: string;\n rel?: string;\n download?: boolean | string;\n external?: boolean;\n externalIconAriaLabel?: string;\n iconAlt?: string;\n iconName?: IconProps.Name;\n iconUrl?: string;\n iconSvg?: React.ReactNode;\n }\n\n export interface Item {\n itemType?: ItemType;\n id: string;\n text: string;\n ariaLabel?: string;\n lang?: string;\n disabled?: boolean;\n disabledReason?: string;\n description?: string;\n href?: string;\n external?: boolean;\n externalIconAriaLabel?: string;\n iconAlt?: string;\n iconName?: IconProps.Name;\n iconUrl?: string;\n iconSvg?: React.ReactNode;\n }\n\n export interface CheckboxItem\n extends Omit<ButtonDropdownProps.Item, 'href' | 'external' | 'externalIconAriaLabel' | 'itemType'> {\n itemType: 'checkbox';\n checked: boolean;\n }\n\n export interface ItemGroup extends Omit<Item, 'id' | 'text' | 'itemType'> {\n itemType?: 'group';\n id?: string;\n text?: string;\n items: Items;\n }\n\n export type ItemOrGroup = Item | CheckboxItem | ItemGroup;\n\n export type Items = ReadonlyArray<ItemOrGroup>;\n\n export interface ItemClickDetails extends BaseNavigationDetail {\n id: string;\n checked?: boolean;\n }\n\n export interface Ref {\n /**\n * Focuses the underlying native button. If a main action is defined this will focus that button.\n */\n focus(options?: FocusOptions): void;\n /**\n * Focuses the underlying native button for the dropdown.\n */\n focusDropdownTrigger(options?: FocusOptions): void;\n }\n}\n\nexport interface ButtonDropdownSettings {\n // this means whether action is required to make group expand\n hasExpandableGroups: boolean;\n // on smaller screens expandable groups are integrated into parent dropdown\n // this changes keyboard navigation, highlight and activation behavior for parent dropdown\n isInRestrictedView?: boolean;\n}\n\nexport interface HighlightProps {\n targetItem: ButtonDropdownProps.ItemOrGroup | null;\n isHighlighted: (item: ButtonDropdownProps.ItemOrGroup) => boolean;\n isKeyboardHighlight: (item: ButtonDropdownProps.ItemOrGroup) => boolean;\n isExpanded: (group: ButtonDropdownProps.ItemGroup) => boolean;\n highlightItem: (item: ButtonDropdownProps.ItemOrGroup) => void;\n}\n\nexport type GroupToggle = (item: ButtonDropdownProps.ItemGroup, event: React.SyntheticEvent) => void;\nexport type ItemActivate = (\n item: ButtonDropdownProps.Item | ButtonDropdownProps.CheckboxItem,\n event: React.MouseEvent | React.KeyboardEvent\n) => void;\n\nexport interface CategoryProps extends HighlightProps {\n item: ButtonDropdownProps.ItemGroup;\n onGroupToggle: GroupToggle;\n onItemActivate: ItemActivate;\n disabled: boolean;\n lastInDropdown: boolean;\n expandToViewport?: boolean;\n variant?: ItemListProps['variant'];\n position?: string;\n}\n\nexport interface ItemListProps extends HighlightProps {\n items: ButtonDropdownProps.Items;\n onGroupToggle: GroupToggle;\n onItemActivate: ItemActivate;\n categoryDisabled?: boolean;\n hasExpandableGroups?: boolean;\n hasCategoryHeader?: boolean;\n lastInDropdown: boolean;\n expandToViewport?: boolean;\n variant?: InternalButtonDropdownProps['variant'];\n position?: string;\n analyticsMetadataTransformer?: InternalButtonDropdownProps['analyticsMetadataTransformer'];\n linkStyle?: boolean;\n}\n\nexport interface LinkItem extends ButtonDropdownProps.Item {\n href: string;\n}\n\nexport interface ItemProps {\n item: ButtonDropdownProps.Item | ButtonDropdownProps.CheckboxItem | LinkItem;\n disabled: boolean;\n highlighted: boolean;\n onItemActivate: ItemActivate;\n highlightItem: (item: ButtonDropdownProps.ItemOrGroup) => void;\n showDivider: boolean;\n hasCategoryHeader: boolean;\n isKeyboardHighlighted?: boolean;\n variant?: ItemListProps['variant'];\n position?: string;\n analyticsMetadataTransformer?: InternalButtonDropdownProps['analyticsMetadataTransformer'];\n linkStyle?: boolean;\n}\n\nexport interface InternalItem extends ButtonDropdownProps.Item {\n badge?: boolean;\n /**\n * Used in breadcrumb-group: indicates that this breadcrumb item is the current page\n */\n isCurrentBreadcrumb?: boolean;\n}\n\nexport interface InternalCheckboxItem extends ButtonDropdownProps.CheckboxItem {\n badge?: boolean;\n}\n\ninterface InternalItemGroup extends Omit<ButtonDropdownProps.ItemGroup, 'items'> {\n items: InternalItems;\n}\n\ntype InternalItems = ReadonlyArray<InternalItemOrGroup>;\n\nexport type InternalItemOrGroup = InternalItem | InternalCheckboxItem | InternalItemGroup;\n\nexport interface InternalButtonDropdownProps\n extends Omit<ButtonDropdownProps, 'variant' | 'items'>,\n InternalBaseComponentProps {\n customTriggerBuilder?: (props: CustomTriggerProps) => React.ReactNode;\n variant?: ButtonDropdownProps['variant'] | 'navigation';\n items: ReadonlyArray<InternalItemOrGroup>;\n\n /**\n * Optional text that is displayed as the title at the top of the dropdown.\n */\n title?: string;\n\n /**\n * Optional text that is displayed underneath the title at the top of the dropdown.\n */\n description?: string;\n\n /**\n * Only show main action button as a regular, non-split button.\n * That is needed so that button dropdown test utils wrapper can still be used.\n */\n showMainActionOnly?: boolean;\n\n /**\n * Determines that the dropdown should preferably be aligned to the center of the trigger\n * instead of dropping left or right.\n */\n preferCenter?: boolean;\n\n /**\n * Determines whether simple items should be displayed with the link styles.\n * Used in Breadcrumb group component for collapsed breadcrumbs\n */\n linkStyle?: boolean;\n\n /**\n * Determines whether the dropdown should take up the full available width.\n * Used in Breadcrumb group component for collapsed breadcrumbs\n */\n fullWidth?: boolean;\n\n analyticsMetadataTransformer?: (input: GeneratedAnalyticsMetadataFragment) => GeneratedAnalyticsMetadataFragment;\n}\n\nexport interface CustomTriggerProps {\n triggerRef: React.Ref<HTMLElement>;\n testUtilsClass: string;\n ariaLabel: string | undefined;\n disabled: boolean;\n disabledReason?: string;\n isOpen: boolean;\n onClick: () => void;\n ariaExpanded: boolean;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/button-dropdown/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAqBjD,OAAO,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAQhF,QAAA,MAAM,sBAAsB,6GAmX3B,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/button-dropdown/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAiD,MAAM,OAAO,CAAC;AAoBtE,OAAO,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAQhF,QAAA,MAAM,sBAAsB,6GA8X3B,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { __rest } from "tslib";
2
2
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  // SPDX-License-Identifier: Apache-2.0
4
- import React, { useEffect, useRef } from 'react';
4
+ import React, { useEffect, useImperativeHandle, useRef } from 'react';
5
5
  import clsx from 'clsx';
6
6
  import { warnOnce } from '@cloudscape-design/component-toolkit/internal';
7
7
  import { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';
@@ -11,7 +11,6 @@ import { useFunnel } from '../internal/analytics/hooks/use-funnel.js';
11
11
  import { getBaseProps } from '../internal/base-component';
12
12
  import Dropdown from '../internal/components/dropdown';
13
13
  import OptionsList from '../internal/components/options-list';
14
- import useForwardFocus from '../internal/hooks/forward-focus';
15
14
  import { useMobile } from '../internal/hooks/use-mobile';
16
15
  import { useUniqueId } from '../internal/hooks/use-unique-id';
17
16
  import { useVisualRefresh } from '../internal/hooks/use-visual-mode/index.js';
@@ -59,7 +58,16 @@ const InternalButtonDropdown = React.forwardRef((_a, ref) => {
59
58
  const baseProps = getBaseProps(props);
60
59
  const mainActionRef = useRef(null);
61
60
  const triggerRef = useRef(null);
62
- useForwardFocus(ref, isMainAction ? mainActionRef : triggerRef);
61
+ useImperativeHandle(ref, () => ({
62
+ focus(...args) {
63
+ var _a;
64
+ (_a = (isMainAction ? mainActionRef : triggerRef).current) === null || _a === void 0 ? void 0 : _a.focus(...args);
65
+ },
66
+ focusDropdownTrigger(...args) {
67
+ var _a;
68
+ (_a = triggerRef.current) === null || _a === void 0 ? void 0 : _a.focus(...args);
69
+ },
70
+ }), [mainActionRef, triggerRef, isMainAction]);
63
71
  const clickHandler = () => {
64
72
  if (!loading && !disabled) {
65
73
  // Prevent moving highlight on mobiles to avoid disabled state reason popup if defined.