@cloudscape-design/components 3.0.365 → 3.0.367

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 (100) hide show
  1. package/app-layout/defaults.d.ts +1 -2
  2. package/app-layout/defaults.d.ts.map +1 -1
  3. package/app-layout/defaults.js.map +1 -1
  4. package/app-layout/drawer/drawers-helpers.d.ts +7 -0
  5. package/app-layout/drawer/drawers-helpers.d.ts.map +1 -0
  6. package/app-layout/drawer/drawers-helpers.js +24 -0
  7. package/app-layout/drawer/drawers-helpers.js.map +1 -0
  8. package/app-layout/drawer/index.d.ts +1 -1
  9. package/app-layout/drawer/index.d.ts.map +1 -1
  10. package/app-layout/drawer/index.js +41 -18
  11. package/app-layout/drawer/index.js.map +1 -1
  12. package/app-layout/drawer/interfaces.d.ts +8 -3
  13. package/app-layout/drawer/interfaces.d.ts.map +1 -1
  14. package/app-layout/drawer/interfaces.js.map +1 -1
  15. package/app-layout/drawer/overflow-menu.d.ts +13 -0
  16. package/app-layout/drawer/overflow-menu.d.ts.map +1 -0
  17. package/app-layout/drawer/overflow-menu.js +17 -0
  18. package/app-layout/drawer/overflow-menu.js.map +1 -0
  19. package/app-layout/drawer/resizable-drawer.d.ts.map +1 -1
  20. package/app-layout/drawer/resizable-drawer.js +6 -2
  21. package/app-layout/drawer/resizable-drawer.js.map +1 -1
  22. package/app-layout/index.d.ts.map +1 -1
  23. package/app-layout/index.js +46 -124
  24. package/app-layout/index.js.map +1 -1
  25. package/app-layout/mobile-toolbar/index.d.ts +1 -0
  26. package/app-layout/mobile-toolbar/index.d.ts.map +1 -1
  27. package/app-layout/mobile-toolbar/index.js +15 -5
  28. package/app-layout/mobile-toolbar/index.js.map +1 -1
  29. package/app-layout/toggles/index.js +2 -2
  30. package/app-layout/toggles/index.js.map +1 -1
  31. package/app-layout/toggles/interfaces.d.ts +1 -0
  32. package/app-layout/toggles/interfaces.d.ts.map +1 -1
  33. package/app-layout/toggles/interfaces.js.map +1 -1
  34. package/app-layout/utils/use-drawers.d.ts +29 -0
  35. package/app-layout/utils/use-drawers.d.ts.map +1 -0
  36. package/app-layout/utils/use-drawers.js +87 -0
  37. package/app-layout/utils/use-drawers.js.map +1 -0
  38. package/app-layout/utils/use-resize.d.ts +8 -4
  39. package/app-layout/utils/use-resize.d.ts.map +1 -1
  40. package/app-layout/utils/use-resize.js +5 -37
  41. package/app-layout/utils/use-resize.js.map +1 -1
  42. package/app-layout/visual-refresh/context.d.ts +6 -4
  43. package/app-layout/visual-refresh/context.d.ts.map +1 -1
  44. package/app-layout/visual-refresh/context.js +20 -38
  45. package/app-layout/visual-refresh/context.js.map +1 -1
  46. package/app-layout/visual-refresh/drawers.d.ts.map +1 -1
  47. package/app-layout/visual-refresh/drawers.js +50 -25
  48. package/app-layout/visual-refresh/drawers.js.map +1 -1
  49. package/app-layout/visual-refresh/mobile-toolbar.js +2 -2
  50. package/app-layout/visual-refresh/mobile-toolbar.js.map +1 -1
  51. package/app-layout/visual-refresh/split-panel.js +1 -1
  52. package/app-layout/visual-refresh/split-panel.js.map +1 -1
  53. package/app-layout/visual-refresh/styles.css.js +74 -69
  54. package/app-layout/visual-refresh/styles.scoped.css +197 -167
  55. package/app-layout/visual-refresh/styles.selectors.js +74 -69
  56. package/app-layout/visual-refresh/tools.js +1 -1
  57. package/app-layout/visual-refresh/tools.js.map +1 -1
  58. package/app-layout/visual-refresh/trigger-button.d.ts +1 -0
  59. package/app-layout/visual-refresh/trigger-button.d.ts.map +1 -1
  60. package/app-layout/visual-refresh/trigger-button.js +8 -5
  61. package/app-layout/visual-refresh/trigger-button.js.map +1 -1
  62. package/button/icon-helper.d.ts +1 -0
  63. package/button/icon-helper.d.ts.map +1 -1
  64. package/button/icon-helper.js +2 -2
  65. package/button/icon-helper.js.map +1 -1
  66. package/button/internal.d.ts +2 -0
  67. package/button/internal.d.ts.map +1 -1
  68. package/button/internal.js +2 -1
  69. package/button/internal.js.map +1 -1
  70. package/button-dropdown/interfaces.d.ts +10 -1
  71. package/button-dropdown/interfaces.d.ts.map +1 -1
  72. package/button-dropdown/interfaces.js.map +1 -1
  73. package/button-dropdown/internal.d.ts.map +1 -1
  74. package/button-dropdown/internal.js +15 -1
  75. package/button-dropdown/internal.js.map +1 -1
  76. package/button-dropdown/item-element/index.d.ts +4 -0
  77. package/button-dropdown/item-element/index.d.ts.map +1 -1
  78. package/button-dropdown/item-element/index.js +1 -1
  79. package/button-dropdown/item-element/index.js.map +1 -1
  80. package/icon/styles.css.js +21 -21
  81. package/icon/styles.scoped.css +54 -54
  82. package/icon/styles.selectors.js +21 -21
  83. package/internal/base-component/styles.scoped.css +5 -0
  84. package/internal/environment.js +1 -1
  85. package/internal/environment.json +1 -1
  86. package/internal/generated/theming/index.cjs +31 -0
  87. package/internal/generated/theming/index.js +31 -0
  88. package/internal/manifest.json +1 -1
  89. package/package.json +1 -1
  90. package/popover/interfaces.d.ts +4 -0
  91. package/popover/interfaces.d.ts.map +1 -1
  92. package/popover/interfaces.js.map +1 -1
  93. package/popover/internal.js +2 -2
  94. package/popover/internal.js.map +1 -1
  95. package/property-filter/index.d.ts.map +1 -1
  96. package/property-filter/index.js +2 -1
  97. package/property-filter/index.js.map +1 -1
  98. package/property-filter/styles.css.js +30 -29
  99. package/property-filter/styles.scoped.css +38 -32
  100. package/property-filter/styles.selectors.js +30 -29
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js","sourceRoot":"lib/default/","sources":["button-dropdown/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,QAAQ,MA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,CACU,CACL,CACP,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,sBAAsB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef } from 'react';\nimport clsx from 'clsx';\nimport styles from './styles.css.js';\nimport { ButtonDropdownProps, InternalButtonDropdownProps } from './interfaces';\nimport { getBaseProps } from '../internal/base-component';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport Dropdown from '../internal/components/dropdown';\nimport ItemsList from './items-list';\nimport { useButtonDropdown } from './utils/use-button-dropdown';\nimport OptionsList from '../internal/components/options-list';\nimport { InternalButton, InternalButtonProps } from '../button/internal';\nimport { ButtonProps } from '../button/interfaces';\nimport { useMobile } from '../internal/hooks/use-mobile';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport InternalBox from '../box/internal';\nimport { checkSafeUrl } from '../internal/utils/check-safe-url';\nimport { isDevelopment } from '../internal/is-development';\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode/index.js';\nimport { useFunnel } from '../internal/analytics/hooks/use-funnel.js';\n\nconst InternalButtonDropdown = React.forwardRef(\n (\n {\n items,\n variant = 'normal',\n loading = false,\n loadingText,\n disabled = false,\n expandableGroups = false,\n children,\n onItemClick,\n onItemFollow,\n customTriggerBuilder,\n expandToViewport,\n ariaLabel,\n title,\n description,\n preferCenter,\n mainAction,\n __internalRootRef,\n ...props\n }: InternalButtonDropdownProps,\n ref: React.Ref<ButtonDropdownProps.Ref>\n ) => {\n const isInRestrictedView = useMobile();\n const dropdownId = useUniqueId('dropdown');\n for (const item of items) {\n checkSafeUrl('ButtonDropdown', item.href);\n }\n if (mainAction) {\n checkSafeUrl('ButtonDropdown', mainAction.href);\n }\n\n if (isDevelopment) {\n if (mainAction && variant !== 'primary') {\n warnOnce('ButtonDropdown', 'Main action is only supported for \"primary\" component variant.');\n }\n }\n const isMainAction = mainAction && variant === 'primary';\n const isVisualRefresh = useVisualRefresh();\n\n const {\n isOpen,\n targetItem,\n isHighlighted,\n isKeyboardHighlight,\n isExpanded,\n highlightItem,\n onKeyDown,\n onKeyUp,\n onItemActivate,\n onGroupToggle,\n toggleDropdown,\n closeDropdown,\n setIsUsingMouse,\n } = useButtonDropdown({\n items,\n onItemClick,\n onItemFollow,\n onReturnFocus: () => triggerRef.current?.focus(),\n expandToViewport,\n hasExpandableGroups: expandableGroups,\n isInRestrictedView,\n });\n\n const handleMouseEvent = () => {\n setIsUsingMouse(true);\n };\n\n const baseProps = getBaseProps(props);\n\n const mainActionRef = useRef<HTMLElement>(null);\n const triggerRef = useRef<HTMLElement>(null);\n\n useForwardFocus(ref, isMainAction ? mainActionRef : triggerRef);\n\n const clickHandler = () => {\n if (!loading && !disabled) {\n // Prevent moving highlight on mobiles to avoid disabled state reason popup if defined.\n toggleDropdown({ moveHighlightOnOpen: !isInRestrictedView });\n }\n };\n\n const canBeOpened = !loading && !disabled;\n\n const triggerVariant = variant === 'navigation' ? undefined : variant === 'inline-icon' ? 'inline-icon' : variant;\n const iconProps: Partial<ButtonProps & { __iconClass?: string }> =\n variant === 'icon' || variant === 'inline-icon'\n ? {\n iconName: 'ellipsis',\n }\n : {\n iconName: 'caret-down-filled',\n iconAlign: 'right',\n __iconClass: canBeOpened && isOpen ? styles['rotate-up'] : styles['rotate-down'],\n };\n\n const baseTriggerProps: InternalButtonProps = {\n className: clsx(styles['trigger-button'], styles['test-utils-button-trigger']),\n ...iconProps,\n variant: triggerVariant,\n loading,\n loadingText,\n disabled,\n onClick: (event: Event) => {\n event.preventDefault();\n clickHandler();\n },\n ariaLabel,\n ariaExpanded: canBeOpened && isOpen,\n formAction: 'none',\n __nativeAttributes: {\n 'aria-haspopup': true,\n },\n };\n\n let trigger: React.ReactNode = null;\n if (customTriggerBuilder) {\n trigger = (\n <div className={styles['dropdown-trigger']}>\n {customTriggerBuilder({\n testUtilsClass: styles['test-utils-button-trigger'],\n onClick: clickHandler,\n triggerRef,\n ariaLabel,\n disabled,\n isOpen,\n })}\n </div>\n );\n } else if (isMainAction) {\n const { text, iconName, iconAlt, iconSvg, iconUrl, external, externalIconAriaLabel, ...mainActionProps } =\n mainAction;\n const mainActionIconProps = external\n ? ({ iconName: 'external', iconAlign: 'right' } as const)\n : ({ iconName, iconAlt, iconSvg, iconUrl } as const);\n const mainActionAriaLabel = externalIconAriaLabel\n ? `${mainAction.ariaLabel ?? mainAction.text} ${mainAction.externalIconAriaLabel}`\n : undefined;\n\n trigger = (\n <div role=\"group\" aria-label={ariaLabel} className={styles['split-trigger-wrapper']}>\n <div\n className={clsx(styles['trigger-item'], styles['split-trigger'])}\n // Close dropdown upon main action click unless event is cancelled.\n onClick={closeDropdown}\n // Prevent keyboard events from propagation to the button dropdown handler.\n onKeyDown={e => e.stopPropagation()}\n onKeyUp={e => e.stopPropagation()}\n >\n <InternalButton\n ref={mainActionRef}\n {...mainActionProps}\n {...mainActionIconProps}\n className={styles['trigger-button']}\n variant=\"primary\"\n ariaLabel={mainActionAriaLabel}\n formAction=\"none\"\n >\n {text}\n </InternalButton>\n </div>\n <div\n className={clsx(\n styles['trigger-item'],\n styles['dropdown-trigger'],\n isVisualRefresh && styles['visual-refresh']\n )}\n >\n <InternalButton ref={triggerRef} {...baseTriggerProps} />\n </div>\n </div>\n );\n } else {\n trigger = (\n <div className={styles['dropdown-trigger']}>\n <InternalButton ref={triggerRef} {...baseTriggerProps}>\n {children}\n </InternalButton>\n </div>\n );\n }\n\n const hasHeader = title || description;\n const headerId = useUniqueId('awsui-button-dropdown__header');\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 return (\n <div\n {...baseProps}\n onKeyDown={onKeyDown}\n onKeyUp={onKeyUp}\n onMouseDown={handleMouseEvent}\n onMouseMove={handleMouseEvent}\n className={clsx(styles['button-dropdown'], styles[`variant-${variant}`], baseProps.className)}\n aria-owns={expandToViewport && isOpen ? dropdownId : undefined}\n ref={__internalRootRef}\n >\n <Dropdown\n open={canBeOpened && isOpen}\n stretchWidth={false}\n stretchTriggerHeight={variant === 'navigation'}\n expandToViewport={expandToViewport}\n preferCenter={preferCenter}\n onDropdownClose={() => toggleDropdown()}\n trigger={trigger}\n dropdownId={dropdownId}\n >\n {hasHeader && (\n <div className={styles.header} id={headerId}>\n {title && (\n <div className={styles.title}>\n <InternalBox\n fontSize=\"heading-s\"\n fontWeight=\"bold\"\n color=\"inherit\"\n tagOverride=\"h2\"\n margin={{ vertical: 'n', horizontal: 'n' }}\n >\n {title}\n </InternalBox>\n </div>\n )}\n {description && (\n <InternalBox fontSize=\"body-s\">\n <span className={styles.description}>{description}</span>\n </InternalBox>\n )}\n </div>\n )}\n <OptionsList\n open={canBeOpened && isOpen}\n position=\"static\"\n role=\"menu\"\n decreaseTopMargin={true}\n ariaLabelledby={hasHeader ? headerId : undefined}\n statusType=\"finished\"\n >\n <ItemsList\n items={items}\n onItemActivate={onItemActivate}\n onGroupToggle={onGroupToggle}\n hasExpandableGroups={expandableGroups}\n targetItem={targetItem}\n isHighlighted={isHighlighted}\n isKeyboardHighlight={isKeyboardHighlight}\n isExpanded={isExpanded}\n highlightItem={highlightItem}\n expandToViewport={expandToViewport}\n variant={variant}\n />\n </OptionsList>\n </Dropdown>\n </div>\n );\n }\n);\n\nexport default InternalButtonDropdown;\n"]}
1
+ {"version":3,"file":"internal.js","sourceRoot":"lib/default/","sources":["button-dropdown/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,OAAO,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AC,QAAQ;oBAC5B,8BAAM,SAAS,EAAE,MAAM,CAAC,WAAW,IAAG,WAAW,CAAQ,CAC7C,CACf,CACG,CACP;YACD,oBAAC,WAAW,IACV,IAAI,EAAE,WAAW,IAAI,MAAM,EAC3B,QAAQ,EAAC,QAAQ,EACjB,IAAI,EAAC,MAAM,EACX,iBAAiB,EAAE,IAAI,EACvB,cAAc,EAAE,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,EAChD,UAAU,EAAC,UAAU;gBAErB,oBAAC,SAAS,IACR,KAAK,EAAE,KAAK,EACZ,cAAc,EAAE,cAAc,EAC9B,aAAa,EAAE,aAAa,EAC5B,mBAAmB,EAAE,gBAAgB,EACrC,UAAU,EAAE,UAAU,EACtB,aAAa,EAAE,aAAa,EAC5B,mBAAmB,EAAE,mBAAmB,EACxC,UAAU,EAAE,UAAU,EACtB,aAAa,EAAE,aAAa,EAC5B,gBAAgB,EAAE,gBAAgB,EAClC,OAAO,EAAE,OAAO,GAChB,CACU,CACL,CACP,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,sBAAsB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef } from 'react';\nimport clsx from 'clsx';\nimport styles from './styles.css.js';\nimport { ButtonDropdownProps, InternalButtonDropdownProps } from './interfaces';\nimport { getBaseProps } from '../internal/base-component';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport Dropdown from '../internal/components/dropdown';\nimport ItemsList from './items-list';\nimport { useButtonDropdown } from './utils/use-button-dropdown';\nimport OptionsList from '../internal/components/options-list';\nimport { InternalButton, InternalButtonProps } from '../button/internal';\nimport { ButtonProps } from '../button/interfaces';\nimport { useMobile } from '../internal/hooks/use-mobile';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport InternalBox from '../box/internal';\nimport { checkSafeUrl } from '../internal/utils/check-safe-url';\nimport { isDevelopment } from '../internal/is-development';\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode/index.js';\nimport { useFunnel } from '../internal/analytics/hooks/use-funnel.js';\n\nconst InternalButtonDropdown = React.forwardRef(\n (\n {\n items,\n variant = 'normal',\n loading = false,\n loadingText,\n disabled = false,\n expandableGroups = false,\n children,\n onItemClick,\n onItemFollow,\n customTriggerBuilder,\n expandToViewport,\n ariaLabel,\n title,\n description,\n preferCenter,\n mainAction,\n __internalRootRef,\n ...props\n }: InternalButtonDropdownProps,\n ref: React.Ref<ButtonDropdownProps.Ref>\n ) => {\n const isInRestrictedView = useMobile();\n const dropdownId = useUniqueId('dropdown');\n for (const item of items) {\n checkSafeUrl('ButtonDropdown', item.href);\n }\n if (mainAction) {\n checkSafeUrl('ButtonDropdown', mainAction.href);\n }\n\n if (isDevelopment) {\n if (mainAction && variant !== 'primary') {\n warnOnce('ButtonDropdown', 'Main action is only supported for \"primary\" component variant.');\n }\n }\n const isMainAction = mainAction && variant === 'primary';\n const isVisualRefresh = useVisualRefresh();\n\n const {\n isOpen,\n targetItem,\n isHighlighted,\n isKeyboardHighlight,\n isExpanded,\n highlightItem,\n onKeyDown,\n onKeyUp,\n onItemActivate,\n onGroupToggle,\n toggleDropdown,\n closeDropdown,\n setIsUsingMouse,\n } = useButtonDropdown({\n items,\n onItemClick,\n onItemFollow,\n onReturnFocus: () => triggerRef.current?.focus(),\n expandToViewport,\n hasExpandableGroups: expandableGroups,\n isInRestrictedView,\n });\n\n const handleMouseEvent = () => {\n setIsUsingMouse(true);\n };\n\n const baseProps = getBaseProps(props);\n\n const mainActionRef = useRef<HTMLElement>(null);\n const triggerRef = useRef<HTMLElement>(null);\n\n useForwardFocus(ref, isMainAction ? mainActionRef : triggerRef);\n\n const clickHandler = () => {\n if (!loading && !disabled) {\n // Prevent moving highlight on mobiles to avoid disabled state reason popup if defined.\n toggleDropdown({ moveHighlightOnOpen: !isInRestrictedView });\n }\n };\n\n const canBeOpened = !loading && !disabled;\n\n const triggerVariant = variant === 'navigation' ? undefined : variant === 'inline-icon' ? 'inline-icon' : variant;\n const iconProps: Partial<ButtonProps & { __iconClass?: string }> =\n variant === 'icon' || variant === 'inline-icon'\n ? {\n iconName: 'ellipsis',\n }\n : {\n iconName: 'caret-down-filled',\n iconAlign: 'right',\n __iconClass: canBeOpened && isOpen ? styles['rotate-up'] : styles['rotate-down'],\n };\n\n const baseTriggerProps: InternalButtonProps = {\n className: clsx(styles['trigger-button'], styles['test-utils-button-trigger']),\n ...iconProps,\n variant: triggerVariant,\n loading,\n loadingText,\n disabled,\n onClick: (event: Event) => {\n event.preventDefault();\n clickHandler();\n },\n ariaLabel,\n ariaExpanded: canBeOpened && isOpen,\n formAction: 'none',\n __nativeAttributes: {\n 'aria-haspopup': true,\n },\n };\n\n const triggerHasBadge = () => {\n const flatItems = items.flatMap(item => {\n if ('items' in item) {\n return item.items;\n }\n return item;\n });\n\n return (\n variant === 'icon' &&\n !!flatItems?.find(item => {\n if ('badge' in item) {\n return item.badge;\n }\n })\n );\n };\n\n let trigger: React.ReactNode = null;\n if (customTriggerBuilder) {\n trigger = (\n <div className={styles['dropdown-trigger']}>\n {customTriggerBuilder({\n testUtilsClass: styles['test-utils-button-trigger'],\n onClick: clickHandler,\n triggerRef,\n ariaLabel,\n disabled,\n isOpen,\n })}\n </div>\n );\n } else if (isMainAction) {\n const { text, iconName, iconAlt, iconSvg, iconUrl, external, externalIconAriaLabel, ...mainActionProps } =\n mainAction;\n const mainActionIconProps = external\n ? ({ iconName: 'external', iconAlign: 'right' } as const)\n : ({ iconName, iconAlt, iconSvg, iconUrl } as const);\n const mainActionAriaLabel = externalIconAriaLabel\n ? `${mainAction.ariaLabel ?? mainAction.text} ${mainAction.externalIconAriaLabel}`\n : undefined;\n\n trigger = (\n <div role=\"group\" aria-label={ariaLabel} className={styles['split-trigger-wrapper']}>\n <div\n className={clsx(styles['trigger-item'], styles['split-trigger'])}\n // Close dropdown upon main action click unless event is cancelled.\n onClick={closeDropdown}\n // Prevent keyboard events from propagation to the button dropdown handler.\n onKeyDown={e => e.stopPropagation()}\n onKeyUp={e => e.stopPropagation()}\n >\n <InternalButton\n ref={mainActionRef}\n {...mainActionProps}\n {...mainActionIconProps}\n className={styles['trigger-button']}\n variant=\"primary\"\n ariaLabel={mainActionAriaLabel}\n formAction=\"none\"\n >\n {text}\n </InternalButton>\n </div>\n <div\n className={clsx(\n styles['trigger-item'],\n styles['dropdown-trigger'],\n isVisualRefresh && styles['visual-refresh']\n )}\n >\n <InternalButton ref={triggerRef} {...baseTriggerProps} />\n </div>\n </div>\n );\n } else {\n trigger = (\n <div className={styles['dropdown-trigger']}>\n <InternalButton ref={triggerRef} {...baseTriggerProps} badge={triggerHasBadge()}>\n {children}\n </InternalButton>\n </div>\n );\n }\n\n const hasHeader = title || description;\n const headerId = useUniqueId('awsui-button-dropdown__header');\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 return (\n <div\n {...baseProps}\n onKeyDown={onKeyDown}\n onKeyUp={onKeyUp}\n onMouseDown={handleMouseEvent}\n onMouseMove={handleMouseEvent}\n className={clsx(styles['button-dropdown'], styles[`variant-${variant}`], baseProps.className)}\n aria-owns={expandToViewport && isOpen ? dropdownId : undefined}\n ref={__internalRootRef}\n >\n <Dropdown\n open={canBeOpened && isOpen}\n stretchWidth={false}\n stretchTriggerHeight={variant === 'navigation'}\n expandToViewport={expandToViewport}\n preferCenter={preferCenter}\n onDropdownClose={() => toggleDropdown()}\n trigger={trigger}\n dropdownId={dropdownId}\n >\n {hasHeader && (\n <div className={styles.header} id={headerId}>\n {title && (\n <div className={styles.title}>\n <InternalBox\n fontSize=\"heading-s\"\n fontWeight=\"bold\"\n color=\"inherit\"\n tagOverride=\"h2\"\n margin={{ vertical: 'n', horizontal: 'n' }}\n >\n {title}\n </InternalBox>\n </div>\n )}\n {description && (\n <InternalBox fontSize=\"body-s\">\n <span className={styles.description}>{description}</span>\n </InternalBox>\n )}\n </div>\n )}\n <OptionsList\n open={canBeOpened && isOpen}\n position=\"static\"\n role=\"menu\"\n decreaseTopMargin={true}\n ariaLabelledby={hasHeader ? headerId : undefined}\n statusType=\"finished\"\n >\n <ItemsList\n items={items}\n onItemActivate={onItemActivate}\n onGroupToggle={onGroupToggle}\n hasExpandableGroups={expandableGroups}\n targetItem={targetItem}\n isHighlighted={isHighlighted}\n isKeyboardHighlight={isKeyboardHighlight}\n isExpanded={isExpanded}\n highlightItem={highlightItem}\n expandToViewport={expandToViewport}\n variant={variant}\n />\n </OptionsList>\n </Dropdown>\n </div>\n );\n }\n);\n\nexport default InternalButtonDropdown;\n"]}
@@ -1,5 +1,9 @@
1
1
  /// <reference types="react" />
