@cloudscape-design/components-themeable 3.0.1389 → 3.0.1391

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 (89) hide show
  1. package/lib/internal/manifest.json +1 -1
  2. package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +1 -1
  3. package/lib/internal/template/action-card/interfaces.d.ts +8 -0
  4. package/lib/internal/template/action-card/interfaces.d.ts.map +1 -1
  5. package/lib/internal/template/action-card/interfaces.js.map +1 -1
  6. package/lib/internal/template/app-layout/implementations.js +1 -0
  7. package/lib/internal/template/app-layout/internal.js +1 -1
  8. package/lib/internal/template/app-layout/internal.js.map +1 -1
  9. package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/index.d.ts.map +1 -1
  10. package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/index.js +3 -2
  11. package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/index.js.map +1 -1
  12. package/lib/internal/template/badge/interfaces.d.ts +2 -0
  13. package/lib/internal/template/badge/interfaces.d.ts.map +1 -1
  14. package/lib/internal/template/badge/interfaces.js.map +1 -1
  15. package/lib/internal/template/box/interfaces.d.ts +2 -0
  16. package/lib/internal/template/box/interfaces.d.ts.map +1 -1
  17. package/lib/internal/template/box/interfaces.js.map +1 -1
  18. package/lib/internal/template/button/interfaces.d.ts +8 -0
  19. package/lib/internal/template/button/interfaces.d.ts.map +1 -1
  20. package/lib/internal/template/button/interfaces.js.map +1 -1
  21. package/lib/internal/template/button-dropdown/interfaces.d.ts +8 -0
  22. package/lib/internal/template/button-dropdown/interfaces.d.ts.map +1 -1
  23. package/lib/internal/template/button-dropdown/interfaces.js.map +1 -1
  24. package/lib/internal/template/checkbox/interfaces.d.ts +4 -0
  25. package/lib/internal/template/checkbox/interfaces.d.ts.map +1 -1
  26. package/lib/internal/template/checkbox/interfaces.js.map +1 -1
  27. package/lib/internal/template/divider/interfaces.d.ts +2 -0
  28. package/lib/internal/template/divider/interfaces.d.ts.map +1 -1
  29. package/lib/internal/template/divider/interfaces.js.map +1 -1
  30. package/lib/internal/template/icon/interfaces.d.ts +2 -0
  31. package/lib/internal/template/icon/interfaces.d.ts.map +1 -1
  32. package/lib/internal/template/icon/interfaces.js.map +1 -1
  33. package/lib/internal/template/input/interfaces.d.ts +4 -0
  34. package/lib/internal/template/input/interfaces.d.ts.map +1 -1
  35. package/lib/internal/template/input/interfaces.js.map +1 -1
  36. package/lib/internal/template/internal/base-component/styles.scoped.css +1 -1
  37. package/lib/internal/template/internal/components/autosuggest-input/index.js +1 -1
  38. package/lib/internal/template/internal/components/autosuggest-input/index.js.map +1 -1
  39. package/lib/internal/template/internal/components/masked-input/index.js +1 -1
  40. package/lib/internal/template/internal/components/masked-input/index.js.map +1 -1
  41. package/lib/internal/template/internal/environment.js +2 -2
  42. package/lib/internal/template/internal/environment.json +2 -2
  43. package/lib/internal/template/internal/utils/with-native-attributes.d.ts +5 -5
  44. package/lib/internal/template/internal/utils/with-native-attributes.d.ts.map +1 -1
  45. package/lib/internal/template/internal/utils/with-native-attributes.js +6 -4
  46. package/lib/internal/template/internal/utils/with-native-attributes.js.map +1 -1
  47. package/lib/internal/template/item-card/interfaces.d.ts +2 -0
  48. package/lib/internal/template/item-card/interfaces.d.ts.map +1 -1
  49. package/lib/internal/template/item-card/interfaces.js.map +1 -1
  50. package/lib/internal/template/item-card/internal.d.ts.map +1 -1
  51. package/lib/internal/template/item-card/internal.js +4 -2
  52. package/lib/internal/template/item-card/internal.js.map +1 -1
  53. package/lib/internal/template/link/interfaces.d.ts +4 -0
  54. package/lib/internal/template/link/interfaces.d.ts.map +1 -1
  55. package/lib/internal/template/link/interfaces.js.map +1 -1
  56. package/lib/internal/template/prompt-input/interfaces.d.ts +4 -0
  57. package/lib/internal/template/prompt-input/interfaces.d.ts.map +1 -1
  58. package/lib/internal/template/prompt-input/interfaces.js.map +1 -1
  59. package/lib/internal/template/radio-button/interfaces.d.ts +4 -0
  60. package/lib/internal/template/radio-button/interfaces.d.ts.map +1 -1
  61. package/lib/internal/template/radio-button/interfaces.js.map +1 -1
  62. package/lib/internal/template/space-between/interfaces.d.ts +2 -0
  63. package/lib/internal/template/space-between/interfaces.d.ts.map +1 -1
  64. package/lib/internal/template/space-between/interfaces.js.map +1 -1
  65. package/lib/internal/template/spinner/interfaces.d.ts +2 -0
  66. package/lib/internal/template/spinner/interfaces.d.ts.map +1 -1
  67. package/lib/internal/template/spinner/interfaces.js.map +1 -1
  68. package/lib/internal/template/status-indicator/interfaces.d.ts +2 -0
  69. package/lib/internal/template/status-indicator/interfaces.d.ts.map +1 -1
  70. package/lib/internal/template/status-indicator/interfaces.js.map +1 -1
  71. package/lib/internal/template/table-body-cell/internal.d.ts +2 -3
  72. package/lib/internal/template/table-body-cell/internal.d.ts.map +1 -1
  73. package/lib/internal/template/table-body-cell/internal.js.map +1 -1
  74. package/lib/internal/template/table-header-cell/internal.d.ts +2 -3
  75. package/lib/internal/template/table-header-cell/internal.d.ts.map +1 -1
  76. package/lib/internal/template/table-header-cell/internal.js.map +1 -1
  77. package/lib/internal/template/textarea/interfaces.d.ts +4 -0
  78. package/lib/internal/template/textarea/interfaces.d.ts.map +1 -1
  79. package/lib/internal/template/textarea/interfaces.js.map +1 -1
  80. package/lib/internal/template/toggle/interfaces.d.ts +4 -0
  81. package/lib/internal/template/toggle/interfaces.d.ts.map +1 -1
  82. package/lib/internal/template/toggle/interfaces.js.map +1 -1
  83. package/lib/internal/template/top-navigation/parts/overflow-menu/menu-item.d.ts.map +1 -1
  84. package/lib/internal/template/top-navigation/parts/overflow-menu/menu-item.js +3 -3
  85. package/lib/internal/template/top-navigation/parts/overflow-menu/menu-item.js.map +1 -1
  86. package/lib/internal/template/types/native-attributes.d.ts +5 -1
  87. package/lib/internal/template/types/native-attributes.d.ts.map +1 -1
  88. package/lib/internal/template/types/native-attributes.js.map +1 -1
  89. package/package.json +1 -1
