@cloudscape-design/components 3.0.447 → 3.0.449

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 (44) hide show
  1. package/app-layout/content-wrapper/styles.css.js +3 -3
  2. package/app-layout/content-wrapper/styles.scoped.css +8 -8
  3. package/app-layout/content-wrapper/styles.selectors.js +3 -3
  4. package/app-layout/visual-refresh/context.js +3 -3
  5. package/app-layout/visual-refresh/context.js.map +1 -1
  6. package/app-layout/visual-refresh/styles.css.js +80 -80
  7. package/app-layout/visual-refresh/styles.scoped.css +188 -189
  8. package/app-layout/visual-refresh/styles.selectors.js +80 -80
  9. package/button/interfaces.d.ts +3 -2
  10. package/button/interfaces.d.ts.map +1 -1
  11. package/button/interfaces.js.map +1 -1
  12. package/button/internal.d.ts.map +1 -1
  13. package/button/internal.js +9 -0
  14. package/button/internal.js.map +1 -1
  15. package/button-dropdown/interfaces.d.ts +1 -1
  16. package/button-dropdown/interfaces.js.map +1 -1
  17. package/internal/base-component/styles.scoped.css +7 -9
  18. package/internal/environment.js +1 -1
  19. package/internal/environment.json +1 -1
  20. package/internal/generated/styles/tokens.js +3 -3
  21. package/internal/generated/theming/index.cjs +66 -55
  22. package/internal/generated/theming/index.js +66 -55
  23. package/internal/hooks/use-performance-marks.d.ts +3 -0
  24. package/internal/hooks/use-performance-marks.d.ts.map +1 -0
  25. package/internal/hooks/use-performance-marks.js +41 -0
  26. package/internal/hooks/use-performance-marks.js.map +1 -0
  27. package/internal/manifest.json +1 -1
  28. package/package.json +1 -1
  29. package/popover/interfaces.d.ts +2 -1
  30. package/popover/interfaces.d.ts.map +1 -1
  31. package/popover/interfaces.js.map +1 -1
  32. package/select/interfaces.d.ts +1 -0
  33. package/select/interfaces.d.ts.map +1 -1
  34. package/select/interfaces.js.map +1 -1
  35. package/select/parts/multiselect-item.d.ts +3 -16
  36. package/select/parts/multiselect-item.d.ts.map +1 -1
  37. package/select/parts/multiselect-item.js +1 -1
  38. package/select/parts/multiselect-item.js.map +1 -1
  39. package/split-panel/styles.css.js +55 -55
  40. package/split-panel/styles.scoped.css +80 -80
  41. package/split-panel/styles.selectors.js +55 -55
  42. package/table/internal.d.ts.map +1 -1
  43. package/table/internal.js +10 -0
  44. package/table/internal.js.map +1 -1