2
2
  import { ItemProps } from '../interfaces';
3
+ import { ButtonDropdownProps } from '../interfaces';
3
4
  declare const ItemElement: ({ item, disabled, onItemActivate, highlighted, highlightItem, first, last, hasCategoryHeader, isKeyboardHighlighted, variant, }: ItemProps) => JSX.Element;
5
+ export type InternalItemProps = ButtonDropdownProps.Item & {
6
+ badge?: boolean;
7
+ };
4
8
  export default ItemElement;
5
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["button-dropdown/item-element/index.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAY1C,QAAA,MAAM,WAAW,oIAWd,SAAS,gBAuCX,CAAC;AAoFF,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["button-dropdown/item-element/index.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAK1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAOpD,QAAA,MAAM,WAAW,oIAWd,SAAS,gBAuCX,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,mBAAmB,CAAC,IAAI,GAAG;IACzD,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AA4FF,eAAe,WAAW,CAAC"}
@@ -64,7 +64,7 @@ const MenuItemContent = ({ item, disabled }) => {
64
64
  const hasIcon = !!(item.iconName || item.iconUrl || item.iconSvg);
65
65
  const hasExternal = isLinkItem(item) && item.external;
66
66
  return (React.createElement(React.Fragment, null,
67
- hasIcon && React.createElement(MenuItemIcon, { name: item.iconName, url: item.iconUrl, svg: item.iconSvg, alt: item.iconAlt }),
67
+ hasIcon && (React.createElement(MenuItemIcon, { name: item.iconName, url: item.iconUrl, svg: item.iconSvg, alt: item.iconAlt, badge: item.badge })),
68
68
  ' ',
69
69
  item.text,
70
70
  " ",
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["button-dropdown/item-element/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,OAAO,MAAM,YAAY,CAAC;AAGjC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,oBAAoB,MAAM,iCAAiC,CAAC;AACnE,OAAO,YAAmC,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AAChF,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,MAAM,WAAW,GAAG,CAAC,EACnB,IAAI,EACJ,QAAQ,EACR,cAAc,EAC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CAAC,qBAAqB,GAAI,CACtG,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,KAAwB,EAAE,EAAE,CAAC,CACjD,8BAAM,SAAS,EAAE,MAAM,CAAC,IAAI;IAC1B,oBAAC,YAAY,oBAAK,KAAK,EAAI,CACtB,CACR,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,EAAE,QAAQ,EAAE,SAAS,EAA6C,EAAE,EAAE;IAC1F,MAAM,IAAI,GAAG,oBAAC,YAAY,IAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,EAAE,IAAI,EAAC,UAAU,GAAG,CAAC;IACzF,OAAO,CACL,8BAAM,SAAS,EAAE,MAAM,CAAC,eAAe,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,gBAAc,SAAS,IACjG,IAAI,CACA,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef } from 'react';\nimport clsx from 'clsx';\nimport { ItemProps } from '../interfaces';\nimport { isLinkItem } from '../utils/utils';\nimport styles from './styles.css.js';\nimport Tooltip from '../tooltip';\n\nimport { ButtonDropdownProps } from '../interfaces';\nimport { getItemTarget } from '../utils/utils';\nimport useHiddenDescription from '../utils/use-hidden-description';\nimport InternalIcon, { InternalIconProps } from '../../icon/internal';\nimport { useDropdownContext } from '../../internal/components/dropdown/context';\nimport { getMenuItemProps } from '../utils/menu-item';\n\nconst ItemElement = ({\n item,\n disabled,\n onItemActivate,\n highlighted,\n highlightItem,\n first = false,\n last,\n hasCategoryHeader,\n isKeyboardHighlighted = false,\n variant = 'normal',\n}: ItemProps) => {\n const isLink = isLinkItem(item);\n const onClick = (event: React.MouseEvent) => {\n // Stop propagation to parent node and handle event exclusively in here. This ensures\n // that no group will interfere with the default behavior of links\n event.stopPropagation();\n if (!isLink) {\n event.preventDefault();\n }\n if (!disabled) {\n onItemActivate(item, event);\n }\n };\n\n const onHover = (event: React.SyntheticEvent) => {\n event.preventDefault();\n highlightItem(item);\n };\n\n return (\n <li\n className={clsx(styles['item-element'], styles[`variant-${variant}`], {\n [styles.highlighted]: highlighted,\n [styles.disabled]: disabled,\n [styles.first]: first,\n [styles.last]: last,\n [styles['has-category-header']]: hasCategoryHeader,\n [styles['is-focused']]: isKeyboardHighlighted,\n })}\n role=\"presentation\"\n data-testid={item.id}\n data-description={item.description}\n onClick={onClick}\n onMouseEnter={onHover}\n onTouchStart={onHover}\n >\n <MenuItem item={item} disabled={disabled} highlighted={highlighted} />\n </li>\n );\n};\n\ninterface MenuItemProps {\n item: ButtonDropdownProps.Item;\n disabled: boolean;\n highlighted: boolean;\n}\n\nfunction MenuItem({ item, disabled, highlighted }: MenuItemProps) {\n const menuItemRef = useRef<(HTMLSpanElement & HTMLAnchorElement) | null>(null);\n\n useEffect(() => {\n if (highlighted && menuItemRef.current) {\n menuItemRef.current.focus();\n }\n }, [highlighted]);\n\n const isDisabledWithReason = disabled && item.disabledReason;\n const { targetProps, descriptionEl } = useHiddenDescription(item.disabledReason);\n const menuItemProps: React.HTMLAttributes<HTMLSpanElement & HTMLAnchorElement> = {\n className: styles['menu-item'],\n lang: item.lang,\n ref: menuItemRef,\n // We are using the roving tabindex technique to manage the focus state of the dropdown.\n // The current element will always have tabindex=0 which means that it can be tabbed to,\n // while all other items have tabindex=-1 so we can focus them when necessary.\n tabIndex: highlighted ? 0 : -1,\n ...getMenuItemProps({ disabled }),\n ...(isDisabledWithReason ? targetProps : {}),\n };\n\n const menuItem = isLinkItem(item) ? (\n <a\n {...menuItemProps}\n href={!disabled ? item.href : undefined}\n target={getItemTarget(item)}\n rel={item.external ? 'noopener noreferrer' : undefined}\n >\n <MenuItemContent item={item} disabled={disabled} />\n </a>\n ) : (\n <span {...menuItemProps}>\n <MenuItemContent item={item} disabled={disabled} />\n </span>\n );\n\n const { position } = useDropdownContext();\n const tooltipPosition = position === 'bottom-left' || position === 'top-left' ? 'left' : 'right';\n return isDisabledWithReason ? (\n <Tooltip content={item.disabledReason} position={tooltipPosition}>\n {menuItem}\n {descriptionEl}\n </Tooltip>\n ) : (\n menuItem\n );\n}\n\nconst MenuItemContent = ({ item, disabled }: { item: ButtonDropdownProps.Item; disabled: boolean }) => {\n const hasIcon = !!(item.iconName || item.iconUrl || item.iconSvg);\n const hasExternal = isLinkItem(item) && item.external;\n return (\n <>\n {hasIcon && <MenuItemIcon name={item.iconName} url={item.iconUrl} svg={item.iconSvg} alt={item.iconAlt} />}{' '}\n {item.text} {hasExternal && <ExternalIcon disabled={disabled} ariaLabel={item.externalIconAriaLabel} />}\n </>\n );\n};\n\nconst MenuItemIcon = (props: InternalIconProps) => (\n <span className={styles.icon}>\n <InternalIcon {...props} />\n </span>\n);\n\nconst ExternalIcon = ({ disabled, ariaLabel }: { disabled: boolean; ariaLabel?: string }) => {\n const icon = <InternalIcon variant={disabled ? 'disabled' : 'normal'} name=\"external\" />;\n return (\n <span className={styles['external-icon']} role={ariaLabel ? 'img' : undefined} aria-label={ariaLabel}>\n {icon}\n </span>\n );\n};\n\nexport default ItemElement;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["button-dropdown/item-element/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,OAAO,MAAM,YAAY,CAAC;AAGjC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,oBAAoB,MA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Q,EACnB,GAAG,EAAE,IAAI,CAAC,OAAO,EACjB,GAAG,EAAE,IAAI,CAAC,OAAO,EACjB,GAAG,EAAE,IAAI,CAAC,OAAO,EACjB,KAAK,EAAE,IAAI,CAAC,KAAK,GACjB,CACH;QAAE,GAAG;QACL,IAAI,CAAC,IAAI;;QAAG,WAAW,IAAI,oBAAC,YAAY,IAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,CAAC,qBAAqB,GAAI,CACtG,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,KAAwB,EAAE,EAAE,CAAC,CACjD,8BAAM,SAAS,EAAE,MAAM,CAAC,IAAI;IAC1B,oBAAC,YAAY,oBAAK,KAAK,EAAI,CACtB,CACR,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,EAAE,QAAQ,EAAE,SAAS,EAA6C,EAAE,EAAE;IAC1F,MAAM,IAAI,GAAG,oBAAC,YAAY,IAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,EAAE,IAAI,EAAC,UAAU,GAAG,CAAC;IACzF,OAAO,CACL,8BAAM,SAAS,EAAE,MAAM,CAAC,eAAe,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,gBAAc,SAAS,IACjG,IAAI,CACA,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef } from 'react';\nimport clsx from 'clsx';\nimport { ItemProps } from '../interfaces';\nimport { isLinkItem } from '../utils/utils';\nimport styles from './styles.css.js';\nimport Tooltip from '../tooltip';\n\nimport { ButtonDropdownProps } from '../interfaces';\nimport { getItemTarget } from '../utils/utils';\nimport useHiddenDescription from '../utils/use-hidden-description';\nimport InternalIcon, { InternalIconProps } from '../../icon/internal';\nimport { useDropdownContext } from '../../internal/components/dropdown/context';\nimport { getMenuItemProps } from '../utils/menu-item';\n\nconst ItemElement = ({\n item,\n disabled,\n onItemActivate,\n highlighted,\n highlightItem,\n first = false,\n last,\n hasCategoryHeader,\n isKeyboardHighlighted = false,\n variant = 'normal',\n}: ItemProps) => {\n const isLink = isLinkItem(item);\n const onClick = (event: React.MouseEvent) => {\n // Stop propagation to parent node and handle event exclusively in here. This ensures\n // that no group will interfere with the default behavior of links\n event.stopPropagation();\n if (!isLink) {\n event.preventDefault();\n }\n if (!disabled) {\n onItemActivate(item, event);\n }\n };\n\n const onHover = (event: React.SyntheticEvent) => {\n event.preventDefault();\n highlightItem(item);\n };\n\n return (\n <li\n className={clsx(styles['item-element'], styles[`variant-${variant}`], {\n [styles.highlighted]: highlighted,\n [styles.disabled]: disabled,\n [styles.first]: first,\n [styles.last]: last,\n [styles['has-category-header']]: hasCategoryHeader,\n [styles['is-focused']]: isKeyboardHighlighted,\n })}\n role=\"presentation\"\n data-testid={item.id}\n data-description={item.description}\n onClick={onClick}\n onMouseEnter={onHover}\n onTouchStart={onHover}\n >\n <MenuItem item={item} disabled={disabled} highlighted={highlighted} />\n </li>\n );\n};\n\nexport type InternalItemProps = ButtonDropdownProps.Item & {\n badge?: boolean;\n};\n\ninterface MenuItemProps {\n item: InternalItemProps;\n disabled: boolean;\n highlighted: boolean;\n}\n\nfunction MenuItem({ item, disabled, highlighted }: MenuItemProps) {\n const menuItemRef = useRef<(HTMLSpanElement & HTMLAnchorElement) | null>(null);\n\n useEffect(() => {\n if (highlighted && menuItemRef.current) {\n menuItemRef.current.focus();\n }\n }, [highlighted]);\n\n const isDisabledWithReason = disabled && item.disabledReason;\n const { targetProps, descriptionEl } = useHiddenDescription(item.disabledReason);\n const menuItemProps: React.HTMLAttributes<HTMLSpanElement & HTMLAnchorElement> = {\n className: styles['menu-item'],\n lang: item.lang,\n ref: menuItemRef,\n // We are using the roving tabindex technique to manage the focus state of the dropdown.\n // The current element will always have tabindex=0 which means that it can be tabbed to,\n // while all other items have tabindex=-1 so we can focus them when necessary.\n tabIndex: highlighted ? 0 : -1,\n ...getMenuItemProps({ disabled }),\n ...(isDisabledWithReason ? targetProps : {}),\n };\n\n const menuItem = isLinkItem(item) ? (\n <a\n {...menuItemProps}\n href={!disabled ? item.href : undefined}\n target={getItemTarget(item)}\n rel={item.external ? 'noopener noreferrer' : undefined}\n >\n <MenuItemContent item={item} disabled={disabled} />\n </a>\n ) : (\n <span {...menuItemProps}>\n <MenuItemContent item={item} disabled={disabled} />\n </span>\n );\n\n const { position } = useDropdownContext();\n const tooltipPosition = position === 'bottom-left' || position === 'top-left' ? 'left' : 'right';\n return isDisabledWithReason ? (\n <Tooltip content={item.disabledReason} position={tooltipPosition}>\n {menuItem}\n {descriptionEl}\n </Tooltip>\n ) : (\n menuItem\n );\n}\n\nconst MenuItemContent = ({ item, disabled }: { item: InternalItemProps; disabled: boolean }) => {\n const hasIcon = !!(item.iconName || item.iconUrl || item.iconSvg);\n const hasExternal = isLinkItem(item) && item.external;\n return (\n <>\n {hasIcon && (\n <MenuItemIcon\n name={item.iconName}\n url={item.iconUrl}\n svg={item.iconSvg}\n alt={item.iconAlt}\n badge={item.badge}\n />\n )}{' '}\n {item.text} {hasExternal && <ExternalIcon disabled={disabled} ariaLabel={item.externalIconAriaLabel} />}\n </>\n );\n};\n\nconst MenuItemIcon = (props: InternalIconProps) => (\n <span className={styles.icon}>\n <InternalIcon {...props} />\n </span>\n);\n\nconst ExternalIcon = ({ disabled, ariaLabel }: { disabled: boolean; ariaLabel?: string }) => {\n const icon = <InternalIcon variant={disabled ? 'disabled' : 'normal'} name=\"external\" />;\n return (\n <span className={styles['external-icon']} role={ariaLabel ? 'img' : undefined} aria-label={ariaLabel}>\n {icon}\n </span>\n );\n};\n\nexport default ItemElement;\n"]}
@@ -1,26 +1,26 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "icon": "awsui_icon_h11ix_gi1za_98",
5
- "icon-flex-height": "awsui_icon-flex-height_h11ix_gi1za_104",
6
- "size-small": "awsui_size-small_h11ix_gi1za_129",
7
- "size-small-mapped-height": "awsui_size-small-mapped-height_h11ix_gi1za_133",
8
- "size-normal": "awsui_size-normal_h11ix_gi1za_147",
9
- "size-normal-mapped-height": "awsui_size-normal-mapped-height_h11ix_gi1za_151",
10
- "size-medium": "awsui_size-medium_h11ix_gi1za_165",
11
- "size-medium-mapped-height": "awsui_size-medium-mapped-height_h11ix_gi1za_169",
12
- "size-big": "awsui_size-big_h11ix_gi1za_183",
13
- "size-big-mapped-height": "awsui_size-big-mapped-height_h11ix_gi1za_187",
14
- "size-large": "awsui_size-large_h11ix_gi1za_201",
15
- "size-large-mapped-height": "awsui_size-large-mapped-height_h11ix_gi1za_205",
16
- "variant-normal": "awsui_variant-normal_h11ix_gi1za_219",
17
- "variant-disabled": "awsui_variant-disabled_h11ix_gi1za_222",
18
- "variant-inverted": "awsui_variant-inverted_h11ix_gi1za_225",
19
- "variant-subtle": "awsui_variant-subtle_h11ix_gi1za_228",
20
- "variant-warning": "awsui_variant-warning_h11ix_gi1za_231",
21
- "variant-error": "awsui_variant-error_h11ix_gi1za_234",
22
- "variant-success": "awsui_variant-success_h11ix_gi1za_237",
23
- "variant-link": "awsui_variant-link_h11ix_gi1za_240",
24
- "badge": "awsui_badge_h11ix_gi1za_244"
4
+ "icon": "awsui_icon_h11ix_9i0b9_98",
5
+ "icon-flex-height": "awsui_icon-flex-height_h11ix_9i0b9_104",
6
+ "size-small": "awsui_size-small_h11ix_9i0b9_129",
7
+ "size-small-mapped-height": "awsui_size-small-mapped-height_h11ix_9i0b9_133",
8
+ "size-normal": "awsui_size-normal_h11ix_9i0b9_147",
9
+ "size-normal-mapped-height": "awsui_size-normal-mapped-height_h11ix_9i0b9_151",
10
+ "size-medium": "awsui_size-medium_h11ix_9i0b9_165",
11
+ "size-medium-mapped-height": "awsui_size-medium-mapped-height_h11ix_9i0b9_169",
12
+ "size-big": "awsui_size-big_h11ix_9i0b9_183",
13
+ "size-big-mapped-height": "awsui_size-big-mapped-height_h11ix_9i0b9_187",
14
+ "size-large": "awsui_size-large_h11ix_9i0b9_201",
15
+ "size-large-mapped-height": "awsui_size-large-mapped-height_h11ix_9i0b9_205",
16
+ "variant-normal": "awsui_variant-normal_h11ix_9i0b9_219",
17
+ "variant-disabled": "awsui_variant-disabled_h11ix_9i0b9_222",
18
+ "variant-inverted": "awsui_variant-inverted_h11ix_9i0b9_225",
19
+ "variant-subtle": "awsui_variant-subtle_h11ix_9i0b9_228",
20
+ "variant-warning": "awsui_variant-warning_h11ix_9i0b9_231",
21
+ "variant-error": "awsui_variant-error_h11ix_9i0b9_234",
22
+ "variant-success": "awsui_variant-success_h11ix_9i0b9_237",
23
+ "variant-link": "awsui_variant-link_h11ix_9i0b9_240",
24
+ "badge": "awsui_badge_h11ix_9i0b9_244"
25
25
  };
26
26
 
@@ -95,159 +95,159 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
95
95
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
96
96
  SPDX-License-Identifier: Apache-2.0
97
97
  */
98
- .awsui_icon_h11ix_gi1za_98:not(#\9) {
98
+ .awsui_icon_h11ix_9i0b9_98:not(#\9) {
99
99
  position: relative;
100
100
  display: inline-block;
101
101
  vertical-align: top;
102
102
  /* stylelint-disable-next-line selector-max-type */
103
103
  }
104
- .awsui_icon-flex-height_h11ix_gi1za_104:not(#\9) {
104
+ .awsui_icon-flex-height_h11ix_9i0b9_104:not(#\9) {
105
105
  display: inline-flex;
106
106
  align-items: center;
107
107
  }
108
- .awsui_icon_h11ix_gi1za_98 > svg:not(#\9) {
108
+ .awsui_icon_h11ix_9i0b9_98 > svg:not(#\9) {
109
109
  pointer-events: none;
110
110
  }
111
- .awsui_icon_h11ix_gi1za_98 > svg:not(#\9) {
111
+ .awsui_icon_h11ix_9i0b9_98 > svg:not(#\9) {
112
112
  fill: none;
113
113
  }
114
- .awsui_icon_h11ix_gi1za_98 > svg *:not(#\9) {
114
+ .awsui_icon_h11ix_9i0b9_98 > svg *:not(#\9) {
115
115
  stroke: currentColor;
116
116
  }
117
- .awsui_icon_h11ix_gi1za_98 > svg .stroke-linejoin-round:not(#\9) {
117
+ .awsui_icon_h11ix_9i0b9_98 > svg .stroke-linejoin-round:not(#\9) {
118
118
  stroke-linejoin: round;
119
119
  }
120
- .awsui_icon_h11ix_gi1za_98 > svg .stroke-linecap-square:not(#\9) {
120
+ .awsui_icon_h11ix_9i0b9_98 > svg .stroke-linecap-square:not(#\9) {
121
121
  stroke-linecap: square;
122
122
  }
123
- .awsui_icon_h11ix_gi1za_98 > svg .stroke-linecap-round:not(#\9) {
123
+ .awsui_icon_h11ix_9i0b9_98 > svg .stroke-linecap-round:not(#\9) {
124
124
  stroke-linecap: round;
125
125
  }
126
- .awsui_icon_h11ix_gi1za_98 > svg .filled:not(#\9) {
126
+ .awsui_icon_h11ix_9i0b9_98 > svg .filled:not(#\9) {
127
127
  fill: currentColor;
128
128
  }
129
- .awsui_icon_h11ix_gi1za_98.awsui_size-small_h11ix_gi1za_129:not(#\9) {
129
+ .awsui_icon_h11ix_9i0b9_98.awsui_size-small_h11ix_9i0b9_129:not(#\9) {
130
130
  width: var(--size-icon-normal-0m1722, 16px);
131
131
  box-sizing: border-box;
132
132
  }
133
- .awsui_icon_h11ix_gi1za_98.awsui_size-small-mapped-height_h11ix_gi1za_133:not(#\9) {
133
+ .awsui_icon_h11ix_9i0b9_98.awsui_size-small-mapped-height_h11ix_9i0b9_133:not(#\9) {
134
134
  height: var(--font-body-s-line-height-uztvf6, 16px);
135
135
  padding: calc((var(--font-body-s-line-height-uztvf6, 16px) - var(--size-icon-normal-0m1722, 16px)) / 2) 0;
136
136
  }
137
- .awsui_icon_h11ix_gi1za_98.awsui_size-small_h11ix_gi1za_129 > svg:not(#\9),
138
- .awsui_icon_h11ix_gi1za_98.awsui_size-small_h11ix_gi1za_129 > img:not(#\9) {
137
+ .awsui_icon_h11ix_9i0b9_98.awsui_size-small_h11ix_9i0b9_129 > svg:not(#\9),
138
+ .awsui_icon_h11ix_9i0b9_98.awsui_size-small_h11ix_9i0b9_129 > img:not(#\9) {
139
139
  width: var(--size-icon-normal-0m1722, 16px);
140
140
  height: var(--size-icon-normal-0m1722, 16px);
141
141
  vertical-align: top;
142
142
  }
143
- .awsui_icon_h11ix_gi1za_98.awsui_size-small_h11ix_gi1za_129 > svg:not(#\9),
144
- .awsui_icon_h11ix_gi1za_98.awsui_size-small_h11ix_gi1za_129 > svg *:not(#\9) {
143
+ .awsui_icon_h11ix_9i0b9_98.awsui_size-small_h11ix_9i0b9_129 > svg:not(#\9),
144
+ .awsui_icon_h11ix_9i0b9_98.awsui_size-small_h11ix_9i0b9_129 > svg *:not(#\9) {
145
145
  stroke-width: 2px;
146
146
  }
147
- .awsui_icon_h11ix_gi1za_98.awsui_size-normal_h11ix_gi1za_147:not(#\9) {
147
+ .awsui_icon_h11ix_9i0b9_98.awsui_size-normal_h11ix_9i0b9_147:not(#\9) {
148
148
  width: var(--size-icon-normal-0m1722, 16px);
149
149
  box-sizing: border-box;
150
150
  }
151
- .awsui_icon_h11ix_gi1za_98.awsui_size-normal-mapped-height_h11ix_gi1za_151:not(#\9) {
151
+ .awsui_icon_h11ix_9i0b9_98.awsui_size-normal-mapped-height_h11ix_9i0b9_151:not(#\9) {
152
152
  height: var(--font-body-m-line-height-5wv9x1, 20px);
153
153
  padding: calc((var(--font-body-m-line-height-5wv9x1, 20px) - var(--size-icon-normal-0m1722, 16px)) / 2) 0;
154
154
  }
155
- .awsui_icon_h11ix_gi1za_98.awsui_size-normal_h11ix_gi1za_147 > svg:not(#\9),
156
- .awsui_icon_h11ix_gi1za_98.awsui_size-normal_h11ix_gi1za_147 > img:not(#\9) {
155
+ .awsui_icon_h11ix_9i0b9_98.awsui_size-normal_h11ix_9i0b9_147 > svg:not(#\9),
156
+ .awsui_icon_h11ix_9i0b9_98.awsui_size-normal_h11ix_9i0b9_147 > img:not(#\9) {
157
157
  width: var(--size-icon-normal-0m1722, 16px);
158
158
  height: var(--size-icon-normal-0m1722, 16px);
159
159
  vertical-align: top;
160
160
  }
161
- .awsui_icon_h11ix_gi1za_98.awsui_size-normal_h11ix_gi1za_147 > svg:not(#\9),
162
- .awsui_icon_h11ix_gi1za_98.awsui_size-normal_h11ix_gi1za_147 > svg *:not(#\9) {
161
+ .awsui_icon_h11ix_9i0b9_98.awsui_size-normal_h11ix_9i0b9_147 > svg:not(#\9),
162
+ .awsui_icon_h11ix_9i0b9_98.awsui_size-normal_h11ix_9i0b9_147 > svg *:not(#\9) {
163
163
  stroke-width: 2px;
164
164
  }
165
- .awsui_icon_h11ix_gi1za_98.awsui_size-medium_h11ix_gi1za_165:not(#\9) {
165
+ .awsui_icon_h11ix_9i0b9_98.awsui_size-medium_h11ix_9i0b9_165:not(#\9) {
166
166
  width: var(--size-icon-medium-y9xuoq, 20px);
167
167
  box-sizing: border-box;
168
168
  }
169
- .awsui_icon_h11ix_gi1za_98.awsui_size-medium-mapped-height_h11ix_gi1za_169:not(#\9) {
169
+ .awsui_icon_h11ix_9i0b9_98.awsui_size-medium-mapped-height_h11ix_9i0b9_169:not(#\9) {
170
170
  height: var(--font-heading-l-line-height-thvd8z, 24px);
171
171
  padding: calc((var(--font-heading-l-line-height-thvd8z, 24px) - var(--size-icon-medium-y9xuoq, 20px)) / 2) 0;
172
172
  }
173
- .awsui_icon_h11ix_gi1za_98.awsui_size-medium_h11ix_gi1za_165 > svg:not(#\9),
174
- .awsui_icon_h11ix_gi1za_98.awsui_size-medium_h11ix_gi1za_165 > img:not(#\9) {
173
+ .awsui_icon_h11ix_9i0b9_98.awsui_size-medium_h11ix_9i0b9_165 > svg:not(#\9),
174
+ .awsui_icon_h11ix_9i0b9_98.awsui_size-medium_h11ix_9i0b9_165 > img:not(#\9) {
175
175
  width: var(--size-icon-medium-y9xuoq, 20px);
176
176
  height: var(--size-icon-medium-y9xuoq, 20px);
177
177
  vertical-align: top;
178
178
  }
179
- .awsui_icon_h11ix_gi1za_98.awsui_size-medium_h11ix_gi1za_165 > svg:not(#\9),
180
- .awsui_icon_h11ix_gi1za_98.awsui_size-medium_h11ix_gi1za_165 > svg *:not(#\9) {
179
+ .awsui_icon_h11ix_9i0b9_98.awsui_size-medium_h11ix_9i0b9_165 > svg:not(#\9),
180
+ .awsui_icon_h11ix_9i0b9_98.awsui_size-medium_h11ix_9i0b9_165 > svg *:not(#\9) {
181
181
  stroke-width: 2px;
182
182
  }
183
- .awsui_icon_h11ix_gi1za_98.awsui_size-big_h11ix_gi1za_183:not(#\9) {
183
+ .awsui_icon_h11ix_9i0b9_98.awsui_size-big_h11ix_9i0b9_183:not(#\9) {
184
184
  width: var(--size-icon-big-zkdryd, 32px);
185
185
  box-sizing: border-box;
186
186
  }
187
- .awsui_icon_h11ix_gi1za_98.awsui_size-big-mapped-height_h11ix_gi1za_187:not(#\9) {
187
+ .awsui_icon_h11ix_9i0b9_98.awsui_size-big-mapped-height_h11ix_9i0b9_187:not(#\9) {
188
188
  height: var(--font-heading-xl-line-height-qs40h8, 30px);
189
189
  padding: calc((var(--font-heading-xl-line-height-qs40h8, 30px) - var(--size-icon-big-zkdryd, 32px)) / 2) 0;
190
190
  }
191
- .awsui_icon_h11ix_gi1za_98.awsui_size-big_h11ix_gi1za_183 > svg:not(#\9),
192
- .awsui_icon_h11ix_gi1za_98.awsui_size-big_h11ix_gi1za_183 > img:not(#\9) {
191
+ .awsui_icon_h11ix_9i0b9_98.awsui_size-big_h11ix_9i0b9_183 > svg:not(#\9),
192
+ .awsui_icon_h11ix_9i0b9_98.awsui_size-big_h11ix_9i0b9_183 > img:not(#\9) {
193
193
  width: var(--size-icon-big-zkdryd, 32px);
194
194
  height: var(--size-icon-big-zkdryd, 32px);
195
195
  vertical-align: top;
196
196
  }
197
- .awsui_icon_h11ix_gi1za_98.awsui_size-big_h11ix_gi1za_183 > svg:not(#\9),
198
- .awsui_icon_h11ix_gi1za_98.awsui_size-big_h11ix_gi1za_183 > svg *:not(#\9) {
197
+ .awsui_icon_h11ix_9i0b9_98.awsui_size-big_h11ix_9i0b9_183 > svg:not(#\9),
198
+ .awsui_icon_h11ix_9i0b9_98.awsui_size-big_h11ix_9i0b9_183 > svg *:not(#\9) {
199
199
  stroke-width: 2px;
200
200
  }
201
- .awsui_icon_h11ix_gi1za_98.awsui_size-large_h11ix_gi1za_201:not(#\9) {
201
+ .awsui_icon_h11ix_9i0b9_98.awsui_size-large_h11ix_9i0b9_201:not(#\9) {
202
202
  width: var(--size-icon-large-bivhmh, 48px);
203
203
  box-sizing: border-box;
204
204
  }
205
- .awsui_icon_h11ix_gi1za_98.awsui_size-large-mapped-height_h11ix_gi1za_205:not(#\9) {
205
+ .awsui_icon_h11ix_9i0b9_98.awsui_size-large-mapped-height_h11ix_9i0b9_205:not(#\9) {
206
206
  height: var(--font-display-l-line-height-07o0h7, 48px);
207
207
  padding: calc((var(--font-display-l-line-height-07o0h7, 48px) - var(--size-icon-large-bivhmh, 48px)) / 2) 0;
208
208
  }
209
- .awsui_icon_h11ix_gi1za_98.awsui_size-large_h11ix_gi1za_201 > svg:not(#\9),
210
- .awsui_icon_h11ix_gi1za_98.awsui_size-large_h11ix_gi1za_201 > img:not(#\9) {
209
+ .awsui_icon_h11ix_9i0b9_98.awsui_size-large_h11ix_9i0b9_201 > svg:not(#\9),
210
+ .awsui_icon_h11ix_9i0b9_98.awsui_size-large_h11ix_9i0b9_201 > img:not(#\9) {
211
211
  width: var(--size-icon-large-bivhmh, 48px);
212
212
  height: var(--size-icon-large-bivhmh, 48px);
213
213
  vertical-align: top;
214
214
  }
215
- .awsui_icon_h11ix_gi1za_98.awsui_size-large_h11ix_gi1za_201 > svg:not(#\9),
216
- .awsui_icon_h11ix_gi1za_98.awsui_size-large_h11ix_gi1za_201 > svg *:not(#\9) {
215
+ .awsui_icon_h11ix_9i0b9_98.awsui_size-large_h11ix_9i0b9_201 > svg:not(#\9),
216
+ .awsui_icon_h11ix_9i0b9_98.awsui_size-large_h11ix_9i0b9_201 > svg *:not(#\9) {
217
217
  stroke-width: 1.2px;
218
218
  }
219
- .awsui_icon_h11ix_gi1za_98.awsui_variant-normal_h11ix_gi1za_219:not(#\9) {
219
+ .awsui_icon_h11ix_9i0b9_98.awsui_variant-normal_h11ix_9i0b9_219:not(#\9) {
220
220
  color: currentColor;
221
221
  }
222
- .awsui_icon_h11ix_gi1za_98.awsui_variant-disabled_h11ix_gi1za_222:not(#\9) {
222
+ .awsui_icon_h11ix_9i0b9_98.awsui_variant-disabled_h11ix_9i0b9_222:not(#\9) {
223
223
  color: var(--color-text-interactive-disabled-z7a3t4, #9ba7b6);
224
224
  }
225
- .awsui_icon_h11ix_gi1za_98.awsui_variant-inverted_h11ix_gi1za_225:not(#\9) {
225
+ .awsui_icon_h11ix_9i0b9_98.awsui_variant-inverted_h11ix_9i0b9_225:not(#\9) {
226
226
  color: var(--color-text-inverted-70cpkk, #ffffff);
227
227
  }
228
- .awsui_icon_h11ix_gi1za_98.awsui_variant-subtle_h11ix_gi1za_228:not(#\9) {
228
+ .awsui_icon_h11ix_9i0b9_98.awsui_variant-subtle_h11ix_9i0b9_228:not(#\9) {
229
229
  color: var(--color-text-icon-subtle-c4qyia, #5f6b7a);
230
230
  }
231
- .awsui_icon_h11ix_gi1za_98.awsui_variant-warning_h11ix_gi1za_231:not(#\9) {
231
+ .awsui_icon_h11ix_9i0b9_98.awsui_variant-warning_h11ix_9i0b9_231:not(#\9) {
232
232
  color: var(--color-text-status-warning-yik8vi, #8d6605);
233
233
  }
234
- .awsui_icon_h11ix_gi1za_98.awsui_variant-error_h11ix_gi1za_234:not(#\9) {
234
+ .awsui_icon_h11ix_9i0b9_98.awsui_variant-error_h11ix_9i0b9_234:not(#\9) {
235
235
  color: var(--color-text-status-error-wdvepn, #d91515);
236
236
  }
237
- .awsui_icon_h11ix_gi1za_98.awsui_variant-success_h11ix_gi1za_237:not(#\9) {
237
+ .awsui_icon_h11ix_9i0b9_98.awsui_variant-success_h11ix_9i0b9_237:not(#\9) {
238
238
  color: var(--color-text-status-success-bpiyjm, #037f0c);
239
239
  }
240
- .awsui_icon_h11ix_gi1za_98.awsui_variant-link_h11ix_gi1za_240:not(#\9) {
240
+ .awsui_icon_h11ix_9i0b9_98.awsui_variant-link_h11ix_9i0b9_240:not(#\9) {
241
241
  color: var(--color-text-link-default-latg1a, #0972d3);
242
242
  }
243
243
 
244
- .awsui_badge_h11ix_gi1za_244:not(#\9)::after {
244
+ .awsui_badge_h11ix_9i0b9_244:not(#\9)::after {
245
245
  content: "";
246
246
  position: absolute;
247
- width: 8px;
248
- height: 8px;
249
- border-radius: 8px;
250
- background-color: var(--color-text-status-info-ahz8zp, #0972d3);
251
- top: 2px;
252
- right: -2px;
247
+ width: 6px;
248
+ height: 6px;
249
+ border-radius: 4px;
250
+ background-color: var(--color-background-badge-icon-q1kfox, #d91515);
251
+ top: 0px;
252
+ right: -3px;
253
253
  }
@@ -2,26 +2,26 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "icon": "awsui_icon_h11ix_gi1za_98",
6
- "icon-flex-height": "awsui_icon-flex-height_h11ix_gi1za_104",
7
- "size-small": "awsui_size-small_h11ix_gi1za_129",
8
- "size-small-mapped-height": "awsui_size-small-mapped-height_h11ix_gi1za_133",
9
- "size-normal": "awsui_size-normal_h11ix_gi1za_147",
10
- "size-normal-mapped-height": "awsui_size-normal-mapped-height_h11ix_gi1za_151",
11
- "size-medium": "awsui_size-medium_h11ix_gi1za_165",
12
- "size-medium-mapped-height": "awsui_size-medium-mapped-height_h11ix_gi1za_169",
13
- "size-big": "awsui_size-big_h11ix_gi1za_183",
14
- "size-big-mapped-height": "awsui_size-big-mapped-height_h11ix_gi1za_187",
15
- "size-large": "awsui_size-large_h11ix_gi1za_201",
16
- "size-large-mapped-height": "awsui_size-large-mapped-height_h11ix_gi1za_205",
17
- "variant-normal": "awsui_variant-normal_h11ix_gi1za_219",
18
- "variant-disabled": "awsui_variant-disabled_h11ix_gi1za_222",
19
- "variant-inverted": "awsui_variant-inverted_h11ix_gi1za_225",
20
- "variant-subtle": "awsui_variant-subtle_h11ix_gi1za_228",
21
- "variant-warning": "awsui_variant-warning_h11ix_gi1za_231",
22
- "variant-error": "awsui_variant-error_h11ix_gi1za_234",
23
- "variant-success": "awsui_variant-success_h11ix_gi1za_237",
24
- "variant-link": "awsui_variant-link_h11ix_gi1za_240",
25
- "badge": "awsui_badge_h11ix_gi1za_244"
5
+ "icon": "awsui_icon_h11ix_9i0b9_98",
6
+ "icon-flex-height": "awsui_icon-flex-height_h11ix_9i0b9_104",
7
+ "size-small": "awsui_size-small_h11ix_9i0b9_129",
8
+ "size-small-mapped-height": "awsui_size-small-mapped-height_h11ix_9i0b9_133",
9
+ "size-normal": "awsui_size-normal_h11ix_9i0b9_147",
10
+ "size-normal-mapped-height": "awsui_size-normal-mapped-height_h11ix_9i0b9_151",
11
+ "size-medium": "awsui_size-medium_h11ix_9i0b9_165",
12
+ "size-medium-mapped-height": "awsui_size-medium-mapped-height_h11ix_9i0b9_169",
13
+ "size-big": "awsui_size-big_h11ix_9i0b9_183",
14
+ "size-big-mapped-height": "awsui_size-big-mapped-height_h11ix_9i0b9_187",
15
+ "size-large": "awsui_size-large_h11ix_9i0b9_201",
16
+ "size-large-mapped-height": "awsui_size-large-mapped-height_h11ix_9i0b9_205",
17
+ "variant-normal": "awsui_variant-normal_h11ix_9i0b9_219",
18
+ "variant-disabled": "awsui_variant-disabled_h11ix_9i0b9_222",
19
+ "variant-inverted": "awsui_variant-inverted_h11ix_9i0b9_225",
20
+ "variant-subtle": "awsui_variant-subtle_h11ix_9i0b9_228",
21
+ "variant-warning": "awsui_variant-warning_h11ix_9i0b9_231",
22
+ "variant-error": "awsui_variant-error_h11ix_9i0b9_234",
23
+ "variant-success": "awsui_variant-success_h11ix_9i0b9_237",
24
+ "variant-link": "awsui_variant-link_h11ix_9i0b9_240",
25
+ "badge": "awsui_badge_h11ix_9i0b9_244"
26
26
  };
27
27
 
@@ -154,6 +154,7 @@
154
154
  --color-charts-palette-categorical-48-tptw1p:#014b44;
155
155
  --color-charts-palette-categorical-49-6lrkes:#431d84;
156
156
  --color-charts-palette-categorical-50-mqbaxr:#732c02;
157
+ --color-background-badge-icon-q1kfox:#d91515;
157
158
  --color-background-button-link-active-cbd6sf:#d3e7f9;
158
159
  --color-background-button-link-hover-t0fnno:#f2f8fd;
159
160
  --color-background-button-normal-active-qmds3y:#d3e7f9;
@@ -758,6 +759,7 @@
758
759
  --color-charts-palette-categorical-48-tptw1p:#ace9db;
759
760
  --color-charts-palette-categorical-49-6lrkes:#f5edff;
760
761
  --color-charts-palette-categorical-50-mqbaxr:#ffd4bb;
762
+ --color-background-badge-icon-q1kfox:#eb6f6f;
761
763
  --color-background-button-link-active-cbd6sf:#354150;
762
764
  --color-background-button-link-hover-t0fnno:#192534;
763
765
  --color-background-button-normal-active-qmds3y:#354150;
@@ -1035,6 +1037,7 @@
1035
1037
  }
1036
1038
 
1037
1039
  .awsui-context-top-navigation:not(#\9) {
1040
+ --color-background-badge-icon-q1kfox:#eb6f6f;
1038
1041
  --color-background-button-link-active-cbd6sf:#354150;
1039
1042
  --color-background-button-link-hover-t0fnno:#192534;
1040
1043
  --color-background-button-normal-active-qmds3y:#354150;
@@ -1217,6 +1220,7 @@
1217
1220
  }
1218
1221
 
1219
1222
  .awsui-context-content-header:not(#\9) {
1223
+ --color-background-badge-icon-q1kfox:#eb6f6f;
1220
1224
  --color-background-button-link-active-cbd6sf:#354150;
1221
1225
  --color-background-button-link-hover-t0fnno:#192534;
1222
1226
  --color-background-button-normal-active-qmds3y:#354150;
@@ -1497,6 +1501,7 @@
1497
1501
  }
1498
1502
 
1499
1503
  .awsui-context-content-header .awsui-context-alert:not(#\9) {
1504
+ --color-background-badge-icon-q1kfox:#eb6f6f;
1500
1505
  --color-background-button-link-active-cbd6sf:#354150;
1501
1506
  --color-background-button-link-hover-t0fnno:#192534;
1502
1507
  --color-background-button-normal-active-qmds3y:rgba(255, 255, 255, 0.15);
@@ -1,4 +1,4 @@
1
1
  export var PACKAGE_SOURCE = "components";
2
- export var PACKAGE_VERSION = "3.0.0 (2b28f237)";
2
+ export var PACKAGE_VERSION = "3.0.0 (7940b142)";
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 (2b28f237)",
3
+ "PACKAGE_VERSION": "3.0.0 (7940b142)",
4
4
  "THEME": "default",
5
5
  "ALWAYS_VISUAL_REFRESH": false
6
6
  }