@@ -40,6 +40,10 @@ export interface TextareaProps extends Omit<BaseInputProps, 'nativeInputAttribut
40
40
  *
41
41
  * We do not support using this attribute to apply custom styling.
42
42
  *
43
+ * Pass a `ref` to access the native element for measurement, observation, or third-party integration.
44
+ * For actions such as focus or selection, use the component's explicit ref methods;
45
+ * operations performed directly on the native element may bypass the built-in component's behaviors.
46
+ *
43
47
  * @awsuiSystem core
44
48
  */
45
49
  nativeTextareaAttributes?: NativeAttributes<React.TextareaHTMLAttributes<HTMLTextAreaElement>>;
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/textarea/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,eAAe,EAChB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,+BAA+B,EAAE,MAAM,qBAAqB,CAAC;AACtE;;GAEG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE9D,MAAM,WAAW,aACf,SAAQ,IAAI,CAAC,cAAc,EAAE,uBAAuB,CAAC,EACnD,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,+BAA+B;IACjC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;;;;;;;OASG;IACH,MAAM,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC;IAE9B;;;;;;;;OAQG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;IAEnC;;;;;;;;;OASG;IACH,wBAAwB,CAAC,EAAE,gBAAgB,CAAC,KAAK,CAAC,sBAAsB,CAAC,mBAAmB,CAAC,CAAC,CAAC;IAE/F;;;;OAIG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC,KAAK,CAAC;CAC7B;AAED,yBAAiB,aAAa,CAAC;IAC7B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AAC,EAAE,MAAM,CAAC;gBACf,QAAQ,CAAC,EAAE,MAAM,CAAC;aACnB,CAAC;YACF,QAAQ,CAAC,EAAE,MAAM,CAAC;YAClB,UAAU,CAAC,EAAE,MAAM,CAAC;YACpB,YAAY,CAAC,EAAE,MAAM,CAAC;YACtB,aAAa,CAAC,EAAE,MAAM,CAAC;SACxB,CAAC;QACF,WAAW,CAAC,EAAE;YACZ,KAAK,CAAC,EAAE,MAAM,CAAC;YACf,QAAQ,CAAC,EAAE,MAAM,CAAC;YAClB,SAAS,CAAC,EAAE,MAAM,CAAC;YACnB,UAAU,CAAC,EAAE,MAAM,CAAC;SACrB,CAAC;KACH;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/textarea/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport {\n BaseInputProps,\n InputAutoComplete,\n InputAutoCorrect,\n InputKeyEvents,\n InputSpellcheck,\n} from '../input/interfaces';\nimport { BaseComponentProps } from '../types/base-component';\nimport { BaseKeyDetail } from '../types/events';\nimport { FormFieldValidationControlProps } from '../types/form-field';\n/**\n * @awsuiSystem core\n */\nimport { NativeAttributes } from '../types/native-attributes';\n\nexport interface TextareaProps\n extends Omit<BaseInputProps, 'nativeInputAttributes'>,\n InputKeyEvents,\n InputAutoCorrect,\n InputAutoComplete,\n InputSpellcheck,\n BaseComponentProps,\n FormFieldValidationControlProps {\n /**\n * Specifies the number of lines of text to set the height to.\n */\n rows?: number;\n\n /**\n * Specifies the directions in which the user can resize the textarea:\n *\n * * `both` (default) - The user can change both the width and the height.\n * * `vertical` - The user can only change the height. Use this when the textarea\n * is next to other content that a width change would disrupt.\n * * `horizontal` - The user can only change the width.\n * * `none` - The user can't resize the textarea. Longer content scrolls instead.\n * Consider using the `rows` property to make the initial height fit the expected content.\n */\n resize?: TextareaProps.Resize;\n\n /**\n * Specifies whether to disable browser spellcheck feature.\n * If you set this to `true`, it disables native browser capability\n * that checks for spelling/grammar errors.\n * If you don't set it, the behavior follows the default behavior\n * of the user's browser.\n *\n * @deprecated Use the `spellcheck` property instead.\n */\n disableBrowserSpellcheck?: boolean;\n\n /**\n * Attributes to add to the native `textarea` element.\n * Some attributes will be automatically combined with internal attribute values:\n * - `className` will be appended.\n * - Event handlers will be chained, unless the default is prevented.\n *\n * We do not support using this attribute to apply custom styling.\n *\n * @awsuiSystem core\n */\n nativeTextareaAttributes?: NativeAttributes<React.TextareaHTMLAttributes<HTMLTextAreaElement>>;\n\n /**\n * An object containing CSS properties to customize the textarea's visual appearance.\n * Refer to the [style](/components/textarea/?tabId=style) tab for more details.\n * @awsuiSystem core\n */\n style?: TextareaProps.Style;\n}\n\nexport namespace TextareaProps {\n export type KeyDetail = BaseKeyDetail;\n\n export type Resize = 'both' | 'horizontal' | 'vertical' | 'none';\n\n export interface ChangeDetail {\n /**\n * The new value of this textarea.\n */\n value: string;\n }\n export interface Ref {\n /**\n * Sets input focus on the textarea control.\n */\n focus(): void;\n }\n\n export interface Style {\n root?: {\n backgroundColor?: {\n default?: string;\n disabled?: string;\n focus?: string;\n hover?: string;\n readonly?: string;\n };\n borderColor?: {\n default?: string;\n disabled?: string;\n focus?: string;\n hover?: string;\n readonly?: string;\n };\n borderRadius?: string;\n borderWidth?: string;\n boxShadow?: {\n default?: string;\n disabled?: string;\n focus?: string;\n hover?: string;\n readonly?: string;\n };\n color?: {\n default?: string;\n disabled?: string;\n focus?: string;\n hover?: string;\n readonly?: string;\n };\n fontSize?: string;\n fontWeight?: string;\n paddingBlock?: string;\n paddingInline?: string;\n };\n placeholder?: {\n color?: string;\n fontSize?: string;\n fontStyle?: string;\n fontWeight?: string;\n };\n }\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/textarea/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport {\n BaseInputProps,\n InputAutoComplete,\n InputAutoCorrect,\n InputKeyEvents,\n InputSpellcheck,\n} from '../input/interfaces';\nimport { BaseComponentProps } from '../types/base-component';\nimport { BaseKeyDetail } from '../types/events';\nimport { FormFieldValidationControlProps } from '../types/form-field';\n/**\n * @awsuiSystem core\n */\nimport { NativeAttributes } from '../types/native-attributes';\n\nexport interface TextareaProps\n extends Omit<BaseInputProps, 'nativeInputAttributes'>,\n InputKeyEvents,\n InputAutoCorrect,\n InputAutoComplete,\n InputSpellcheck,\n BaseComponentProps,\n FormFieldValidationControlProps {\n /**\n * Specifies the number of lines of text to set the height to.\n */\n rows?: number;\n\n /**\n * Specifies the directions in which the user can resize the textarea:\n *\n * * `both` (default) - The user can change both the width and the height.\n * * `vertical` - The user can only change the height. Use this when the textarea\n * is next to other content that a width change would disrupt.\n * * `horizontal` - The user can only change the width.\n * * `none` - The user can't resize the textarea. Longer content scrolls instead.\n * Consider using the `rows` property to make the initial height fit the expected content.\n */\n resize?: TextareaProps.Resize;\n\n /**\n * Specifies whether to disable browser spellcheck feature.\n * If you set this to `true`, it disables native browser capability\n * that checks for spelling/grammar errors.\n * If you don't set it, the behavior follows the default behavior\n * of the user's browser.\n *\n * @deprecated Use the `spellcheck` property instead.\n */\n disableBrowserSpellcheck?: boolean;\n\n /**\n * Attributes to add to the native `textarea` element.\n * Some attributes will be automatically combined with internal attribute values:\n * - `className` will be appended.\n * - Event handlers will be chained, unless the default is prevented.\n *\n * We do not support using this attribute to apply custom styling.\n *\n * Pass a `ref` to access the native element for measurement, observation, or third-party integration.\n * For actions such as focus or selection, use the component's explicit ref methods;\n * operations performed directly on the native element may bypass the built-in component's behaviors.\n *\n * @awsuiSystem core\n */\n nativeTextareaAttributes?: NativeAttributes<React.TextareaHTMLAttributes<HTMLTextAreaElement>>;\n\n /**\n * An object containing CSS properties to customize the textarea's visual appearance.\n * Refer to the [style](/components/textarea/?tabId=style) tab for more details.\n * @awsuiSystem core\n */\n style?: TextareaProps.Style;\n}\n\nexport namespace TextareaProps {\n export type KeyDetail = BaseKeyDetail;\n\n export type Resize = 'both' | 'horizontal' | 'vertical' | 'none';\n\n export interface ChangeDetail {\n /**\n * The new value of this textarea.\n */\n value: string;\n }\n export interface Ref {\n /**\n * Sets input focus on the textarea control.\n */\n focus(): void;\n }\n\n export interface Style {\n root?: {\n backgroundColor?: {\n default?: string;\n disabled?: string;\n focus?: string;\n hover?: string;\n readonly?: string;\n };\n borderColor?: {\n default?: string;\n disabled?: string;\n focus?: string;\n hover?: string;\n readonly?: string;\n };\n borderRadius?: string;\n borderWidth?: string;\n boxShadow?: {\n default?: string;\n disabled?: string;\n focus?: string;\n hover?: string;\n readonly?: string;\n };\n color?: {\n default?: string;\n disabled?: string;\n focus?: string;\n hover?: string;\n readonly?: string;\n };\n fontSize?: string;\n fontWeight?: string;\n paddingBlock?: string;\n paddingInline?: string;\n };\n placeholder?: {\n color?: string;\n fontSize?: string;\n fontStyle?: string;\n fontWeight?: string;\n };\n }\n}\n"]}
@@ -26,6 +26,10 @@ export interface ToggleProps extends BaseCheckboxProps {
26
26
  *
27
27
  * We do not support using this attribute to apply custom styling.
28
28
  *
29
+ * Pass a `ref` to access the native element for measurement, observation, or third-party integration.
30
+ * For actions such as focus or selection, use the component's explicit ref methods;
31
+ * operations performed directly on the native element may bypass the built-in component's behaviors.
32
+ *
29
33
  * @awsuiSystem core
30
34
  */
31
35
  nativeInputAttributes?: NativeAttributes<React.InputHTMLAttributes<HTMLInputElement>>;
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/toggle/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAC5D;;GAEG;AACH,OAAO,EAA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AAE,MAAM,CAAC;oBACjB,OAAO,CAAC,EAAE,MAAM,CAAC;oBACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;oBAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;iBACnB,CAAC;aACH,CAAC;YACF,SAAS,CAAC,EAAE;gBACV,WAAW,CAAC,EAAE,MAAM,CAAC;gBACrB,YAAY,CAAC,EAAE,MAAM,CAAC;gBACtB,WAAW,CAAC,EAAE,MAAM,CAAC;aACtB,CAAC;SACH,CAAC;QACF,KAAK,CAAC,EAAE;YACN,KAAK,CAAC,EAAE;gBACN,OAAO,CAAC,EAAE,MAAM,CAAC;gBACjB,OAAO,CAAC,EAAE,MAAM,CAAC;gBACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;gBAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;aACnB,CAAC;SACH,CAAC;KACH;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/toggle/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 { BaseCheckboxProps } from '../types/base-checkbox';\nimport { NonCancelableEventHandler } from '../types/events';\n/**\n * @awsuiSystem core\n */\nimport { NativeAttributes } from '../types/native-attributes';\n\nexport interface ToggleProps extends BaseCheckboxProps {\n /**\n * The control's label that's displayed next to the toggle. Clicking this will invoke a state change.\n * @displayname label\n */\n children?: React.ReactNode;\n\n /*\n * Called when the user changes their selection.\n * The event `detail` contains the current value for the `checked` property.\n */\n onChange?: NonCancelableEventHandler<ToggleProps.ChangeDetail>;\n\n /**\n * An object containing CSS properties to customize the toggle's visual appearance.\n * Refer to the [style](/components/toggle/?tabId=style) tab for more details.\n * @awsuiSystem core\n */\n style?: ToggleProps.Style;\n\n /**\n * Attributes to add to the native `input` element.\n * Some attributes will be automatically combined with internal attribute values:\n * - `className` will be appended.\n * - Event handlers will be chained, unless the default is prevented.\n *\n * We do not support using this attribute to apply custom styling.\n *\n * @awsuiSystem core\n */\n nativeInputAttributes?: NativeAttributes<React.InputHTMLAttributes<HTMLInputElement>>;\n}\n\nexport namespace ToggleProps {\n export interface Ref {\n /**\n * Sets input focus onto the UI control.\n */\n focus(): void;\n }\n\n export interface ChangeDetail {\n checked: boolean;\n }\n\n export interface Style {\n input: {\n background?: {\n checked?: string;\n default?: string;\n disabled?: string;\n readOnly?: string;\n };\n handle?: {\n background?: {\n checked?: string;\n default?: string;\n disabled?: string;\n readOnly?: string;\n };\n };\n focusRing?: {\n borderColor?: string;\n borderRadius?: string;\n borderWidth?: string;\n };\n };\n label?: {\n color?: {\n checked?: string;\n default?: string;\n disabled?: string;\n readOnly?: string;\n };\n };\n }\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/toggle/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 { BaseCheckboxProps } from '../types/base-checkbox';\nimport { NonCancelableEventHandler } from '../types/events';\n/**\n * @awsuiSystem core\n */\nimport { NativeAttributes } from '../types/native-attributes';\n\nexport interface ToggleProps extends BaseCheckboxProps {\n /**\n * The control's label that's displayed next to the toggle. Clicking this will invoke a state change.\n * @displayname label\n */\n children?: React.ReactNode;\n\n /*\n * Called when the user changes their selection.\n * The event `detail` contains the current value for the `checked` property.\n */\n onChange?: NonCancelableEventHandler<ToggleProps.ChangeDetail>;\n\n /**\n * An object containing CSS properties to customize the toggle's visual appearance.\n * Refer to the [style](/components/toggle/?tabId=style) tab for more details.\n * @awsuiSystem core\n */\n style?: ToggleProps.Style;\n\n /**\n * Attributes to add to the native `input` element.\n * Some attributes will be automatically combined with internal attribute values:\n * - `className` will be appended.\n * - Event handlers will be chained, unless the default is prevented.\n *\n * We do not support using this attribute to apply custom styling.\n *\n * Pass a `ref` to access the native element for measurement, observation, or third-party integration.\n * For actions such as focus or selection, use the component's explicit ref methods;\n * operations performed directly on the native element may bypass the built-in component's behaviors.\n *\n * @awsuiSystem core\n */\n nativeInputAttributes?: NativeAttributes<React.InputHTMLAttributes<HTMLInputElement>>;\n}\n\nexport namespace ToggleProps {\n export interface Ref {\n /**\n * Sets input focus onto the UI control.\n */\n focus(): void;\n }\n\n export interface ChangeDetail {\n checked: boolean;\n }\n\n export interface Style {\n input: {\n background?: {\n checked?: string;\n default?: string;\n disabled?: string;\n readOnly?: string;\n };\n handle?: {\n background?: {\n checked?: string;\n default?: string;\n disabled?: string;\n readOnly?: string;\n };\n };\n focusRing?: {\n borderColor?: string;\n borderRadius?: string;\n borderWidth?: string;\n };\n };\n label?: {\n color?: {\n checked?: string;\n default?: string;\n disabled?: string;\n readOnly?: string;\n };\n };\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"menu-item.d.ts","sourceRoot":"","sources":["../../../../../src/top-navigation/parts/overflow-menu/menu-item.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAKpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAM1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AA0RtD,KAAK,oBAAoB,GAAG,kBAAkB,CAAC,OAAO,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CAAE,CAAC;AAEjG,eAAO,MAAM,eAAe,oHAQ3B,CAAC;AAEF,KAAK,gBAAgB,GAAG,mBAAmB,CAAC,WAAW,GAAG;IACxD,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,EAAE,IAAI,EAAE,mBAAmB,CAAC,IAAI,KAAK,IAAI,CAAC;CAC5E,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,OAAO,gBAAgB,gBAclD,CAAC"}
1
+ {"version":3,"file":"menu-item.d.ts","sourceRoot":"","sources":["../../../../../src/top-navigation/parts/overflow-menu/menu-item.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAKpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAM1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AA8RtD,KAAK,oBAAoB,GAAG,kBAAkB,CAAC,OAAO,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CAAE,CAAC;AAEjG,eAAO,MAAM,eAAe,oHAQ3B,CAAC;AAEF,KAAK,gBAAgB,GAAG,mBAAmB,CAAC,WAAW,GAAG;IACxD,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,EAAE,IAAI,EAAE,mBAAmB,CAAC,IAAI,KAAK,IAAI,CAAC;CAC5E,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,OAAO,gBAAgB,gBAclD,CAAC"}
@@ -15,11 +15,11 @@ const ListItem = ({ children, startIcon, endIcon }) => {
15
15
  React.createElement("span", { className: styles['overflow-menu-list-item-text'] }, children),
16
16
  endIcon && endIcon));
17
17
  };
18
- const LinkItem = forwardRef(({ children, external, href, target, rel, startIcon, endIcon, onClick, context, testId }, ref) => {
18
+ const LinkItem = forwardRef(({ children, external, href, target, rel, lang, startIcon, endIcon, onClick, context, testId }, ref) => {
19
19
  const anchorTarget = target !== null && target !== void 0 ? target : (external ? '_blank' : undefined);
20
20
  const anchorRel = rel !== null && rel !== void 0 ? rel : (anchorTarget === '_blank' ? 'noopener noreferrer' : undefined);
21
21
  const role = !href ? 'button' : undefined;
22
- return (React.createElement("a", { ref: ref, onClick: onClick, className: clsx(styles['overflow-menu-control'], styles['overflow-menu-control-link'], context && styles[`overflow-menu-control-${context}`]), role: role, tabIndex: 0, href: href, target: anchorTarget, rel: anchorRel, "data-awsui-motion-trigger": "hover", ...(testId ? { 'data-testid': testId } : {}) },
22
+ return (React.createElement("a", { ref: ref, onClick: onClick, className: clsx(styles['overflow-menu-control'], styles['overflow-menu-control-link'], context && styles[`overflow-menu-control-${context}`]), role: role, tabIndex: 0, href: href, target: anchorTarget, rel: anchorRel, lang: lang, "data-awsui-motion-trigger": "hover", ...(testId ? { 'data-testid': testId } : {}) },
23
23
  React.createElement(ListItem, { startIcon: startIcon, endIcon: endIcon }, children)));
24
24
  });
25
25
  const ButtonItem = forwardRef(({ children, startIcon, endIcon, onClick, testId }, ref) => {
@@ -86,7 +86,7 @@ function dropdownComponentFactory(item, expandable, onItemClick) {
86
86
  if (expandable) {
87
87
  return (React.createElement(ExpandableItem, { ...item, onItemClick: onItemClick }, label));
88
88
  }
89
- return (React.createElement(LinkItem, { startIcon: startIcon, href: isLink ? item.href : undefined, external: isLink ? item.external : undefined, context: "dropdown-menu", testId: item.id, onClick: event => onItemClick(event, item) },
89
+ return (React.createElement(LinkItem, { startIcon: startIcon, href: isLink ? item.href : undefined, external: isLink ? item.external : undefined, lang: item.lang, context: "dropdown-menu", testId: item.id, onClick: event => onItemClick(event, item) },
90
90
  label,
91
91
  isLink && item.external && (React.createElement(React.Fragment, null,
92
92
  ' ',
@@ -1 +1 @@
1
- {"version":3,"file":"menu-item.js","sourceRoot":"","sources":["../../../../../src/top-navigation/parts/overflow-menu/menu-item.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAG5E,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAClE,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,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C,qBAAqB,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;gBAChG,oBAAC,YAAY,IAAC,IAAI,EAAC,UAAU,EAAC,IAAI,EAAC,QAAQ,GAAG,CACzC,CACN,CACJ,CACQ,CACZ,CAAC;AACJ,CAAC;AAID,MAAM,CAAC,MAAM,eAAe,GAAG,UAAU,CACvC,CAAC,EAAE,KAAK,EAAE,GAAG,KAAK,EAAwB,EAAE,GAAqD,EAAE,EAAE;IACnG,OAAO,CACL,4BAAI,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,yBAAyB,CAAC,EAAE,MAAM,CAAC,iCAAiC,CAAC,CAAC,IAC9F,uBAAuB,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,CACxC,CACN,CAAC;AACJ,CAAC,CACF,CAAC;AAMF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,KAAuB,EAAE,EAAE;IACrD,MAAM,UAAU,GAAG,OAAQ,KAAuC,CAAC,KAAK,KAAK,WAAW,CAAC;IAEzF,OAAO,CACL,4BACE,SAAS,EAAE,IAAI,CACb,MAAM,CAAC,yBAAyB,CAAC,EACjC,MAAM,CAAC,iCAAiC,CAAC,EACzC,UAAU,IAAI,MAAM,CAAC,oCAAoC,CAAC,CAC3D,IAEA,wBAAwB,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,CAAC,OAAO,CAAC,CACxD,CACN,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { forwardRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { useUniqueId } from '@cloudscape-design/component-toolkit/internal';\n\nimport { ButtonDropdownProps } from '../../../button-dropdown/interfaces';\nimport { isLinkItem } from '../../../button-dropdown/utils/utils';\nimport InternalIcon from '../../../icon/internal';\nimport { fireCancelableEvent, isPlainLeftClick } from '../../../internal/events';\nimport { spinWhenOpen } from '../../../internal/styles/motion/utils';\nimport { LinkProps } from '../../../link/interfaces';\nimport { TopNavigationProps } from '../../interfaces';\nimport { useNavigate } from './router';\n\nimport styles from '../../styles.css.js';\n\ninterface ListItemProps {\n startIcon?: React.ReactNode;\n endIcon?: React.ReactNode;\n context?: 'dropdown-menu';\n children?: React.ReactNode;\n testId?: string;\n}\n\nconst ListItem = ({ children, startIcon, endIcon }: ListItemProps) => {\n return (\n <>\n {startIcon && <span className={styles['overflow-menu-list-item-icon']}>{startIcon}</span>}\n <span className={styles['overflow-menu-list-item-text']}>{children}</span>\n {endIcon && endIcon}\n </>\n );\n};\n\ninterface LinkItemProps extends ButtonItemProps, Pick<LinkProps, 'href' | 'external' | 'target' | 'rel'> {}\n\nconst LinkItem = forwardRef(\n (\n { children, external, href, target, rel, startIcon, endIcon, onClick, context, testId }: LinkItemProps,\n ref: React.Ref<HTMLAnchorElement & HTMLButtonElement>\n ) => {\n const anchorTarget = target ?? (external ? '_blank' : undefined);\n const anchorRel = rel ?? (anchorTarget === '_blank' ? 'noopener noreferrer' : undefined);\n const role = !href ? 'button' : undefined;\n\n return (\n <a\n ref={ref}\n onClick={onClick}\n className={clsx(\n styles['overflow-menu-control'],\n styles['overflow-menu-control-link'],\n context && styles[`overflow-menu-control-${context}`]\n )}\n role={role}\n tabIndex={0}\n href={href}\n target={anchorTarget}\n rel={anchorRel}\n data-awsui-motion-trigger=\"hover\"\n {...(testId ? { 'data-testid': testId } : {})}\n >\n <ListItem startIcon={startIcon} endIcon={endIcon}>\n {children}\n </ListItem>\n </a>\n );\n }\n);\n\ninterface ButtonItemProps extends ListItemProps {\n onClick?: (event: React.MouseEvent) => void;\n}\n\nconst ButtonItem = forwardRef(\n (\n { children, startIcon, endIcon, onClick, testId }: ButtonItemProps & { testId?: string },\n ref: React.Ref<HTMLButtonElement>\n ) => {\n return (\n <button\n ref={ref}\n className={styles['overflow-menu-control']}\n onClick={onClick}\n data-awsui-motion-trigger=\"hover\"\n {...(typeof testId === 'string' ? { 'data-testid': testId } : {})}\n >\n <ListItem startIcon={startIcon} endIcon={endIcon}>\n {children}\n </ListItem>\n </button>\n );\n }\n);\n\nconst NavigationItem = forwardRef(\n (\n {\n startIcon,\n children,\n index,\n testId,\n ...definition\n }: ButtonItemProps & TopNavigationProps.MenuDropdownUtility & { index: number; testId?: string },\n ref: React.Ref<HTMLButtonElement>\n ) => {\n const navigate = useNavigate();\n return (\n <ButtonItem\n ref={ref}\n startIcon={startIcon}\n endIcon={<InternalIcon name=\"angle-right\" nativeAttributes={{ 'data-awsui-motion-target': '' }} />}\n testId={testId}\n onClick={() =>\n navigate('dropdown-menu', {\n definition,\n headerText: definition.text || definition.title,\n headerSecondaryText: definition.description,\n utilityIndex: index,\n })\n }\n >\n {children}\n </ButtonItem>\n );\n }\n);\n\nconst ExpandableItem: React.FC<\n ButtonItemProps &\n ButtonDropdownProps.ItemGroup & { onItemClick: (event: React.MouseEvent, item: ButtonDropdownProps.Item) => void }\n> = ({ children, onItemClick, ...definition }) => {\n const [expanded, setExpanded] = useState(false);\n const headerId = useUniqueId('overflow-menu-item');\n\n return (\n <>\n <button\n className={clsx(styles['overflow-menu-control'], styles['overflow-menu-control-expandable-menu-trigger'])}\n onClick={() => setExpanded(value => !value)}\n aria-expanded={expanded}\n data-awsui-motion-trigger=\"hover\"\n >\n <ListItem\n endIcon={\n <span className={spinWhenOpen(styles, 'icon', expanded)}>\n <InternalIcon name=\"caret-down-filled\" nativeAttributes={{ 'data-awsui-motion-target': '' }} />\n </span>\n }\n >\n <span id={headerId}>{children}</span>\n </ListItem>\n </button>\n {expanded && (\n <ul\n className={clsx(styles['overflow-menu-list'], styles['overflow-menu-list-submenu'])}\n aria-labelledby={headerId}\n >\n {definition.items.map((item, index) => {\n const isGroup = typeof (item as ButtonDropdownProps.ItemGroup).items !== 'undefined';\n\n return (\n <li\n key={index}\n className={clsx(styles[`overflow-menu-list-item`], styles[`overflow-menu-list-item-dropdown-menu`])}\n >\n {dropdownComponentFactory(item, isGroup, onItemClick)}\n </li>\n );\n })}\n </ul>\n )}\n </>\n );\n};\n\nfunction utilityComponentFactory(\n utility: TopNavigationProps.Utility & { onClose?: () => void },\n index: number,\n ref?: React.Ref<HTMLAnchorElement & HTMLButtonElement>\n) {\n const label = utility.text || utility.title;\n const hasIcon = !!utility.iconName || !!utility.iconUrl || !!utility.iconAlt || !!utility.iconSvg;\n const startIcon = hasIcon && (\n <InternalIcon name={utility.iconName} url={utility.iconUrl} alt={utility.iconAlt} svg={utility.iconSvg} />\n );\n\n switch (utility.type) {\n case 'button': {\n const handleClick = (event: React.MouseEvent) => {\n if (Boolean(utility.href) && isPlainLeftClick(event)) {\n fireCancelableEvent(utility.onFollow, { href: utility.href, target: utility.target }, event);\n }\n\n fireCancelableEvent(utility.onClick, {}, event);\n utility.onClose?.();\n };\n\n const content = (\n <>\n {label}\n {utility.external && (\n <>\n {' '}\n <span aria-label={utility.externalIconAriaLabel} role={utility.externalIconAriaLabel ? 'img' : undefined}>\n <InternalIcon name=\"external\" size=\"normal\" />\n </span>\n </>\n )}\n </>\n );\n\n if (!utility.href) {\n return (\n <ButtonItem ref={ref} startIcon={startIcon} onClick={handleClick} testId={`__${index}`}>\n {content}\n </ButtonItem>\n );\n }\n\n return (\n <LinkItem\n ref={ref}\n startIcon={startIcon}\n href={utility.href}\n external={utility.external}\n target={utility.target}\n rel={utility.rel}\n testId={`__${index}`}\n onClick={handleClick}\n >\n {content}\n </LinkItem>\n );\n }\n case 'menu-dropdown': {\n return (\n <NavigationItem\n ref={ref}\n startIcon={startIcon}\n index={index}\n {...(utility as TopNavigationProps.MenuDropdownUtility)}\n testId={`__${index}`}\n >\n {label}\n </NavigationItem>\n );\n }\n }\n}\n\nfunction dropdownComponentFactory(\n item: ButtonDropdownProps.ItemOrGroup,\n expandable: boolean,\n onItemClick: (event: React.MouseEvent, item: ButtonDropdownProps.Item) => void\n) {\n const label = item.text;\n const hasIcon = !!item.iconName || !!item.iconUrl || !!item.iconAlt || !!item.iconSvg;\n const isLink = isLinkItem(item);\n const startIcon = hasIcon && (\n <InternalIcon name={item.iconName} url={item.iconUrl} alt={item.iconAlt} svg={item.iconSvg} />\n );\n\n if (expandable) {\n return (\n <ExpandableItem {...(item as ButtonDropdownProps.ItemGroup)} onItemClick={onItemClick}>\n {label}\n </ExpandableItem>\n );\n }\n\n return (\n <LinkItem\n startIcon={startIcon}\n href={isLink ? item.href : undefined}\n external={isLink ? item.external : undefined}\n context=\"dropdown-menu\"\n testId={item.id}\n onClick={event => onItemClick(event, item as ButtonDropdownProps.Item)}\n >\n {label}\n {isLink && item.external && (\n <>\n {' '}\n <span aria-label={item.externalIconAriaLabel} role={item.externalIconAriaLabel ? 'img' : undefined}>\n <InternalIcon name=\"external\" size=\"normal\" />\n </span>\n </>\n )}\n </LinkItem>\n );\n}\n\ntype UtilityMenuItemProps = TopNavigationProps.Utility & { index: number; onClose?: () => void };\n\nexport const UtilityMenuItem = forwardRef(\n ({ index, ...props }: UtilityMenuItemProps, ref: React.Ref<HTMLAnchorElement & HTMLButtonElement>) => {\n return (\n <li className={clsx(styles[`overflow-menu-list-item`], styles[`overflow-menu-list-item-utility`])}>\n {utilityComponentFactory(props, index, ref)}\n </li>\n );\n }\n);\n\ntype SubmenuItemProps = ButtonDropdownProps.ItemOrGroup & {\n onClick: (event: React.MouseEvent, item: ButtonDropdownProps.Item) => void;\n};\n\nexport const SubmenuItem = (props: SubmenuItemProps) => {\n const expandable = typeof (props as ButtonDropdownProps.ItemGroup).items !== 'undefined';\n\n return (\n <li\n className={clsx(\n styles[`overflow-menu-list-item`],\n styles[`overflow-menu-list-item-submenu`],\n expandable && styles[`overflow-menu-list-item-expandable`]\n )}\n >\n {dropdownComponentFactory(props, expandable, props.onClick)}\n </li>\n );\n};\n"]}
1
+ {"version":3,"file":"menu-item.js","sourceRoot":"","sources":["../../../../../src/top-navigation/parts/overflow-menu/menu-item.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,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AU,EAAE,KAAK,CAAC,OAAO,CAAC,CACxD,CACN,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { forwardRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { useUniqueId } from '@cloudscape-design/component-toolkit/internal';\n\nimport { ButtonDropdownProps } from '../../../button-dropdown/interfaces';\nimport { isLinkItem } from '../../../button-dropdown/utils/utils';\nimport InternalIcon from '../../../icon/internal';\nimport { fireCancelableEvent, isPlainLeftClick } from '../../../internal/events';\nimport { spinWhenOpen } from '../../../internal/styles/motion/utils';\nimport { LinkProps } from '../../../link/interfaces';\nimport { TopNavigationProps } from '../../interfaces';\nimport { useNavigate } from './router';\n\nimport styles from '../../styles.css.js';\n\ninterface ListItemProps {\n startIcon?: React.ReactNode;\n endIcon?: React.ReactNode;\n context?: 'dropdown-menu';\n children?: React.ReactNode;\n testId?: string;\n}\n\nconst ListItem = ({ children, startIcon, endIcon }: ListItemProps) => {\n return (\n <>\n {startIcon && <span className={styles['overflow-menu-list-item-icon']}>{startIcon}</span>}\n <span className={styles['overflow-menu-list-item-text']}>{children}</span>\n {endIcon && endIcon}\n </>\n );\n};\n\ninterface LinkItemProps extends ButtonItemProps, Pick<LinkProps, 'href' | 'external' | 'target' | 'rel'> {\n lang?: string;\n}\n\nconst LinkItem = forwardRef(\n (\n { children, external, href, target, rel, lang, startIcon, endIcon, onClick, context, testId }: LinkItemProps,\n ref: React.Ref<HTMLAnchorElement & HTMLButtonElement>\n ) => {\n const anchorTarget = target ?? (external ? '_blank' : undefined);\n const anchorRel = rel ?? (anchorTarget === '_blank' ? 'noopener noreferrer' : undefined);\n const role = !href ? 'button' : undefined;\n\n return (\n <a\n ref={ref}\n onClick={onClick}\n className={clsx(\n styles['overflow-menu-control'],\n styles['overflow-menu-control-link'],\n context && styles[`overflow-menu-control-${context}`]\n )}\n role={role}\n tabIndex={0}\n href={href}\n target={anchorTarget}\n rel={anchorRel}\n lang={lang}\n data-awsui-motion-trigger=\"hover\"\n {...(testId ? { 'data-testid': testId } : {})}\n >\n <ListItem startIcon={startIcon} endIcon={endIcon}>\n {children}\n </ListItem>\n </a>\n );\n }\n);\n\ninterface ButtonItemProps extends ListItemProps {\n onClick?: (event: React.MouseEvent) => void;\n}\n\nconst ButtonItem = forwardRef(\n (\n { children, startIcon, endIcon, onClick, testId }: ButtonItemProps & { testId?: string },\n ref: React.Ref<HTMLButtonElement>\n ) => {\n return (\n <button\n ref={ref}\n className={styles['overflow-menu-control']}\n onClick={onClick}\n data-awsui-motion-trigger=\"hover\"\n {...(typeof testId === 'string' ? { 'data-testid': testId } : {})}\n >\n <ListItem startIcon={startIcon} endIcon={endIcon}>\n {children}\n </ListItem>\n </button>\n );\n }\n);\n\nconst NavigationItem = forwardRef(\n (\n {\n startIcon,\n children,\n index,\n testId,\n ...definition\n }: ButtonItemProps & TopNavigationProps.MenuDropdownUtility & { index: number; testId?: string },\n ref: React.Ref<HTMLButtonElement>\n ) => {\n const navigate = useNavigate();\n return (\n <ButtonItem\n ref={ref}\n startIcon={startIcon}\n endIcon={<InternalIcon name=\"angle-right\" nativeAttributes={{ 'data-awsui-motion-target': '' }} />}\n testId={testId}\n onClick={() =>\n navigate('dropdown-menu', {\n definition,\n headerText: definition.text || definition.title,\n headerSecondaryText: definition.description,\n utilityIndex: index,\n })\n }\n >\n {children}\n </ButtonItem>\n );\n }\n);\n\nconst ExpandableItem: React.FC<\n ButtonItemProps &\n ButtonDropdownProps.ItemGroup & { onItemClick: (event: React.MouseEvent, item: ButtonDropdownProps.Item) => void }\n> = ({ children, onItemClick, ...definition }) => {\n const [expanded, setExpanded] = useState(false);\n const headerId = useUniqueId('overflow-menu-item');\n\n return (\n <>\n <button\n className={clsx(styles['overflow-menu-control'], styles['overflow-menu-control-expandable-menu-trigger'])}\n onClick={() => setExpanded(value => !value)}\n aria-expanded={expanded}\n data-awsui-motion-trigger=\"hover\"\n >\n <ListItem\n endIcon={\n <span className={spinWhenOpen(styles, 'icon', expanded)}>\n <InternalIcon name=\"caret-down-filled\" nativeAttributes={{ 'data-awsui-motion-target': '' }} />\n </span>\n }\n >\n <span id={headerId}>{children}</span>\n </ListItem>\n </button>\n {expanded && (\n <ul\n className={clsx(styles['overflow-menu-list'], styles['overflow-menu-list-submenu'])}\n aria-labelledby={headerId}\n >\n {definition.items.map((item, index) => {\n const isGroup = typeof (item as ButtonDropdownProps.ItemGroup).items !== 'undefined';\n\n return (\n <li\n key={index}\n className={clsx(styles[`overflow-menu-list-item`], styles[`overflow-menu-list-item-dropdown-menu`])}\n >\n {dropdownComponentFactory(item, isGroup, onItemClick)}\n </li>\n );\n })}\n </ul>\n )}\n </>\n );\n};\n\nfunction utilityComponentFactory(\n utility: TopNavigationProps.Utility & { onClose?: () => void },\n index: number,\n ref?: React.Ref<HTMLAnchorElement & HTMLButtonElement>\n) {\n const label = utility.text || utility.title;\n const hasIcon = !!utility.iconName || !!utility.iconUrl || !!utility.iconAlt || !!utility.iconSvg;\n const startIcon = hasIcon && (\n <InternalIcon name={utility.iconName} url={utility.iconUrl} alt={utility.iconAlt} svg={utility.iconSvg} />\n );\n\n switch (utility.type) {\n case 'button': {\n const handleClick = (event: React.MouseEvent) => {\n if (Boolean(utility.href) && isPlainLeftClick(event)) {\n fireCancelableEvent(utility.onFollow, { href: utility.href, target: utility.target }, event);\n }\n\n fireCancelableEvent(utility.onClick, {}, event);\n utility.onClose?.();\n };\n\n const content = (\n <>\n {label}\n {utility.external && (\n <>\n {' '}\n <span aria-label={utility.externalIconAriaLabel} role={utility.externalIconAriaLabel ? 'img' : undefined}>\n <InternalIcon name=\"external\" size=\"normal\" />\n </span>\n </>\n )}\n </>\n );\n\n if (!utility.href) {\n return (\n <ButtonItem ref={ref} startIcon={startIcon} onClick={handleClick} testId={`__${index}`}>\n {content}\n </ButtonItem>\n );\n }\n\n return (\n <LinkItem\n ref={ref}\n startIcon={startIcon}\n href={utility.href}\n external={utility.external}\n target={utility.target}\n rel={utility.rel}\n testId={`__${index}`}\n onClick={handleClick}\n >\n {content}\n </LinkItem>\n );\n }\n case 'menu-dropdown': {\n return (\n <NavigationItem\n ref={ref}\n startIcon={startIcon}\n index={index}\n {...(utility as TopNavigationProps.MenuDropdownUtility)}\n testId={`__${index}`}\n >\n {label}\n </NavigationItem>\n );\n }\n }\n}\n\nfunction dropdownComponentFactory(\n item: ButtonDropdownProps.ItemOrGroup,\n expandable: boolean,\n onItemClick: (event: React.MouseEvent, item: ButtonDropdownProps.Item) => void\n) {\n const label = item.text;\n const hasIcon = !!item.iconName || !!item.iconUrl || !!item.iconAlt || !!item.iconSvg;\n const isLink = isLinkItem(item);\n const startIcon = hasIcon && (\n <InternalIcon name={item.iconName} url={item.iconUrl} alt={item.iconAlt} svg={item.iconSvg} />\n );\n\n if (expandable) {\n return (\n <ExpandableItem {...(item as ButtonDropdownProps.ItemGroup)} onItemClick={onItemClick}>\n {label}\n </ExpandableItem>\n );\n }\n\n return (\n <LinkItem\n startIcon={startIcon}\n href={isLink ? item.href : undefined}\n external={isLink ? item.external : undefined}\n lang={item.lang}\n context=\"dropdown-menu\"\n testId={item.id}\n onClick={event => onItemClick(event, item as ButtonDropdownProps.Item)}\n >\n {label}\n {isLink && item.external && (\n <>\n {' '}\n <span aria-label={item.externalIconAriaLabel} role={item.externalIconAriaLabel ? 'img' : undefined}>\n <InternalIcon name=\"external\" size=\"normal\" />\n </span>\n </>\n )}\n </LinkItem>\n );\n}\n\ntype UtilityMenuItemProps = TopNavigationProps.Utility & { index: number; onClose?: () => void };\n\nexport const UtilityMenuItem = forwardRef(\n ({ index, ...props }: UtilityMenuItemProps, ref: React.Ref<HTMLAnchorElement & HTMLButtonElement>) => {\n return (\n <li className={clsx(styles[`overflow-menu-list-item`], styles[`overflow-menu-list-item-utility`])}>\n {utilityComponentFactory(props, index, ref)}\n </li>\n );\n }\n);\n\ntype SubmenuItemProps = ButtonDropdownProps.ItemOrGroup & {\n onClick: (event: React.MouseEvent, item: ButtonDropdownProps.Item) => void;\n};\n\nexport const SubmenuItem = (props: SubmenuItemProps) => {\n const expandable = typeof (props as ButtonDropdownProps.ItemGroup).items !== 'undefined';\n\n return (\n <li\n className={clsx(\n styles[`overflow-menu-list-item`],\n styles[`overflow-menu-list-item-submenu`],\n expandable && styles[`overflow-menu-list-item-expandable`]\n )}\n >\n {dropdownComponentFactory(props, expandable, props.onClick)}\n </li>\n );\n};\n"]}
@@ -1,3 +1,7 @@
1
1
  import React from 'react';
2
- export type NativeAttributes<T extends React.HTMLAttributes<HTMLElement>> = (Omit<T, 'children'> & Record<`data-${string}`, string>) | undefined;
2
+ type NativeElement<T> = T extends React.DOMAttributes<infer E> ? (E extends HTMLElement ? E : never) : never;
3
+ export type NativeAttributes<T extends React.HTMLAttributes<HTMLElement>> = Omit<T, 'children'> & Record<`data-${string}`, string> & {
4
+ readonly ref?: React.Ref<NativeElement<T>>;
5
+ };
6
+ export {};
3
7
  //# sourceMappingURL=native-attributes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"native-attributes.d.ts","sourceRoot":"","sources":["../../../src/types/native-attributes.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,IACpE,CAAC,IAAI,CAAC,CAAC,EAAE,UAAU,CAAC,GAAG,MAAM,CAAC,QAAQ,MAAM,EAAE,EAAE,MAAM,CAAC,CAAC,GACxD,SAAS,CAAC"}
1
+ {"version":3,"file":"native-attributes.d.ts","sourceRoot":"","sources":["../../../src/types/native-attributes.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,KAAK,aAAa,CAAC,CAAC,IAAI,CAAC,SAAS,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,SAAS,WAAW,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC;AAE7G,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,UAAU,CAAC,GAC7F,MAAM,CAAC,QAAQ,MAAM,EAAE,EAAE,MAAM,CAAC,GAAG;IAAE,QAAQ,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAA;CAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"native-attributes.js","sourceRoot":"","sources":["../../../src/types/native-attributes.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\nexport type NativeAttributes<T extends React.HTMLAttributes<HTMLElement>> =\n | (Omit<T, 'children'> & Record<`data-${string}`, string>)\n | undefined;\n"]}
1
+ {"version":3,"file":"native-attributes.js","sourceRoot":"","sources":["../../../src/types/native-attributes.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\n// The element type is recovered from the attributes type: `React.DOMAttributes<E>` carries `E` in every event\n// handler's `currentTarget`. The fallback branches are unreachable through `NativeAttributes` (its constraint\n// already requires HTML attributes), so they resolve to `never` rather than widening the ref to `HTMLElement`.\ntype NativeElement<T> = T extends React.DOMAttributes<infer E> ? (E extends HTMLElement ? E : never) : never;\n\nexport type NativeAttributes<T extends React.HTMLAttributes<HTMLElement>> = Omit<T, 'children'> &\n Record<`data-${string}`, string> & { readonly ref?: React.Ref<NativeElement<T>> };\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudscape-design/components-themeable",
3
- "version": "3.0.1389",
3
+ "version": "3.0.1391",
4
4
  "files": [
5
5
  "lib"
6
6
  ],