@@ -2,85 +2,85 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "background": "awsui_background_hyvsj_1f6b4_93",
6
- "scrolling-background": "awsui_scrolling-background_hyvsj_1f6b4_96",
7
- "sticky-background": "awsui_sticky-background_hyvsj_1f6b4_102",
8
- "has-sticky-notifications": "awsui_has-sticky-notifications_hyvsj_1f6b4_110",
9
- "breadcrumbs": "awsui_breadcrumbs_hyvsj_1f6b4_123",
10
- "has-sticky-background": "awsui_has-sticky-background_hyvsj_1f6b4_133",
11
- "drawers-container": "awsui_drawers-container_hyvsj_1f6b4_145",
12
- "has-open-drawer": "awsui_has-open-drawer_hyvsj_1f6b4_156",
13
- "disable-body-scroll": "awsui_disable-body-scroll_hyvsj_1f6b4_180",
14
- "drawers-desktop-triggers-container": "awsui_drawers-desktop-triggers-container_hyvsj_1f6b4_185",
15
- "has-multiple-triggers": "awsui_has-multiple-triggers_hyvsj_1f6b4_204",
16
- "drawers-mobile-triggers-container": "awsui_drawers-mobile-triggers-container_hyvsj_1f6b4_214",
17
- "drawers-trigger-content": "awsui_drawers-trigger-content_hyvsj_1f6b4_218",
18
- "drawers-trigger-overflow": "awsui_drawers-trigger-overflow_hyvsj_1f6b4_232",
19
- "drawers-trigger": "awsui_drawers-trigger_hyvsj_1f6b4_218",
20
- "drawer": "awsui_drawer_hyvsj_1f6b4_145",
21
- "drawer-content-container": "awsui_drawer-content-container_hyvsj_1f6b4_262",
22
- "drawer-close-button": "awsui_drawer-close-button_hyvsj_1f6b4_271",
23
- "drawer-content": "awsui_drawer-content_hyvsj_1f6b4_262",
24
- "drawer-content-hidden": "awsui_drawer-content-hidden_hyvsj_1f6b4_279",
25
- "drawer-slider": "awsui_drawer-slider_hyvsj_1f6b4_282",
26
- "is-drawer-open": "awsui_is-drawer-open_hyvsj_1f6b4_289",
27
- "content": "awsui_content_hyvsj_1f6b4_314",
28
- "layout": "awsui_layout_hyvsj_1f6b4_335",
29
- "has-max-content-width": "awsui_has-max-content-width_hyvsj_1f6b4_418",
30
- "content-type-dashboard": "awsui_content-type-dashboard_hyvsj_1f6b4_433",
31
- "content-type-table": "awsui_content-type-table_hyvsj_1f6b4_447",
32
- "content-type-cards": "awsui_content-type-cards_hyvsj_1f6b4_447",
33
- "is-overlap-disabled": "awsui_is-overlap-disabled_hyvsj_1f6b4_453",
34
- "is-hide-mobile-toolbar": "awsui_is-hide-mobile-toolbar_hyvsj_1f6b4_456",
35
- "has-content-gap-left": "awsui_has-content-gap-left_hyvsj_1f6b4_488",
36
- "has-content-gap-right": "awsui_has-content-gap-right_hyvsj_1f6b4_491",
37
- "content-first-child-notifications": "awsui_content-first-child-notifications_hyvsj_1f6b4_501",
38
- "has-breadcrumbs": "awsui_has-breadcrumbs_hyvsj_1f6b4_504",
39
- "content-first-child-header": "awsui_content-first-child-header_hyvsj_1f6b4_507",
40
- "has-header": "awsui_has-header_hyvsj_1f6b4_507",
41
- "content-first-child-main": "awsui_content-first-child-main_hyvsj_1f6b4_528",
42
- "disable-content-paddings": "awsui_disable-content-paddings_hyvsj_1f6b4_528",
43
- "has-split-panel": "awsui_has-split-panel_hyvsj_1f6b4_571",
44
- "split-panel-position-bottom": "awsui_split-panel-position-bottom_hyvsj_1f6b4_571",
45
- "block-body-scroll": "awsui_block-body-scroll_hyvsj_1f6b4_587",
46
- "unfocusable": "awsui_unfocusable_hyvsj_1f6b4_592",
47
- "container": "awsui_container_hyvsj_1f6b4_602",
48
- "is-navigation-open": "awsui_is-navigation-open_hyvsj_1f6b4_627",
49
- "is-tools-open": "awsui_is-tools-open_hyvsj_1f6b4_630",
50
- "is-split-panel-open": "awsui_is-split-panel-open_hyvsj_1f6b4_630",
51
- "split-panel-position-side": "awsui_split-panel-position-side_hyvsj_1f6b4_630",
52
- "has-active-drawer": "awsui_has-active-drawer_hyvsj_1f6b4_630",
53
- "mobile-toolbar": "awsui_mobile-toolbar_hyvsj_1f6b4_639",
54
- "mobile-toolbar-nav": "awsui_mobile-toolbar-nav_hyvsj_1f6b4_655",
55
- "mobile-toolbar-breadcrumbs": "awsui_mobile-toolbar-breadcrumbs_hyvsj_1f6b4_659",
56
- "mobile-toolbar-tools": "awsui_mobile-toolbar-tools_hyvsj_1f6b4_663",
57
- "navigation-container": "awsui_navigation-container_hyvsj_1f6b4_672",
58
- "show-navigation": "awsui_show-navigation_hyvsj_1f6b4_716",
59
- "animating": "awsui_animating_hyvsj_1f6b4_738",
60
- "showButtons": "awsui_showButtons_hyvsj_1f6b4_1",
61
- "navigation": "awsui_navigation_hyvsj_1f6b4_672",
62
- "openNavigation": "awsui_openNavigation_hyvsj_1f6b4_1",
63
- "animated-content": "awsui_animated-content_hyvsj_1f6b4_800",
64
- "hide-navigation": "awsui_hide-navigation_hyvsj_1f6b4_809",
65
- "notifications": "awsui_notifications_hyvsj_1f6b4_819",
66
- "sticky-notifications": "awsui_sticky-notifications_hyvsj_1f6b4_825",
67
- "split-panel-bottom": "awsui_split-panel-bottom_hyvsj_1f6b4_842",
68
- "position-bottom": "awsui_position-bottom_hyvsj_1f6b4_889",
69
- "openSplitPanelBottom": "awsui_openSplitPanelBottom_hyvsj_1f6b4_1",
70
- "split-panel-side": "awsui_split-panel-side_hyvsj_1f6b4_918",
71
- "position-side": "awsui_position-side_hyvsj_1f6b4_931",
72
- "tools-container": "awsui_tools-container_hyvsj_1f6b4_950",
73
- "tools": "awsui_tools_hyvsj_1f6b4_950",
74
- "openTools": "awsui_openTools_hyvsj_1f6b4_1",
75
- "has-tools-form-persistence": "awsui_has-tools-form-persistence_hyvsj_1f6b4_1045",
76
- "hide-tools": "awsui_hide-tools_hyvsj_1f6b4_1055",
77
- "show-tools": "awsui_show-tools_hyvsj_1f6b4_1067",
78
- "has-tools-form": "awsui_has-tools-form_hyvsj_1f6b4_1045",
79
- "trigger-badge-wrapper": "awsui_trigger-badge-wrapper_hyvsj_1f6b4_1127",
80
- "trigger": "awsui_trigger_hyvsj_1f6b4_1127",
81
- "selected": "awsui_selected_hyvsj_1f6b4_1191",
82
- "badge": "awsui_badge_hyvsj_1f6b4_1211",
83
- "trigger-wrapper": "awsui_trigger-wrapper_hyvsj_1f6b4_1215",
84
- "dot": "awsui_dot_hyvsj_1f6b4_1221"
5
+ "background": "awsui_background_hyvsj_6otqt_93",
6
+ "scrolling-background": "awsui_scrolling-background_hyvsj_6otqt_96",
7
+ "sticky-background": "awsui_sticky-background_hyvsj_6otqt_102",
8
+ "has-sticky-notifications": "awsui_has-sticky-notifications_hyvsj_6otqt_110",
9
+ "breadcrumbs": "awsui_breadcrumbs_hyvsj_6otqt_123",
10
+ "has-sticky-background": "awsui_has-sticky-background_hyvsj_6otqt_133",
11
+ "drawers-container": "awsui_drawers-container_hyvsj_6otqt_145",
12
+ "has-open-drawer": "awsui_has-open-drawer_hyvsj_6otqt_156",
13
+ "disable-body-scroll": "awsui_disable-body-scroll_hyvsj_6otqt_180",
14
+ "drawers-desktop-triggers-container": "awsui_drawers-desktop-triggers-container_hyvsj_6otqt_185",
15
+ "has-multiple-triggers": "awsui_has-multiple-triggers_hyvsj_6otqt_204",
16
+ "drawers-mobile-triggers-container": "awsui_drawers-mobile-triggers-container_hyvsj_6otqt_214",
17
+ "drawers-trigger-content": "awsui_drawers-trigger-content_hyvsj_6otqt_218",
18
+ "drawers-trigger-overflow": "awsui_drawers-trigger-overflow_hyvsj_6otqt_232",
19
+ "drawers-trigger": "awsui_drawers-trigger_hyvsj_6otqt_218",
20
+ "drawer": "awsui_drawer_hyvsj_6otqt_145",
21
+ "drawer-content-container": "awsui_drawer-content-container_hyvsj_6otqt_262",
22
+ "drawer-close-button": "awsui_drawer-close-button_hyvsj_6otqt_271",
23
+ "drawer-content": "awsui_drawer-content_hyvsj_6otqt_262",
24
+ "drawer-content-hidden": "awsui_drawer-content-hidden_hyvsj_6otqt_279",
25
+ "drawer-slider": "awsui_drawer-slider_hyvsj_6otqt_282",
26
+ "is-drawer-open": "awsui_is-drawer-open_hyvsj_6otqt_289",
27
+ "content": "awsui_content_hyvsj_6otqt_314",
28
+ "layout": "awsui_layout_hyvsj_6otqt_335",
29
+ "has-max-content-width": "awsui_has-max-content-width_hyvsj_6otqt_418",
30
+ "content-type-dashboard": "awsui_content-type-dashboard_hyvsj_6otqt_433",
31
+ "content-type-table": "awsui_content-type-table_hyvsj_6otqt_447",
32
+ "content-type-cards": "awsui_content-type-cards_hyvsj_6otqt_447",
33
+ "is-overlap-disabled": "awsui_is-overlap-disabled_hyvsj_6otqt_453",
34
+ "is-hide-mobile-toolbar": "awsui_is-hide-mobile-toolbar_hyvsj_6otqt_456",
35
+ "has-content-gap-left": "awsui_has-content-gap-left_hyvsj_6otqt_488",
36
+ "has-content-gap-right": "awsui_has-content-gap-right_hyvsj_6otqt_491",
37
+ "content-first-child-notifications": "awsui_content-first-child-notifications_hyvsj_6otqt_501",
38
+ "has-breadcrumbs": "awsui_has-breadcrumbs_hyvsj_6otqt_504",
39
+ "content-first-child-header": "awsui_content-first-child-header_hyvsj_6otqt_507",
40
+ "has-header": "awsui_has-header_hyvsj_6otqt_507",
41
+ "content-first-child-main": "awsui_content-first-child-main_hyvsj_6otqt_528",
42
+ "disable-content-paddings": "awsui_disable-content-paddings_hyvsj_6otqt_528",
43
+ "has-split-panel": "awsui_has-split-panel_hyvsj_6otqt_571",
44
+ "split-panel-position-bottom": "awsui_split-panel-position-bottom_hyvsj_6otqt_571",
45
+ "block-body-scroll": "awsui_block-body-scroll_hyvsj_6otqt_587",
46
+ "unfocusable": "awsui_unfocusable_hyvsj_6otqt_592",
47
+ "container": "awsui_container_hyvsj_6otqt_602",
48
+ "is-navigation-open": "awsui_is-navigation-open_hyvsj_6otqt_627",
49
+ "is-tools-open": "awsui_is-tools-open_hyvsj_6otqt_630",
50
+ "is-split-panel-open": "awsui_is-split-panel-open_hyvsj_6otqt_630",
51
+ "split-panel-position-side": "awsui_split-panel-position-side_hyvsj_6otqt_630",
52
+ "has-active-drawer": "awsui_has-active-drawer_hyvsj_6otqt_630",
53
+ "mobile-toolbar": "awsui_mobile-toolbar_hyvsj_6otqt_639",
54
+ "mobile-toolbar-nav": "awsui_mobile-toolbar-nav_hyvsj_6otqt_655",
55
+ "mobile-toolbar-breadcrumbs": "awsui_mobile-toolbar-breadcrumbs_hyvsj_6otqt_659",
56
+ "mobile-toolbar-tools": "awsui_mobile-toolbar-tools_hyvsj_6otqt_663",
57
+ "navigation-container": "awsui_navigation-container_hyvsj_6otqt_672",
58
+ "show-navigation": "awsui_show-navigation_hyvsj_6otqt_716",
59
+ "animating": "awsui_animating_hyvsj_6otqt_738",
60
+ "showButtons": "awsui_showButtons_hyvsj_6otqt_1",
61
+ "navigation": "awsui_navigation_hyvsj_6otqt_672",
62
+ "openNavigation": "awsui_openNavigation_hyvsj_6otqt_1",
63
+ "animated-content": "awsui_animated-content_hyvsj_6otqt_800",
64
+ "hide-navigation": "awsui_hide-navigation_hyvsj_6otqt_809",
65
+ "notifications": "awsui_notifications_hyvsj_6otqt_819",
66
+ "sticky-notifications": "awsui_sticky-notifications_hyvsj_6otqt_825",
67
+ "split-panel-bottom": "awsui_split-panel-bottom_hyvsj_6otqt_842",
68
+ "position-bottom": "awsui_position-bottom_hyvsj_6otqt_889",
69
+ "openSplitPanelBottom": "awsui_openSplitPanelBottom_hyvsj_6otqt_1",
70
+ "split-panel-side": "awsui_split-panel-side_hyvsj_6otqt_918",
71
+ "position-side": "awsui_position-side_hyvsj_6otqt_931",
72
+ "tools-container": "awsui_tools-container_hyvsj_6otqt_950",
73
+ "tools": "awsui_tools_hyvsj_6otqt_950",
74
+ "openTools": "awsui_openTools_hyvsj_6otqt_1",
75
+ "has-tools-form-persistence": "awsui_has-tools-form-persistence_hyvsj_6otqt_1045",
76
+ "hide-tools": "awsui_hide-tools_hyvsj_6otqt_1055",
77
+ "show-tools": "awsui_show-tools_hyvsj_6otqt_1067",
78
+ "has-tools-form": "awsui_has-tools-form_hyvsj_6otqt_1045",
79
+ "trigger-badge-wrapper": "awsui_trigger-badge-wrapper_hyvsj_6otqt_1127",
80
+ "trigger": "awsui_trigger_hyvsj_6otqt_1127",
81
+ "selected": "awsui_selected_hyvsj_6otqt_1190",
82
+ "badge": "awsui_badge_hyvsj_6otqt_1210",
83
+ "trigger-wrapper": "awsui_trigger-wrapper_hyvsj_6otqt_1214",
84
+ "dot": "awsui_dot_hyvsj_6otqt_1220"
85
85
  };
86
86
 
@@ -62,8 +62,9 @@ export interface ButtonProps extends BaseComponentProps {
62
62
  */
63
63
  formAction?: ButtonProps.FormAction;
64
64
  /**
65
- * Adds `aria-label` to the button element. It should be used in buttons that don't have text in order to make
66
- * them accessible. The text will also be added to the `title` attribute of the button.
65
+ * Adds `aria-label` to the button element. Use this to provide an accessible name for buttons
66
+ * that don't have visible text, and to distinguish between multiple buttons with identical visible text.
67
+ * The text will also be added to the `title` attribute of the button.
67
68
  */
68
69
  ariaLabel?: string;
69
70
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"lib/default/","sources":["button/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,WAAW,IAAI,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAE/G,MAAM,WAAW,WAAY,SAAQ,kBAAkB;IACrD;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,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CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"lib/default/","sources":["button/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { BaseComponentProps } from '../internal/base-component';\nimport { IconProps } from '../icon/interfaces';\nimport React from 'react';\nimport { BaseNavigationDetail, CancelableEventHandler, ClickDetail as _ClickDetail } from '../internal/events';\n\nexport interface ButtonProps extends BaseComponentProps {\n /**\n * Renders the button as disabled and prevents clicks.\n */\n disabled?: boolean;\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 users from clicking the button, but it can still be focused.\n */\n loading?: boolean;\n /**\n * Specifies the text that screen reader announces when the button is in a loading state.\n */\n loadingText?: string;\n /**\n * Displays an icon next to the text. You can use the `iconAlign` property to position the icon.\n */\n iconName?: IconProps.Name;\n /**\n * Specifies the alignment of the icon.\n */\n iconAlign?: ButtonProps.IconAlign;\n /**\n * Specifies the URL of a custom icon. Use this property if the icon you want isn't available.\n *\n * If you set both `iconUrl` and `iconSvg`, `iconSvg` will take precedence.\n */\n iconUrl?: string;\n /**\n * Specifies the SVG of a custom icon.\n *\n * Use this property if you want your custom icon to inherit colors dictated by variant or hover states.\n * When this property is set, the component will be decorated with `aria-hidden=\"true\"`. Ensure that the `svg` element:\n * - has attribute `focusable=\"false\"`.\n * - has `viewBox=\"0 0 16 16\"`.\n *\n * If you set the `svg` element as the root node of the slot, the component will automatically\n * - set `stroke=\"currentColor\"`, `fill=\"none\"`, and `vertical-align=\"top\"`.\n * - set the stroke width based on the size of the icon.\n * - set the width and height of the SVG element based on the size of the icon.\n *\n * If you don't want these styles to be automatically set, wrap the `svg` element into a `span`.\n * You can still set the stroke to `currentColor` to inherit the color of the surrounding elements.\n *\n * If you set both `iconUrl` and `iconSvg`, `iconSvg` will take precedence.\n *\n * *Note:* Remember to remove any additional elements (for example: `defs`) and related CSS classes from SVG files exported from design software.\n * In most cases, they aren't needed, as the `svg` element inherits styles from the icon component.\n */\n iconSvg?: React.ReactNode;\n /**\n * Specifies alternate text for a custom icon. We recommend that you provide this for accessibility.\n * This property is ignored if you use a predefined icon or if you set your custom icon using the `iconSvg` slot.\n */\n iconAlt?: string;\n /**\n * The form action that is performed by a button click.\n */\n formAction?: ButtonProps.FormAction;\n\n /**\n * Adds `aria-label` to the button element. It should be used in buttons that don't have text in order to make\n * them accessible. The text will also be added to the `title` attribute of the button.\n */\n ariaLabel?: string;\n\n /**\n * Adds `aria-describedby` to the button.\n */\n ariaDescribedby?: string;\n\n /**\n * Applies button styling to a link. Use this property if you need a link styled as a button (`variant=link`).\n * For example, if you have a 'help' button that links to a documentation page.\n */\n href?: string;\n\n /**\n * Specifies where to open the linked URL (for example, to open in a new browser window or tab use `_blank`).\n * This property only applies when an `href` is provided.\n */\n target?: string;\n\n /**\n * Adds a `rel` attribute to the link. By default, the component sets the `rel` attribute to \"noopener noreferrer\" when `target` is `\"_blank\"`.\n * If the `rel` property is provided, it overrides the default behavior.\n */\n rel?: string;\n\n /**\n * Specifies whether the linked URL, when selected, will prompt the user to download instead of navigate.\n * You can specify a string value that will be suggested as the name of the downloaded file.\n * This property only applies when an `href` is provided.\n **/\n download?: boolean | string;\n\n /**\n * Specifies if the `text` content wraps. If you set it to `false`, it prevents the text from wrapping.\n */\n wrapText?: boolean;\n\n /** Determines the general styling of the button as follows:\n * * `primary` for primary buttons.\n * * `normal` for secondary buttons.\n * * `link` for tertiary buttons.\n * * `icon` to display an icon only (no text).\n * * `inline-icon` to display an icon-only (no text) button within a text context.\n * * `inline-link` to display a tertiary button with no outer padding.\n */\n variant?: ButtonProps.Variant;\n\n /** The id of the <form> element to associate with the button. The value of this attribute must be the id of a <form> in the same document.\n * Use when a button is not the ancestor of a form element, such as when used in a modal.\n */\n form?: string;\n\n /**\n * Text displayed in the button element.\n * @displayname text\n */\n children?: React.ReactNode;\n\n /**\n * Called when the user clicks on the button and the button is not disabled or in loading state.\n */\n onClick?: CancelableEventHandler<ButtonProps.ClickDetail>;\n\n /**\n * Called when the user clicks on the button with the left mouse button without pressing\n * modifier keys (that is, CTRL, ALT, SHIFT, META), and the button has an `href` set.\n */\n onFollow?: CancelableEventHandler<ButtonProps.FollowDetail>;\n\n /**\n * Adds aria-expanded to the button element. Use when the button controls an expandable element.\n */\n ariaExpanded?: boolean;\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 ButtonProps {\n export type Variant = 'normal' | 'primary' | 'link' | 'icon' | 'inline-icon' | 'inline-link';\n export type ClickDetail = _ClickDetail;\n export type FollowDetail = BaseNavigationDetail;\n\n export type FormAction = 'submit' | 'none';\n\n export type IconAlign = 'left' | 'right';\n\n export interface Ref {\n /**\n * Focuses the underlying native button.\n */\n focus(options?: FocusOptions): void;\n }\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"lib/default/","sources":["button/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { BaseComponentProps } from '../internal/base-component';\nimport { IconProps } from '../icon/interfaces';\nimport React from 'react';\nimport { BaseNavigationDetail, CancelableEventHandler, ClickDetail as _ClickDetail } from '../internal/events';\n\nexport interface ButtonProps extends BaseComponentProps {\n /**\n * Renders the button as disabled and prevents clicks.\n */\n disabled?: boolean;\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 users from clicking the button, but it can still be focused.\n */\n loading?: boolean;\n /**\n * Specifies the text that screen reader announces when the button is in a loading state.\n */\n loadingText?: string;\n /**\n * Displays an icon next to the text. You can use the `iconAlign` property to position the icon.\n */\n iconName?: IconProps.Name;\n /**\n * Specifies the alignment of the icon.\n */\n iconAlign?: ButtonProps.IconAlign;\n /**\n * Specifies the URL of a custom icon. Use this property if the icon you want isn't available.\n *\n * If you set both `iconUrl` and `iconSvg`, `iconSvg` will take precedence.\n */\n iconUrl?: string;\n /**\n * Specifies the SVG of a custom icon.\n *\n * Use this property if you want your custom icon to inherit colors dictated by variant or hover states.\n * When this property is set, the component will be decorated with `aria-hidden=\"true\"`. Ensure that the `svg` element:\n * - has attribute `focusable=\"false\"`.\n * - has `viewBox=\"0 0 16 16\"`.\n *\n * If you set the `svg` element as the root node of the slot, the component will automatically\n * - set `stroke=\"currentColor\"`, `fill=\"none\"`, and `vertical-align=\"top\"`.\n * - set the stroke width based on the size of the icon.\n * - set the width and height of the SVG element based on the size of the icon.\n *\n * If you don't want these styles to be automatically set, wrap the `svg` element into a `span`.\n * You can still set the stroke to `currentColor` to inherit the color of the surrounding elements.\n *\n * If you set both `iconUrl` and `iconSvg`, `iconSvg` will take precedence.\n *\n * *Note:* Remember to remove any additional elements (for example: `defs`) and related CSS classes from SVG files exported from design software.\n * In most cases, they aren't needed, as the `svg` element inherits styles from the icon component.\n */\n iconSvg?: React.ReactNode;\n /**\n * Specifies alternate text for a custom icon. We recommend that you provide this for accessibility.\n * This property is ignored if you use a predefined icon or if you set your custom icon using the `iconSvg` slot.\n */\n iconAlt?: string;\n /**\n * The form action that is performed by a button click.\n */\n formAction?: ButtonProps.FormAction;\n\n /**\n * Adds `aria-label` to the button element. Use this to provide an accessible name for buttons\n * that don't have visible text, and to distinguish between multiple buttons with identical visible text.\n * The text will also be added to the `title` attribute of the button.\n */\n ariaLabel?: string;\n\n /**\n * Adds `aria-describedby` to the button.\n */\n ariaDescribedby?: string;\n\n /**\n * Applies button styling to a link. Use this property if you need a link styled as a button (`variant=link`).\n * For example, if you have a 'help' button that links to a documentation page.\n */\n href?: string;\n\n /**\n * Specifies where to open the linked URL (for example, to open in a new browser window or tab use `_blank`).\n * This property only applies when an `href` is provided.\n */\n target?: string;\n\n /**\n * Adds a `rel` attribute to the link. By default, the component sets the `rel` attribute to \"noopener noreferrer\" when `target` is `\"_blank\"`.\n * If the `rel` property is provided, it overrides the default behavior.\n */\n rel?: string;\n\n /**\n * Specifies whether the linked URL, when selected, will prompt the user to download instead of navigate.\n * You can specify a string value that will be suggested as the name of the downloaded file.\n * This property only applies when an `href` is provided.\n **/\n download?: boolean | string;\n\n /**\n * Specifies if the `text` content wraps. If you set it to `false`, it prevents the text from wrapping.\n */\n wrapText?: boolean;\n\n /** Determines the general styling of the button as follows:\n * * `primary` for primary buttons.\n * * `normal` for secondary buttons.\n * * `link` for tertiary buttons.\n * * `icon` to display an icon only (no text).\n * * `inline-icon` to display an icon-only (no text) button within a text context.\n * * `inline-link` to display a tertiary button with no outer padding.\n */\n variant?: ButtonProps.Variant;\n\n /** The id of the <form> element to associate with the button. The value of this attribute must be the id of a <form> in the same document.\n * Use when a button is not the ancestor of a form element, such as when used in a modal.\n */\n form?: string;\n\n /**\n * Text displayed in the button element.\n * @displayname text\n */\n children?: React.ReactNode;\n\n /**\n * Called when the user clicks on the button and the button is not disabled or in loading state.\n */\n onClick?: CancelableEventHandler<ButtonProps.ClickDetail>;\n\n /**\n * Called when the user clicks on the button with the left mouse button without pressing\n * modifier keys (that is, CTRL, ALT, SHIFT, META), and the button has an `href` set.\n */\n onFollow?: CancelableEventHandler<ButtonProps.FollowDetail>;\n\n /**\n * Adds aria-expanded to the button element. Use when the button controls an expandable element.\n */\n ariaExpanded?: boolean;\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 ButtonProps {\n export type Variant = 'normal' | 'primary' | 'link' | 'icon' | 'inline-icon' | 'inline-link';\n export type ClickDetail = _ClickDetail;\n export type FollowDetail = BaseNavigationDetail;\n\n export type FormAction = 'submit' | 'none';\n\n export type IconAlign = 'left' | 'right';\n\n export interface Ref {\n /**\n * Focuses the underlying native button.\n */\n focus(options?: FocusOptions): void;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"lib/default/","sources":["button/internal.tsx"],"names":[],"mappings":"A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C,EAAE,OAAO,CAAC;CACvB,GAAG,0BAA0B,CAAC;AAE/B,eAAO,MAAM,cAAc;cAPf,WAAW,CAAC,SAAS,CAAC,GAAG,eAAe,GAAG,kBAAkB,GAAG,cAAc,GAAG,eAAe;;;;;sEA4L3G,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -15,6 +15,7 @@ import { useFunnel, useFunnelStep, useFunnelSubStep } from '../internal/analytic
15
15
  import { DATA_ATTR_FUNNEL_VALUE, getFunnelValueSelector, getNameFromSelector, getSubStepAllSelector, } from '../internal/analytics/selectors';
16
16
  import { FunnelMetrics } from '../internal/analytics';
17
17
  import { useUniqueId } from '../internal/hooks/use-unique-id';
18
+ import { usePerformanceMarks } from '../internal/hooks/use-performance-marks';
18
19
  export const InternalButton = React.forwardRef((_a, ref) => {
19
20
  var { children, iconName, __iconClass, onClick, onFollow, iconAlign = 'left', iconUrl, iconSvg, iconAlt, variant = 'normal', loading = false, loadingText, disabled = false, wrapText = true, href, target, rel, download, formAction = 'submit', ariaLabel, ariaDescribedby, ariaExpanded, fullWidth, badge, __nativeAttributes, __internalRootRef = null, __activated = false } = _a, props = __rest(_a, ["children", "iconName", "__iconClass", "onClick", "onFollow", "iconAlign", "iconUrl", "iconSvg", "iconAlt", "variant", "loading", "loadingText", "disabled", "wrapText", "href", "target", "rel", "download", "formAction", "ariaLabel", "ariaDescribedby", "ariaExpanded", "fullWidth", "badge", "__nativeAttributes", "__internalRootRef", "__activated"]);
20
21
  checkSafeUrl('Button', href);
@@ -28,6 +29,14 @@ export const InternalButton = React.forwardRef((_a, ref) => {
28
29
  const { funnelInteractionId } = useFunnel();
29
30
  const { stepNumber, stepNameSelector } = useFunnelStep();
30
31
  const { subStepSelector, subStepNameSelector } = useFunnelSubStep();
32
+ usePerformanceMarks('primaryButton', variant === 'primary', buttonRef, () => {
33
+ var _a;
34
+ return ({
35
+ loading,
36
+ disabled,
37
+ text: (_a = buttonRef.current) === null || _a === void 0 ? void 0 : _a.innerText,
38
+ });
39
+ }, [loading, disabled]);
31
40
  const handleClick = (event) => {
32
41
  if (isNotInteractive) {
33
42
  return event.preventDefault();
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js","sourceRoot":"lib/default/","sources":["button/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3E,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAC9D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAmB,QAAQ,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAGrE,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,UAAU,MAAM,oCAAoC,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AACpG,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAU9D,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,CAAC,UAAU,CAC5C,CACE,EA6BsB,EACtB,GAA+B,EAC/B,EAAE;QA/BF,EACE,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,OAAO,EACP,QAAQ,EACR,SAAS,GAAG,MAAM,EAClB,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,GAAG,QAAQ,EACl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E,IAAI,EACV,MAAM,EAAE,MAAM;gBACd,8FAA8F;gBAC9F,GAAG,EAAE,GAAG,aAAH,GAAG,cAAH,GAAG,GAAI,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,SAAS,CAAC,EACrE,QAAQ,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,mBAC5B,gBAAgB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,EAClD,QAAQ,EAAE,QAAQ,KAEjB,aAAa,CACZ;YACH,OAAO,IAAI,WAAW,IAAI,oBAAC,UAAU,QAAE,WAAW,CAAc,CAChE,CACJ,CAAC;KACH;IACD,OAAO,CACL;QACE,gDACM,WAAW,IACf,IAAI,EAAE,UAAU,KAAK,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,EACjD,QAAQ,EAAE,QAAQ,mBACH,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,KAErD,aAAa,CACP;QACR,OAAO,IAAI,WAAW,IAAI,oBAAC,UAAU,QAAE,WAAW,CAAc,CAChE,CACJ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { useEffect, useRef } from 'react';\nimport { fireCancelableEvent, isPlainLeftClick } from '../internal/events';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport styles from './styles.css.js';\nimport { ButtonIconProps, LeftIcon, RightIcon } from './icon-helper';\nimport { ButtonProps } from './interfaces';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { checkSafeUrl } from '../internal/utils/check-safe-url';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport LiveRegion from '../internal/components/live-region';\nimport { useButtonContext } from '../internal/context/button-context';\nimport { useFunnel, useFunnelStep, useFunnelSubStep } from '../internal/analytics/hooks/use-funnel';\nimport {\n DATA_ATTR_FUNNEL_VALUE,\n getFunnelValueSelector,\n getNameFromSelector,\n getSubStepAllSelector,\n} from '../internal/analytics/selectors';\nimport { FunnelMetrics } from '../internal/analytics';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\n\nexport type InternalButtonProps = Omit<ButtonProps, 'variant'> & {\n variant?: ButtonProps['variant'] | 'flashbar-icon' | 'breadcrumb-group' | 'menu-trigger' | 'modal-dismiss';\n badge?: boolean;\n __nativeAttributes?: Record<string, any>;\n __iconClass?: string;\n __activated?: boolean;\n} & InternalBaseComponentProps;\n\nexport const InternalButton = React.forwardRef(\n (\n {\n children,\n iconName,\n __iconClass,\n onClick,\n onFollow,\n iconAlign = 'left',\n iconUrl,\n iconSvg,\n iconAlt,\n variant = 'normal',\n loading = false,\n loadingText,\n disabled = false,\n wrapText = true,\n href,\n target,\n rel,\n download,\n formAction = 'submit',\n ariaLabel,\n ariaDescribedby,\n ariaExpanded,\n fullWidth,\n badge,\n __nativeAttributes,\n __internalRootRef = null,\n __activated = false,\n ...props\n }: InternalButtonProps,\n ref: React.Ref<ButtonProps.Ref>\n ) => {\n checkSafeUrl('Button', href);\n const isAnchor = Boolean(href);\n const isNotInteractive = loading || disabled;\n const shouldHaveContent =\n children && ['icon', 'inline-icon', 'flashbar-icon', 'modal-dismiss'].indexOf(variant) === -1;\n\n const buttonRef = useRef<HTMLElement>(null);\n useForwardFocus(ref, buttonRef);\n\n const buttonContext = useButtonContext();\n\n const uniqueId = useUniqueId('button');\n const { funnelInteractionId } = useFunnel();\n const { stepNumber, stepNameSelector } = useFunnelStep();\n const { subStepSelector, subStepNameSelector } = useFunnelSubStep();\n\n const handleClick = (event: React.MouseEvent) => {\n if (isNotInteractive) {\n return event.preventDefault();\n }\n\n if (isAnchor && isPlainLeftClick(event)) {\n fireCancelableEvent(onFollow, { href, target }, event);\n\n if ((iconName === 'external' || target === '_blank') && funnelInteractionId) {\n const stepName = getNameFromSelector(stepNameSelector);\n const subStepName = getNameFromSelector(subStepNameSelector);\n\n FunnelMetrics.externalLinkInteracted({\n funnelInteractionId,\n stepNumber,\n stepName,\n stepNameSelector,\n subStepSelector,\n subStepName,\n subStepNameSelector,\n elementSelector: getFunnelValueSelector(uniqueId),\n subStepAllSelector: getSubStepAllSelector(),\n });\n }\n }\n\n const { altKey, button, ctrlKey, metaKey, shiftKey } = event;\n fireCancelableEvent(onClick, { altKey, button, ctrlKey, metaKey, shiftKey }, event);\n buttonContext.onClick({ variant });\n };\n\n const buttonClass = clsx(props.className, styles.button, styles[`variant-${variant}`], {\n [styles.disabled]: isNotInteractive,\n [styles['button-no-wrap']]: !wrapText,\n [styles['button-no-text']]: !shouldHaveContent,\n [styles['is-activated']]: __activated,\n [styles['full-width']]: shouldHaveContent && fullWidth,\n });\n\n const buttonProps = {\n ...props,\n ...__nativeAttributes,\n // https://github.com/microsoft/TypeScript/issues/36659\n ref: useMergeRefs(buttonRef as any, __internalRootRef),\n 'aria-label': ariaLabel,\n 'aria-describedby': ariaDescribedby,\n 'aria-expanded': ariaExpanded,\n // add ariaLabel as `title` as visible hint text\n title: ariaLabel,\n className: buttonClass,\n onClick: handleClick,\n [DATA_ATTR_FUNNEL_VALUE]: uniqueId,\n } as const;\n const iconProps: ButtonIconProps = {\n loading,\n iconName,\n iconAlign,\n iconUrl,\n iconSvg,\n iconAlt,\n variant,\n badge,\n iconClass: __iconClass,\n iconSize: variant === 'modal-dismiss' ? 'medium' : 'normal',\n };\n const buttonContent = (\n <>\n <LeftIcon {...iconProps} />\n {shouldHaveContent && <span className={styles.content}>{children}</span>}\n <RightIcon {...iconProps} />\n </>\n );\n\n const { loadingButtonCount } = useFunnel();\n useEffect(() => {\n if (loading) {\n loadingButtonCount.current++;\n return () => {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n loadingButtonCount.current--;\n };\n }\n }, [loading, loadingButtonCount]);\n\n if (isAnchor) {\n return (\n // https://github.com/yannickcr/eslint-plugin-react/issues/2962\n // eslint-disable-next-line react/jsx-no-target-blank\n <>\n <a\n {...buttonProps}\n href={href}\n target={target}\n // security recommendation: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target\n rel={rel ?? (target === '_blank' ? 'noopener noreferrer' : undefined)}\n tabIndex={isNotInteractive ? -1 : undefined}\n aria-disabled={isNotInteractive ? true : undefined}\n download={download}\n >\n {buttonContent}\n </a>\n {loading && loadingText && <LiveRegion>{loadingText}</LiveRegion>}\n </>\n );\n }\n return (\n <>\n <button\n {...buttonProps}\n type={formAction === 'none' ? 'button' : 'submit'}\n disabled={disabled}\n aria-disabled={loading && !disabled ? true : undefined}\n >\n {buttonContent}\n </button>\n {loading && loadingText && <LiveRegion>{loadingText}</LiveRegion>}\n </>\n );\n }\n);\n\nexport default InternalButton;\n"]}
1
+ {"version":3,"file":"internal.js","sourceRoot":"lib/default/","sources":["button/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3E,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAC9D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAmB,QAAQ,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAGrE,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,UAAU,MAAM,oCAAoC,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,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H;IACD,OAAO,CACL;QACE,gDACM,WAAW,IACf,IAAI,EAAE,UAAU,KAAK,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,EACjD,QAAQ,EAAE,QAAQ,mBACH,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,KAErD,aAAa,CACP;QACR,OAAO,IAAI,WAAW,IAAI,oBAAC,UAAU,QAAE,WAAW,CAAc,CAChE,CACJ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { useEffect, useRef } from 'react';\nimport { fireCancelableEvent, isPlainLeftClick } from '../internal/events';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport styles from './styles.css.js';\nimport { ButtonIconProps, LeftIcon, RightIcon } from './icon-helper';\nimport { ButtonProps } from './interfaces';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { checkSafeUrl } from '../internal/utils/check-safe-url';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport LiveRegion from '../internal/components/live-region';\nimport { useButtonContext } from '../internal/context/button-context';\nimport { useFunnel, useFunnelStep, useFunnelSubStep } from '../internal/analytics/hooks/use-funnel';\nimport {\n DATA_ATTR_FUNNEL_VALUE,\n getFunnelValueSelector,\n getNameFromSelector,\n getSubStepAllSelector,\n} from '../internal/analytics/selectors';\nimport { FunnelMetrics } from '../internal/analytics';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { usePerformanceMarks } from '../internal/hooks/use-performance-marks';\n\nexport type InternalButtonProps = Omit<ButtonProps, 'variant'> & {\n variant?: ButtonProps['variant'] | 'flashbar-icon' | 'breadcrumb-group' | 'menu-trigger' | 'modal-dismiss';\n badge?: boolean;\n __nativeAttributes?: Record<string, any>;\n __iconClass?: string;\n __activated?: boolean;\n} & InternalBaseComponentProps;\n\nexport const InternalButton = React.forwardRef(\n (\n {\n children,\n iconName,\n __iconClass,\n onClick,\n onFollow,\n iconAlign = 'left',\n iconUrl,\n iconSvg,\n iconAlt,\n variant = 'normal',\n loading = false,\n loadingText,\n disabled = false,\n wrapText = true,\n href,\n target,\n rel,\n download,\n formAction = 'submit',\n ariaLabel,\n ariaDescribedby,\n ariaExpanded,\n fullWidth,\n badge,\n __nativeAttributes,\n __internalRootRef = null,\n __activated = false,\n ...props\n }: InternalButtonProps,\n ref: React.Ref<ButtonProps.Ref>\n ) => {\n checkSafeUrl('Button', href);\n const isAnchor = Boolean(href);\n const isNotInteractive = loading || disabled;\n const shouldHaveContent =\n children && ['icon', 'inline-icon', 'flashbar-icon', 'modal-dismiss'].indexOf(variant) === -1;\n\n const buttonRef = useRef<HTMLElement>(null);\n useForwardFocus(ref, buttonRef);\n\n const buttonContext = useButtonContext();\n\n const uniqueId = useUniqueId('button');\n const { funnelInteractionId } = useFunnel();\n const { stepNumber, stepNameSelector } = useFunnelStep();\n const { subStepSelector, subStepNameSelector } = useFunnelSubStep();\n\n usePerformanceMarks(\n 'primaryButton',\n variant === 'primary',\n buttonRef,\n () => ({\n loading,\n disabled,\n text: buttonRef.current?.innerText,\n }),\n [loading, disabled]\n );\n\n const handleClick = (event: React.MouseEvent) => {\n if (isNotInteractive) {\n return event.preventDefault();\n }\n\n if (isAnchor && isPlainLeftClick(event)) {\n fireCancelableEvent(onFollow, { href, target }, event);\n\n if ((iconName === 'external' || target === '_blank') && funnelInteractionId) {\n const stepName = getNameFromSelector(stepNameSelector);\n const subStepName = getNameFromSelector(subStepNameSelector);\n\n FunnelMetrics.externalLinkInteracted({\n funnelInteractionId,\n stepNumber,\n stepName,\n stepNameSelector,\n subStepSelector,\n subStepName,\n subStepNameSelector,\n elementSelector: getFunnelValueSelector(uniqueId),\n subStepAllSelector: getSubStepAllSelector(),\n });\n }\n }\n\n const { altKey, button, ctrlKey, metaKey, shiftKey } = event;\n fireCancelableEvent(onClick, { altKey, button, ctrlKey, metaKey, shiftKey }, event);\n buttonContext.onClick({ variant });\n };\n\n const buttonClass = clsx(props.className, styles.button, styles[`variant-${variant}`], {\n [styles.disabled]: isNotInteractive,\n [styles['button-no-wrap']]: !wrapText,\n [styles['button-no-text']]: !shouldHaveContent,\n [styles['is-activated']]: __activated,\n [styles['full-width']]: shouldHaveContent && fullWidth,\n });\n\n const buttonProps = {\n ...props,\n ...__nativeAttributes,\n // https://github.com/microsoft/TypeScript/issues/36659\n ref: useMergeRefs(buttonRef as any, __internalRootRef),\n 'aria-label': ariaLabel,\n 'aria-describedby': ariaDescribedby,\n 'aria-expanded': ariaExpanded,\n // add ariaLabel as `title` as visible hint text\n title: ariaLabel,\n className: buttonClass,\n onClick: handleClick,\n [DATA_ATTR_FUNNEL_VALUE]: uniqueId,\n } as const;\n const iconProps: ButtonIconProps = {\n loading,\n iconName,\n iconAlign,\n iconUrl,\n iconSvg,\n iconAlt,\n variant,\n badge,\n iconClass: __iconClass,\n iconSize: variant === 'modal-dismiss' ? 'medium' : 'normal',\n };\n const buttonContent = (\n <>\n <LeftIcon {...iconProps} />\n {shouldHaveContent && <span className={styles.content}>{children}</span>}\n <RightIcon {...iconProps} />\n </>\n );\n\n const { loadingButtonCount } = useFunnel();\n useEffect(() => {\n if (loading) {\n loadingButtonCount.current++;\n return () => {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n loadingButtonCount.current--;\n };\n }\n }, [loading, loadingButtonCount]);\n\n if (isAnchor) {\n return (\n // https://github.com/yannickcr/eslint-plugin-react/issues/2962\n // eslint-disable-next-line react/jsx-no-target-blank\n <>\n <a\n {...buttonProps}\n href={href}\n target={target}\n // security recommendation: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target\n rel={rel ?? (target === '_blank' ? 'noopener noreferrer' : undefined)}\n tabIndex={isNotInteractive ? -1 : undefined}\n aria-disabled={isNotInteractive ? true : undefined}\n download={download}\n >\n {buttonContent}\n </a>\n {loading && loadingText && <LiveRegion>{loadingText}</LiveRegion>}\n </>\n );\n }\n return (\n <>\n <button\n {...buttonProps}\n type={formAction === 'none' ? 'button' : 'submit'}\n disabled={disabled}\n aria-disabled={loading && !disabled ? true : undefined}\n >\n {buttonContent}\n </button>\n {loading && loadingText && <LiveRegion>{loadingText}</LiveRegion>}\n </>\n );\n }\n);\n\nexport default InternalButton;\n"]}
@@ -66,7 +66,7 @@ export interface ButtonDropdownProps extends BaseComponentProps, ExpandToViewpor
66
66
  expandableGroups?: boolean;
67
67
  /**
68
68
  * Adds `aria-label` to the button dropdown trigger.
69
- * It should be used in buttons that don't have text in order to make them accessible.
69
+ * Use this to provide an accessible name for buttons that don't have visible text.
70
70
  */
71
71
  ariaLabel?: string;
72
72
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"lib/default/","sources":["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';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { BaseNavigationDetail, CancelableEventHandler } from '../internal/events';\nimport { IconProps } from '../icon/interfaces';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { ExpandToViewport } from '../internal/components/dropdown/interfaces';\nimport { ButtonProps } from '../button/interfaces';\n\nexport interface ButtonDropdownProps extends BaseComponentProps, ExpandToViewport {\n /**\n * Array of objects, each having the following properties:\n\n * - `id` (string) - allows to identify the item that the user clicked on. Mandatory for individual items, optional for categories.\n\n * - `text` (string) - description shown in the menu for this item. Mandatory for individual items, optional for categories.\n\n * - `lang` (string) - (Optional) The language of the item, provided as a BCP 47 language tag.\n\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\n * - `disabledReason` (string) - (Optional) Displays text near the `text` property when item is disabled. Use to provide additional context.\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 * - `description` (string) - additional data that will be passed to a `data-description` attribute.\n\n * - `href` (string) - (Optional) Defines the target URL of the menu item, turning it into a link.\n\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\n * - `externalIconAriaLabel` (string) - Adds an `aria-label` to the external icon.\n\n * - `iconName` (string) - (Optional) Specifies the name of the icon, used with the [icon component](/components/icon/).\n\n * - `iconAlt` (string) - (Optional) Specifies alternate text for the icon when using `iconUrl`.\n\n * - `iconUrl` (string) - (Optional) Specifies the URL of a custom icon.\n\n * - `iconSvg` (ReactNode) - (Optional) Custom SVG icon. Equivalent to the `svg` slot of the [icon component](/components/icon/).\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 * 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 * It should be used in buttons that don't have text in order to make them accessible.\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 * 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\nexport namespace ButtonDropdownProps {\n export type Variant = 'normal' | 'primary' | 'icon' | 'inline-icon';\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 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 id: string;\n text: 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 ItemGroup extends Omit<Item, 'id' | 'text'> {\n id?: string;\n text?: string;\n items: Items;\n }\n\n export type ItemOrGroup = Item | ItemGroup;\n\n export type Items = ReadonlyArray<ItemOrGroup>;\n\n export interface ItemClickDetails extends BaseNavigationDetail {\n id: string;\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 = (item: ButtonDropdownProps.Item, event: React.MouseEvent | React.KeyboardEvent) => void;\n\nexport interface CategoryProps extends HighlightProps {\n item: ButtonDropdownProps.ItemGroup;\n onGroupToggle: GroupToggle;\n onItemActivate: ItemActivate;\n disabled: boolean;\n expandToViewport?: boolean;\n variant?: ItemListProps['variant'];\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 expandToViewport?: boolean;\n variant?: InternalButtonDropdownProps['variant'];\n}\n\nexport interface LinkItem extends ButtonDropdownProps.Item {\n href: string;\n}\n\nexport interface ItemProps {\n item: ButtonDropdownProps.Item | LinkItem;\n disabled: boolean;\n highlighted: boolean;\n onItemActivate: ItemActivate;\n highlightItem: (item: ButtonDropdownProps.ItemOrGroup) => void;\n first?: boolean;\n last: boolean;\n hasCategoryHeader: boolean;\n isKeyboardHighlighted?: boolean;\n variant?: ItemListProps['variant'];\n}\n\nexport interface InternalItem extends ButtonDropdownProps.Item {\n badge?: boolean;\n}\n\nexport interface InternalItemGroup extends Omit<ButtonDropdownProps.ItemGroup, 'items'> {\n items: InternalItems;\n}\n\nexport type InternalItems = ReadonlyArray<InternalItemOrGroup>;\n\nexport type InternalItemOrGroup = InternalItem | 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 * 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\nexport interface CustomTriggerProps {\n triggerRef: React.Ref<HTMLElement>;\n testUtilsClass: string;\n ariaLabel: string | undefined;\n disabled: boolean;\n isOpen: boolean;\n onClick: () => void;\n ariaExpanded: boolean;\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"lib/default/","sources":["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';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { BaseNavigationDetail, CancelableEventHandler } from '../internal/events';\nimport { IconProps } from '../icon/interfaces';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { ExpandToViewport } from '../internal/components/dropdown/interfaces';\nimport { ButtonProps } from '../button/interfaces';\n\nexport interface ButtonDropdownProps extends BaseComponentProps, ExpandToViewport {\n /**\n * Array of objects, each having the following properties:\n\n * - `id` (string) - allows to identify the item that the user clicked on. Mandatory for individual items, optional for categories.\n\n * - `text` (string) - description shown in the menu for this item. Mandatory for individual items, optional for categories.\n\n * - `lang` (string) - (Optional) The language of the item, provided as a BCP 47 language tag.\n\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\n * - `disabledReason` (string) - (Optional) Displays text near the `text` property when item is disabled. Use to provide additional context.\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 * - `description` (string) - additional data that will be passed to a `data-description` attribute.\n\n * - `href` (string) - (Optional) Defines the target URL of the menu item, turning it into a link.\n\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\n * - `externalIconAriaLabel` (string) - Adds an `aria-label` to the external icon.\n\n * - `iconName` (string) - (Optional) Specifies the name of the icon, used with the [icon component](/components/icon/).\n\n * - `iconAlt` (string) - (Optional) Specifies alternate text for the icon when using `iconUrl`.\n\n * - `iconUrl` (string) - (Optional) Specifies the URL of a custom icon.\n\n * - `iconSvg` (ReactNode) - (Optional) Custom SVG icon. Equivalent to the `svg` slot of the [icon component](/components/icon/).\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 * 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 * 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\nexport namespace ButtonDropdownProps {\n export type Variant = 'normal' | 'primary' | 'icon' | 'inline-icon';\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 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 id: string;\n text: 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 ItemGroup extends Omit<Item, 'id' | 'text'> {\n id?: string;\n text?: string;\n items: Items;\n }\n\n export type ItemOrGroup = Item | ItemGroup;\n\n export type Items = ReadonlyArray<ItemOrGroup>;\n\n export interface ItemClickDetails extends BaseNavigationDetail {\n id: string;\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 = (item: ButtonDropdownProps.Item, event: React.MouseEvent | React.KeyboardEvent) => void;\n\nexport interface CategoryProps extends HighlightProps {\n item: ButtonDropdownProps.ItemGroup;\n onGroupToggle: GroupToggle;\n onItemActivate: ItemActivate;\n disabled: boolean;\n expandToViewport?: boolean;\n variant?: ItemListProps['variant'];\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 expandToViewport?: boolean;\n variant?: InternalButtonDropdownProps['variant'];\n}\n\nexport interface LinkItem extends ButtonDropdownProps.Item {\n href: string;\n}\n\nexport interface ItemProps {\n item: ButtonDropdownProps.Item | LinkItem;\n disabled: boolean;\n highlighted: boolean;\n onItemActivate: ItemActivate;\n highlightItem: (item: ButtonDropdownProps.ItemOrGroup) => void;\n first?: boolean;\n last: boolean;\n hasCategoryHeader: boolean;\n isKeyboardHighlighted?: boolean;\n variant?: ItemListProps['variant'];\n}\n\nexport interface InternalItem extends ButtonDropdownProps.Item {\n badge?: boolean;\n}\n\nexport interface InternalItemGroup extends Omit<ButtonDropdownProps.ItemGroup, 'items'> {\n items: InternalItems;\n}\n\nexport type InternalItems = ReadonlyArray<InternalItemOrGroup>;\n\nexport type InternalItemOrGroup = InternalItem | 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 * 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\nexport interface CustomTriggerProps {\n triggerRef: React.Ref<HTMLElement>;\n testUtilsClass: string;\n ariaLabel: string | undefined;\n disabled: boolean;\n isOpen: boolean;\n onClick: () => void;\n ariaExpanded: boolean;\n}\n"]}
@@ -191,9 +191,9 @@
191
191
  --color-background-layout-mobile-panel-0ussje:#000716;
192
192
  --color-background-layout-panel-content-t82vgh:#ffffff;
193
193
  --color-background-layout-panel-hover-n9apd3:#e9ebed;
194
- --color-background-layout-toggle-active-robi8g:#354150;
195
- --color-background-layout-toggle-default-lmdlhy:#192534;
196
- --color-background-layout-toggle-hover-ho9150:#354150;
194
+ --color-background-layout-toggle-active-aa8dko:#414d5c;
195
+ --color-background-layout-toggle-default-o2evu2:#414d5c;
196
+ --color-background-layout-toggle-hover-awem6j:#5f6b7a;
197
197
  --color-background-layout-toggle-selected-active-xfk480:#0972d3;
198
198
  --color-background-layout-toggle-selected-default-caco0q:#0972d3;
199
199
  --color-background-layout-toggle-selected-hover-kjak2q:#065299;
@@ -531,8 +531,9 @@
531
531
  --space-grid-gutter-ieqn7e:20px;
532
532
  --space-key-value-gap-0517k5:0px;
533
533
  --space-layout-content-bottom-noqzmw:40px;
534
- --space-layout-toggle-diameter-x54u6y:40px;
535
- --space-layout-toggle-padding-sgkxy2:20px;
534
+ --space-layout-content-horizontal-7l52k3:24px;
535
+ --space-layout-toggle-diameter-hb85rk:36px;
536
+ --space-layout-toggle-padding-lcu6qi:12px;
536
537
  --space-modal-content-bottom-hqahub:16px;
537
538
  --space-modal-horizontal-f89syl:20px;
538
539
  --space-option-icon-big-top-hybljv:0px;
@@ -555,7 +556,6 @@
555
556
  --space-scaled-2x-m-owtj1o:16px;
556
557
  --space-scaled-2x-l-ujnz41:20px;
557
558
  --space-scaled-2x-xl-udij7m:24px;
558
- --space-scaled-2x-xxxl-eqb3m6:40px;
559
559
  --space-scaled-none-vhzhxe:0px;
560
560
  --space-scaled-xxxs-27y4hv:2px;
561
561
  --space-scaled-xxs-7597g1:4px;
@@ -971,7 +971,7 @@
971
971
  --space-expandable-section-icon-offset-top-ekk5vc:0px;
972
972
  --space-grid-gutter-ieqn7e:16px;
973
973
  --space-layout-content-bottom-noqzmw:24px;
974
- --space-layout-toggle-padding-sgkxy2:16px;
974
+ --space-layout-content-horizontal-7l52k3:16px;
975
975
  --space-modal-content-bottom-hqahub:8px;
976
976
  --space-panel-side-right-xofg51:20px;
977
977
  --space-panel-split-top-q1pux4:16px;
@@ -981,7 +981,6 @@
981
981
  --space-scaled-2x-m-owtj1o:8px;
982
982
  --space-scaled-2x-l-ujnz41:12px;
983
983
  --space-scaled-2x-xl-udij7m:16px;
984
- --space-scaled-2x-xxxl-eqb3m6:24px;
985
984
  --space-scaled-xxxs-27y4hv:0px;
986
985
  --space-scaled-xxs-7597g1:2px;
987
986
  --space-scaled-xs-26e2du:4px;
@@ -1021,7 +1020,6 @@
1021
1020
  --space-card-vertical-m591he:12px;
1022
1021
  --space-container-header-bottom-vj01hn:4px;
1023
1022
  --space-content-header-padding-bottom-y2enua:12px;
1024
- --space-layout-toggle-padding-sgkxy2:16px;
1025
1023
  --space-panel-side-right-xofg51:20px;
1026
1024
  --space-panel-split-top-q1pux4:16px;
1027
1025
  --space-tabs-content-top-dedu0k:8px;
@@ -1,4 +1,4 @@
1
1
  export var PACKAGE_SOURCE = "components";
2
- export var PACKAGE_VERSION = "3.0.0 (c17dd790)";
2
+ export var PACKAGE_VERSION = "3.0.0 (4803ce12)";
3
3
  export var THEME = "open-source-visual-refresh";
4
4
  export var ALWAYS_VISUAL_REFRESH = true;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "PACKAGE_SOURCE": "components",
3
- "PACKAGE_VERSION": "3.0.0 (c17dd790)",
3
+ "PACKAGE_VERSION": "3.0.0 (4803ce12)",
4
4
  "THEME": "default",
5
5
  "ALWAYS_VISUAL_REFRESH": false
6
6
  }
@@ -174,9 +174,9 @@ export var colorBackgroundInputDefault = "var(--color-background-input-default-i
174
174
  export var colorBackgroundInputDisabled = "var(--color-background-input-disabled-ab59a3, #e9ebed)";
175
175
  export var colorBackgroundItemSelected = "var(--color-background-item-selected-7tr5e4, #f2f8fd)";
176
176
  export var colorBackgroundLayoutMain = "var(--color-background-layout-main-nx09lr, #ffffff)";
177
- export var colorBackgroundLayoutToggleActive = "var(--color-background-layout-toggle-active-robi8g, #354150)";
178
- export var colorBackgroundLayoutToggleDefault = "var(--color-background-layout-toggle-default-lmdlhy, #192534)";
179
- export var colorBackgroundLayoutToggleHover = "var(--color-background-layout-toggle-hover-ho9150, #354150)";
177
+ export var colorBackgroundLayoutToggleActive = "var(--color-background-layout-toggle-active-aa8dko, #414d5c)";
178
+ export var colorBackgroundLayoutToggleDefault = "var(--color-background-layout-toggle-default-o2evu2, #414d5c)";
179
+ export var colorBackgroundLayoutToggleHover = "var(--color-background-layout-toggle-hover-awem6j, #5f6b7a)";
180
180
  export var colorBackgroundLayoutToggleSelectedActive = "var(--color-background-layout-toggle-selected-active-xfk480, #0972d3)";
181
181
  export var colorBackgroundLayoutToggleSelectedDefault = "var(--color-background-layout-toggle-selected-default-caco0q, #0972d3)";
182
182
  export var colorBackgroundLayoutToggleSelectedHover = "var(--color-background-layout-toggle-selected-hover-kjak2q, #065299)";