@cloudscape-design/components 3.0.1304 → 3.0.1306

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 (169) hide show
  1. package/alert/styles.css.js +27 -27
  2. package/alert/styles.scoped.css +50 -50
  3. package/alert/styles.selectors.js +27 -27
  4. package/annotation-context/annotation/styles.css.js +13 -13
  5. package/annotation-context/annotation/styles.scoped.css +21 -21
  6. package/annotation-context/annotation/styles.selectors.js +13 -13
  7. package/app-layout/notifications/styles.css.js +3 -3
  8. package/app-layout/notifications/styles.scoped.css +7 -7
  9. package/app-layout/notifications/styles.selectors.js +3 -3
  10. package/app-layout/visual-refresh/styles.css.js +86 -86
  11. package/app-layout/visual-refresh/styles.scoped.css +258 -258
  12. package/app-layout/visual-refresh/styles.selectors.js +86 -86
  13. package/app-layout/visual-refresh-toolbar/drawer/styles.css.js +32 -32
  14. package/app-layout/visual-refresh-toolbar/drawer/styles.scoped.css +89 -89
  15. package/app-layout/visual-refresh-toolbar/drawer/styles.selectors.js +32 -32
  16. package/app-layout/visual-refresh-toolbar/navigation/styles.css.js +4 -4
  17. package/app-layout/visual-refresh-toolbar/navigation/styles.scoped.css +7 -7
  18. package/app-layout/visual-refresh-toolbar/navigation/styles.selectors.js +4 -4
  19. package/app-layout/visual-refresh-toolbar/skeleton/styles.css.js +29 -27
  20. package/app-layout/visual-refresh-toolbar/skeleton/styles.scoped.css +123 -54
  21. package/app-layout/visual-refresh-toolbar/skeleton/styles.selectors.js +29 -27
  22. package/app-layout/visual-refresh-toolbar/state/props-merger.js +3 -3
  23. package/app-layout/visual-refresh-toolbar/state/props-merger.js.map +1 -1
  24. package/app-layout/visual-refresh-toolbar/state/use-app-layout.d.ts.map +1 -1
  25. package/app-layout/visual-refresh-toolbar/state/use-app-layout.js +2 -1
  26. package/app-layout/visual-refresh-toolbar/state/use-app-layout.js.map +1 -1
  27. package/app-layout/visual-refresh-toolbar/widget-areas/before-main-slot.d.ts.map +1 -1
  28. package/app-layout/visual-refresh-toolbar/widget-areas/before-main-slot.js +5 -0
  29. package/app-layout/visual-refresh-toolbar/widget-areas/before-main-slot.js.map +1 -1
  30. package/attribute-editor/styles.css.js +15 -15
  31. package/attribute-editor/styles.scoped.css +28 -28
  32. package/attribute-editor/styles.selectors.js +15 -15
  33. package/breadcrumb-group/item/styles.css.js +7 -7
  34. package/breadcrumb-group/item/styles.scoped.css +28 -28
  35. package/breadcrumb-group/item/styles.selectors.js +7 -7
  36. package/button/styles.css.js +22 -22
  37. package/button/styles.scoped.css +256 -256
  38. package/button/styles.selectors.js +22 -22
  39. package/button-dropdown/item-element/styles.css.js +21 -21
  40. package/button-dropdown/item-element/styles.scoped.css +37 -37
  41. package/button-dropdown/item-element/styles.selectors.js +21 -21
  42. package/calendar/styles.css.js +21 -21
  43. package/calendar/styles.scoped.css +44 -44
  44. package/calendar/styles.selectors.js +21 -21
  45. package/checkbox/styles.css.js +3 -3
  46. package/checkbox/styles.scoped.css +11 -11
  47. package/checkbox/styles.selectors.js +3 -3
  48. package/content-layout/styles.css.js +14 -14
  49. package/content-layout/styles.scoped.css +27 -27
  50. package/content-layout/styles.selectors.js +14 -14
  51. package/date-range-picker/calendar/grids/styles.css.js +30 -30
  52. package/date-range-picker/calendar/grids/styles.scoped.css +56 -56
  53. package/date-range-picker/calendar/grids/styles.selectors.js +30 -30
  54. package/dropdown/styles.css.js +20 -20
  55. package/dropdown/styles.scoped.css +49 -49
  56. package/dropdown/styles.selectors.js +20 -20
  57. package/expandable-section/styles.css.js +35 -35
  58. package/expandable-section/styles.scoped.css +66 -68
  59. package/expandable-section/styles.selectors.js +35 -35
  60. package/file-token-group/styles.css.js +23 -23
  61. package/file-token-group/styles.scoped.css +36 -36
  62. package/file-token-group/styles.selectors.js +23 -23
  63. package/flashbar/styles.css.js +50 -50
  64. package/flashbar/styles.scoped.css +187 -187
  65. package/flashbar/styles.selectors.js +50 -50
  66. package/help-panel/styles.css.js +6 -6
  67. package/help-panel/styles.scoped.css +73 -73
  68. package/help-panel/styles.selectors.js +6 -6
  69. package/icon/interfaces.d.ts +1 -1
  70. package/icon/interfaces.d.ts.map +1 -1
  71. package/icon/interfaces.js.map +1 -1
  72. package/icon/internal.d.ts.map +1 -1
  73. package/icon/internal.js +4 -86
  74. package/icon/internal.js.map +1 -1
  75. package/icon/styles.css.js +39 -41
  76. package/icon/styles.scoped.css +110 -135
  77. package/icon/styles.selectors.js +39 -41
  78. package/icon-provider/context.d.ts +3 -34
  79. package/icon-provider/context.d.ts.map +1 -1
  80. package/icon-provider/context.js +3 -7
  81. package/icon-provider/context.js.map +1 -1
  82. package/icon-provider/index.d.ts +0 -3
  83. package/icon-provider/index.d.ts.map +1 -1
  84. package/icon-provider/index.js +0 -3
  85. package/icon-provider/index.js.map +1 -1
  86. package/icon-provider/interfaces.d.ts +0 -52
  87. package/icon-provider/interfaces.d.ts.map +1 -1
  88. package/icon-provider/interfaces.js.map +1 -1
  89. package/icon-provider/internal.d.ts +1 -3
  90. package/icon-provider/internal.d.ts.map +1 -1
  91. package/icon-provider/internal.js +4 -13
  92. package/icon-provider/internal.js.map +1 -1
  93. package/input/styles.css.js +18 -18
  94. package/input/styles.scoped.css +82 -82
  95. package/input/styles.selectors.js +18 -18
  96. package/internal/base-component/styles.scoped.css +17 -8
  97. package/internal/components/drag-handle-wrapper/styles.css.js +30 -30
  98. package/internal/components/drag-handle-wrapper/styles.scoped.css +58 -58
  99. package/internal/components/drag-handle-wrapper/styles.selectors.js +30 -30
  100. package/internal/components/radio-button/styles.css.js +7 -7
  101. package/internal/components/radio-button/styles.scoped.css +18 -18
  102. package/internal/components/radio-button/styles.selectors.js +7 -7
  103. package/internal/components/token-list/styles.css.js +10 -10
  104. package/internal/components/token-list/styles.scoped.css +25 -25
  105. package/internal/components/token-list/styles.selectors.js +10 -10
  106. package/internal/environment.js +2 -2
  107. package/internal/environment.json +2 -2
  108. package/internal/generated/custom-css-properties/index.d.ts +0 -3
  109. package/internal/generated/custom-css-properties/index.d.ts.map +1 -1
  110. package/internal/generated/custom-css-properties/index.js +159 -162
  111. package/internal/generated/custom-css-properties/index.js.map +1 -1
  112. package/internal/generated/styles/tokens.d.ts +7 -7
  113. package/internal/generated/styles/tokens.js +7 -7
  114. package/internal/generated/theming/index.cjs +93 -39
  115. package/internal/generated/theming/index.cjs.d.ts +72 -63
  116. package/internal/generated/theming/index.d.ts +72 -63
  117. package/internal/generated/theming/index.js +93 -39
  118. package/internal/manifest.json +1 -1
  119. package/item-card/styles.css.js +14 -14
  120. package/item-card/styles.scoped.css +63 -63
  121. package/item-card/styles.selectors.js +14 -14
  122. package/link/styles.css.js +21 -21
  123. package/link/styles.scoped.css +104 -104
  124. package/link/styles.selectors.js +21 -21
  125. package/manifest.json +2 -2
  126. package/modal/styles.css.js +31 -31
  127. package/modal/styles.scoped.css +48 -48
  128. package/modal/styles.selectors.js +31 -31
  129. package/navigable-group/index.d.ts +0 -3
  130. package/navigable-group/index.d.ts.map +1 -1
  131. package/navigable-group/index.js +0 -3
  132. package/navigable-group/index.js.map +1 -1
  133. package/package.json +1 -1
  134. package/progress-bar/styles.css.js +18 -18
  135. package/progress-bar/styles.scoped.css +48 -48
  136. package/progress-bar/styles.selectors.js +18 -18
  137. package/prompt-input/styles.css.js +26 -26
  138. package/prompt-input/styles.scoped.css +105 -105
  139. package/prompt-input/styles.selectors.js +26 -26
  140. package/segmented-control/styles.css.js +16 -16
  141. package/segmented-control/styles.scoped.css +46 -46
  142. package/segmented-control/styles.selectors.js +16 -16
  143. package/slider/styles.css.js +26 -26
  144. package/slider/styles.scoped.css +165 -165
  145. package/slider/styles.selectors.js +26 -26
  146. package/spinner/styles.css.js +13 -13
  147. package/spinner/styles.scoped.css +39 -39
  148. package/spinner/styles.selectors.js +13 -13
  149. package/tabs/styles.css.js +30 -30
  150. package/tabs/styles.scoped.css +76 -76
  151. package/tabs/styles.selectors.js +30 -30
  152. package/tag-editor/styles.css.js +3 -3
  153. package/tag-editor/styles.scoped.css +13 -13
  154. package/tag-editor/styles.selectors.js +3 -3
  155. package/text-content/styles.css.js +1 -1
  156. package/text-content/styles.scoped.css +66 -66
  157. package/text-content/styles.selectors.js +1 -1
  158. package/textarea/styles.css.js +5 -5
  159. package/textarea/styles.scoped.css +45 -45
  160. package/textarea/styles.selectors.js +5 -5
  161. package/toggle/styles.css.js +10 -10
  162. package/toggle/styles.scoped.css +23 -23
  163. package/toggle/styles.selectors.js +10 -10
  164. package/toggle-button/styles.css.js +3 -3
  165. package/toggle-button/styles.scoped.css +6 -2
  166. package/toggle-button/styles.selectors.js +3 -3
  167. package/token/styles.css.js +14 -14
  168. package/token/styles.scoped.css +46 -46
  169. package/token/styles.selectors.js +14 -14
package/icon/internal.js CHANGED
@@ -5,67 +5,9 @@ import clsx from 'clsx';
5
5
  import { useMergeRefs, warnOnce } from '@cloudscape-design/component-toolkit/internal';
6
6
  import { InternalIconContext } from '../icon-provider/context';
7
7
  import { getBaseProps } from '../internal/base-component';
8
- import customCSSPropertiesMap from '../internal/generated/custom-css-properties';
9
8
  import { useVisualRefresh } from '../internal/hooks/use-visual-mode';
10
9
  import WithNativeAttributes from '../internal/utils/with-native-attributes';
11
10
  import styles from './styles.css.js';
12
- /**
13
- * Base pixel sizes for each named icon size variant.
14
- * Used to compute the stroke-width scale factor when a pixel override is provided.
15
- * These must match the CSS `inline-size` values from the SCSS $_icon-sizes map
16
- * (i.e. the actual rendered size of the SVG element without any override).
17
- * Note: "small" uses $size-icon-normal (16px), same as "normal".
18
- */
19
- const BASE_SIZE_PX = {
20
- 'x-small': 12,
21
- small: 16,
22
- normal: 16,
23
- medium: 20,
24
- big: 32,
25
- large: 48,
26
- };
27
- /**
28
- * CSS scale factors for each icon size variant.
29
- * These match the scaleFactor values in mixins.scss and represent how much
30
- * the SVG viewBox is scaled up relative to the base 16×16 coordinate system.
31
- * The stroke-width must be divided by this factor to render at the intended visual size.
32
- */
33
- const SCALE_FACTOR = {
34
- 'x-small': 0.75,
35
- small: 1,
36
- normal: 1,
37
- medium: 1.25,
38
- big: 2,
39
- large: 3,
40
- };
41
- /**
42
- * Computes the CSS custom property values needed to apply size and stroke-width overrides
43
- * for a given icon size variant.
44
- *
45
- * When a size override is active, the stroke-width must be compensated so the visual stroke
46
- * stays at the themed value. When an explicit stroke-width override is also provided, it takes
47
- * precedence and incorporates both the SVG scale factor and any size compensation.
48
- */
49
- function computeSizeOverrides({ sizeOverrides, strokeWidthOverrides, iconSize, }) {
50
- var _a;
51
- const result = {};
52
- const targetSizePx = sizeOverrides[iconSize];
53
- if (targetSizePx !== undefined) {
54
- result.size = targetSizePx;
55
- const basePx = BASE_SIZE_PX[iconSize];
56
- if (basePx !== undefined && targetSizePx !== basePx) {
57
- result.strokeScale = basePx / targetSizePx;
58
- }
59
- }
60
- const rawStroke = strokeWidthOverrides[iconSize];
61
- if (rawStroke !== undefined) {
62
- const scaleFactor = (_a = SCALE_FACTOR[iconSize]) !== null && _a !== void 0 ? _a : 1;
63
- const basePx = BASE_SIZE_PX[iconSize];
64
- const sizeCompensation = result.size !== undefined && basePx !== undefined ? basePx / result.size : 1;
65
- result.strokeWidth = `${(rawStroke / scaleFactor) * sizeCompensation}px`;
66
- }
67
- return result;
68
- }
69
11
  function iconSizeMap(height, fontSize) {
70
12
  if (height === null) {
71
13
  // This is the best guess for the contextual height while server rendering.
@@ -83,46 +25,22 @@ function iconSizeMap(height, fontSize) {
83
25
  return 'medium';
84
26
  }
85
27
  else if (height <= 16) {
86
- return !!fontSize && fontSize <= 12 ? 'x-small' : 'small';
28
+ return 'small';
87
29
  }
88
30
  else {
89
31
  return 'normal';
90
32
  }
91
33
  }
92
34
  const InternalIcon = ({ name, size = 'normal', variant = 'normal', url, alt, ariaLabel, svg, badge, nativeAttributes, __internalRootRef, ...props }) => {
93
- const { icons, sizeOverrides, strokeWidthOverrides } = useContext(InternalIconContext);
35
+ const icons = useContext(InternalIconContext);
94
36
  const iconRef = useRef(null);
95
37
  // To ensure a re-render is triggered on visual mode changes
96
38
  useVisualRefresh();
97
39
  const [parentHeight, setParentHeight] = useState(null);
98
40
  const [parentFontSize, setParentFontSize] = useState(null);
99
- // Determine the effective size class for CSS purposes
100
41
  const contextualSize = size === 'inherit';
101
42
  const iconSize = contextualSize ? iconSizeMap(parentHeight, parentFontSize) : size;
102
- // Build inline styles for the wrapper span.
103
- // When a size override is active, we set --icon-size-override which the CSS uses
104
- // for both the span's inline-size and the child SVG's inline-size/block-size.
105
- const inlineStyles = {};
106
- const setVar = (key, value) => (inlineStyles[key] = value);
107
- if (contextualSize && parentHeight !== null) {
108
- // Keep the wrapper at line-height so the inline-flex container stays tall enough
109
- // for correct text alignment. align-items: center will center the icon within it,
110
- // even when a size override makes the icon smaller than the line-height.
111
- inlineStyles.height = `${parentHeight}px`;
112
- }
113
- // Apply size and stroke-width overrides from IconProvider for the resolved size variant.
114
- // For size="inherit", iconSize is the variant resolved from the measured line-height
115
- // (e.g. "small"), so provider overrides for that variant are respected.
116
- const override = computeSizeOverrides({ sizeOverrides, strokeWidthOverrides, iconSize });
117
- if (override.size) {
118
- setVar(customCSSPropertiesMap.iconSizeOverride, `${override.size}px`);
119
- }
120
- if (override.strokeWidth) {
121
- setVar(customCSSPropertiesMap.iconStrokeWidthOverride, override.strokeWidth);
122
- }
123
- else if (override.strokeScale) {
124
- setVar(customCSSPropertiesMap.iconStrokeScale, override.strokeScale);
125
- }
43
+ const inlineStyles = contextualSize && parentHeight !== null ? { height: `${parentHeight}px` } : {};
126
44
  const baseProps = getBaseProps(props);
127
45
  baseProps.className = clsx(baseProps.className, styles.icon, contextualSize && styles['icon-flex-height'], badge && styles.badge, !contextualSize && styles[`size-${iconSize}-mapped-height`], styles[`size-${iconSize}`], styles[`variant-${variant}`], styles[`name-${name}`]);
128
46
  // Possible infinite loop is not a concern here because line
@@ -154,7 +72,7 @@ const InternalIcon = ({ name, size = 'normal', variant = 'normal', url, alt, ari
154
72
  }
155
73
  const validIcon = name && Object.prototype.hasOwnProperty.call(icons, name);
156
74
  function iconMap(name) {
157
- if (name === 'gen-ai' && (iconSize === 'small' || iconSize === 'x-small')) {
75
+ if (name === 'gen-ai' && iconSize === 'small') {
158
76
  return (React.createElement("svg", { width: "12", height: "12", viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", focusable: "false", "aria-hidden": "true", "data-testid": "gen-ai-filled" },
159
77
  React.createElement("path", { d: "m8 4.4 1.018 2.582L11.6 8 9.018 9.018 8 11.6 6.982 9.018 4.4 8l2.582-1.018L8 4.4ZM2.405 2.41l.002-.003.003-.002-.003-.002-.002-.003-.002.003-.003.002.003.002.002.003Z", className: "filled" })));
160
78
  }
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/icon/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC7E,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AAEvF,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,sBAAsB,MAAM,6CAA6C,CAAC;AAEjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,oBAAoB,MAAM,0CAA0C,CAAC;AAG5E,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAOrC;;;;;;GAMG;AACH,MAAM,YAAY,GAA2B;IAC3C,SAAS,EAAE,EAAE;IACb,KAAK,EAAE,EAAE;IACT,MAAM,EAAE,EAAE;IACV,MAAM,EAAE,EAAE;IACV,GAAG,EAAE,EAAE;IACP,KAAK,EAAE,EAAE;CACV,CAAC;AAEF;;;;;GAKG;AACH,MAAM,YAAY,GAA2B;IAC3C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AAS,KACT,eAAe,EACnB,GAAG,EAAC,MAAM,EACV,aAAa,EAAC,MAAM,EACpB,gBAAgB,EAAE,gBAAgB,EAClC,GAAG,EAAE,SAAS,EACd,KAAK,EAAE,YAAY,IAElB,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CACjB,CACxB,CAAC;AACJ,CAAC,CAAC;AAGF,eAAe,YAAY,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useContext, useLayoutEffect, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { useMergeRefs, warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nimport { InternalIconContext } from '../icon-provider/context';\nimport { getBaseProps } from '../internal/base-component';\nimport customCSSPropertiesMap from '../internal/generated/custom-css-properties';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport WithNativeAttributes from '../internal/utils/with-native-attributes';\nimport { IconProps } from './interfaces';\n\nimport styles from './styles.css.js';\n\ntype InternalIconProps = IconProps &\n InternalBaseComponentProps & {\n badge?: boolean;\n };\n\n/**\n * Base pixel sizes for each named icon size variant.\n * Used to compute the stroke-width scale factor when a pixel override is provided.\n * These must match the CSS `inline-size` values from the SCSS $_icon-sizes map\n * (i.e. the actual rendered size of the SVG element without any override).\n * Note: \"small\" uses $size-icon-normal (16px), same as \"normal\".\n */\nconst BASE_SIZE_PX: Record<string, number> = {\n 'x-small': 12,\n small: 16,\n normal: 16,\n medium: 20,\n big: 32,\n large: 48,\n};\n\n/**\n * CSS scale factors for each icon size variant.\n * These match the scaleFactor values in mixins.scss and represent how much\n * the SVG viewBox is scaled up relative to the base 16×16 coordinate system.\n * The stroke-width must be divided by this factor to render at the intended visual size.\n */\nconst SCALE_FACTOR: Record<string, number> = {\n 'x-small': 0.75,\n small: 1,\n normal: 1,\n medium: 1.25,\n big: 2,\n large: 3,\n};\n\ninterface SizeOverrideResult {\n /** Target pixel size for the icon wrapper and SVG. */\n size?: number;\n /** Pre-formatted CSS stroke-width value (e.g. \"1.5px\") that overrides the token value. */\n strokeWidth?: string;\n /** Unitless scale factor applied to the token stroke-width to compensate for a size override. */\n strokeScale?: number;\n}\n\n/**\n * Computes the CSS custom property values needed to apply size and stroke-width overrides\n * for a given icon size variant.\n *\n * When a size override is active, the stroke-width must be compensated so the visual stroke\n * stays at the themed value. When an explicit stroke-width override is also provided, it takes\n * precedence and incorporates both the SVG scale factor and any size compensation.\n */\nfunction computeSizeOverrides({\n sizeOverrides,\n strokeWidthOverrides,\n iconSize,\n}: {\n sizeOverrides: Partial<Record<string, number>>;\n strokeWidthOverrides: Partial<Record<string, number>>;\n iconSize: string;\n}): SizeOverrideResult {\n const result: SizeOverrideResult = {};\n\n const targetSizePx = sizeOverrides[iconSize];\n if (targetSizePx !== undefined) {\n result.size = targetSizePx;\n const basePx = BASE_SIZE_PX[iconSize];\n if (basePx !== undefined && targetSizePx !== basePx) {\n result.strokeScale = basePx / targetSizePx;\n }\n }\n\n const rawStroke = strokeWidthOverrides[iconSize];\n if (rawStroke !== undefined) {\n const scaleFactor = SCALE_FACTOR[iconSize] ?? 1;\n const basePx = BASE_SIZE_PX[iconSize];\n const sizeCompensation = result.size !== undefined && basePx !== undefined ? basePx / result.size : 1;\n result.strokeWidth = `${(rawStroke / scaleFactor) * sizeCompensation}px`;\n }\n\n return result;\n}\n\nfunction iconSizeMap(height: number | null, fontSize?: number | null) {\n if (height === null) {\n // This is the best guess for the contextual height while server rendering.\n return 'normal';\n }\n\n // Only display medium size icon when both line-height >= 24px AND font-size >= 20px\n // This prevents icons from becoming medium size inappropriately\n if (height >= 50) {\n return 'large';\n } else if (height >= 36) {\n return 'big';\n } else if (height >= 24 && !!fontSize && fontSize >= 20) {\n return 'medium';\n } else if (height <= 16) {\n return !!fontSize && fontSize <= 12 ? 'x-small' : 'small';\n } else {\n return 'normal';\n }\n}\n\nconst InternalIcon = ({\n name,\n size = 'normal',\n variant = 'normal',\n url,\n alt,\n ariaLabel,\n svg,\n badge,\n nativeAttributes,\n __internalRootRef,\n ...props\n}: InternalIconProps) => {\n const { icons, sizeOverrides, strokeWidthOverrides } = useContext(InternalIconContext);\n const iconRef = useRef<HTMLElement>(null);\n // To ensure a re-render is triggered on visual mode changes\n useVisualRefresh();\n const [parentHeight, setParentHeight] = useState<number | null>(null);\n const [parentFontSize, setParentFontSize] = useState<number | null>(null);\n\n // Determine the effective size class for CSS purposes\n const contextualSize = size === 'inherit';\n const iconSize = contextualSize ? iconSizeMap(parentHeight, parentFontSize) : size;\n\n // Build inline styles for the wrapper span.\n // When a size override is active, we set --icon-size-override which the CSS uses\n // for both the span's inline-size and the child SVG's inline-size/block-size.\n const inlineStyles: React.CSSProperties = {};\n const setVar = (key: string, value: string | number) => ((inlineStyles as Record<string, unknown>)[key] = value);\n\n if (contextualSize && parentHeight !== null) {\n // Keep the wrapper at line-height so the inline-flex container stays tall enough\n // for correct text alignment. align-items: center will center the icon within it,\n // even when a size override makes the icon smaller than the line-height.\n inlineStyles.height = `${parentHeight}px`;\n }\n\n // Apply size and stroke-width overrides from IconProvider for the resolved size variant.\n // For size=\"inherit\", iconSize is the variant resolved from the measured line-height\n // (e.g. \"small\"), so provider overrides for that variant are respected.\n const override = computeSizeOverrides({ sizeOverrides, strokeWidthOverrides, iconSize });\n if (override.size) {\n setVar(customCSSPropertiesMap.iconSizeOverride, `${override.size}px`);\n }\n if (override.strokeWidth) {\n setVar(customCSSPropertiesMap.iconStrokeWidthOverride, override.strokeWidth);\n } else if (override.strokeScale) {\n setVar(customCSSPropertiesMap.iconStrokeScale, override.strokeScale);\n }\n\n const baseProps = getBaseProps(props);\n\n baseProps.className = clsx(\n baseProps.className,\n styles.icon,\n contextualSize && styles['icon-flex-height'],\n badge && styles.badge,\n !contextualSize && styles[`size-${iconSize}-mapped-height`],\n styles[`size-${iconSize}`],\n styles[`variant-${variant}`],\n styles[`name-${name}`]\n );\n\n // Possible infinite loop is not a concern here because line\n // height should not change without an external state update.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useLayoutEffect(() => {\n if (!contextualSize || !iconRef.current) {\n return;\n }\n const computedStyle = getComputedStyle(iconRef.current);\n const { lineHeight, fontSize } = computedStyle;\n const newParentHeight = parseInt(lineHeight, 10);\n const newParentFontSize = parseInt(fontSize, 10);\n setParentHeight(newParentHeight);\n setParentFontSize(newParentFontSize);\n });\n\n const mergedRef = useMergeRefs(iconRef, __internalRootRef);\n const hasAriaLabel = typeof ariaLabel === 'string';\n const labelAttributes = hasAriaLabel ? { role: 'img', 'aria-label': ariaLabel } : {};\n\n if (svg) {\n if (url) {\n warnOnce(\n 'Icon',\n 'You have specified both `url` and `svg`. `svg` will take precedence and `url` will be ignored.'\n );\n }\n return (\n <WithNativeAttributes\n {...baseProps}\n {...labelAttributes}\n tag=\"span\"\n componentName=\"Icon\"\n nativeAttributes={nativeAttributes}\n ref={mergedRef}\n aria-hidden={!hasAriaLabel}\n style={inlineStyles}\n >\n {svg}\n </WithNativeAttributes>\n );\n }\n\n if (url) {\n return (\n <WithNativeAttributes\n {...baseProps}\n tag=\"span\"\n componentName=\"Icon\"\n nativeAttributes={nativeAttributes}\n ref={mergedRef}\n style={inlineStyles}\n >\n <img src={url} alt={ariaLabel ?? alt} />\n </WithNativeAttributes>\n );\n }\n\n const validIcon = name && Object.prototype.hasOwnProperty.call(icons, name);\n\n function iconMap(name: IconProps.Name) {\n if (name === 'gen-ai' && (iconSize === 'small' || iconSize === 'x-small')) {\n return (\n <svg\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 16 16\"\n xmlns=\"http://www.w3.org/2000/svg\"\n focusable=\"false\"\n aria-hidden=\"true\"\n data-testid=\"gen-ai-filled\"\n >\n <path\n d=\"m8 4.4 1.018 2.582L11.6 8 9.018 9.018 8 11.6 6.982 9.018 4.4 8l2.582-1.018L8 4.4ZM2.405 2.41l.002-.003.003-.002-.003-.002-.002-.003-.002.003-.003.002.003.002.002.003Z\"\n className=\"filled\"\n />\n </svg>\n );\n } else {\n const icon = icons[name];\n if (!icon) {\n warnOnce(\n 'Icon',\n `You have specified \\`name=\"${name}\"\\` but no icon with that name was found in the current IconProvider context. If this is a custom icon, ensure your app is wrapped in an \\`IconProvider\\` with the icon defined via \\`defineIcons\\`.`\n );\n }\n return icon;\n }\n }\n\n return (\n <WithNativeAttributes\n {...baseProps}\n {...labelAttributes}\n tag=\"span\"\n componentName=\"Icon\"\n nativeAttributes={nativeAttributes}\n ref={mergedRef}\n style={inlineStyles}\n >\n {validIcon ? iconMap(name) : undefined}\n </WithNativeAttributes>\n );\n};\n\nexport { InternalIconProps };\nexport default InternalIcon;\n"]}
1
+ {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/icon/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC7E,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AAEvF,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,oBAAoB,MAAM,0CAA0C,CAAC;AAG5E,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAOrC,SAAS,WAAW,CAAC,MAAqB,EAAE,QAAwB;IAClE,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;QACpB,2EAA2E;QAC3E,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,oFAAoF;IACpF,gEAAgE;IAChE,IAAI,MAAM,IAAI,EAAE,EAAE,CAAC;QACj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AQ,CACN,MAAM,EACN,8BAA8B,IAAI,sMAAsM,CACzO,CAAC;YACJ,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED,OAAO,CACL,oBAAC,oBAAoB,OACf,SAAS,KACT,eAAe,EACnB,GAAG,EAAC,MAAM,EACV,aAAa,EAAC,MAAM,EACpB,gBAAgB,EAAE,gBAAgB,EAClC,GAAG,EAAE,SAAS,EACd,KAAK,EAAE,YAAY,IAElB,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CACjB,CACxB,CAAC;AACJ,CAAC,CAAC;AAGF,eAAe,YAAY,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useContext, useLayoutEffect, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { useMergeRefs, warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nimport { InternalIconContext } from '../icon-provider/context';\nimport { getBaseProps } from '../internal/base-component';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport WithNativeAttributes from '../internal/utils/with-native-attributes';\nimport { IconProps } from './interfaces';\n\nimport styles from './styles.css.js';\n\ntype InternalIconProps = IconProps &\n InternalBaseComponentProps & {\n badge?: boolean;\n };\n\nfunction iconSizeMap(height: number | null, fontSize?: number | null) {\n if (height === null) {\n // This is the best guess for the contextual height while server rendering.\n return 'normal';\n }\n\n // Only display medium size icon when both line-height >= 24px AND font-size >= 20px\n // This prevents icons from becoming medium size inappropriately\n if (height >= 50) {\n return 'large';\n } else if (height >= 36) {\n return 'big';\n } else if (height >= 24 && !!fontSize && fontSize >= 20) {\n return 'medium';\n } else if (height <= 16) {\n return 'small';\n } else {\n return 'normal';\n }\n}\n\nconst InternalIcon = ({\n name,\n size = 'normal',\n variant = 'normal',\n url,\n alt,\n ariaLabel,\n svg,\n badge,\n nativeAttributes,\n __internalRootRef,\n ...props\n}: InternalIconProps) => {\n const icons = useContext(InternalIconContext);\n const iconRef = useRef<HTMLElement>(null);\n // To ensure a re-render is triggered on visual mode changes\n useVisualRefresh();\n const [parentHeight, setParentHeight] = useState<number | null>(null);\n const [parentFontSize, setParentFontSize] = useState<number | null>(null);\n const contextualSize = size === 'inherit';\n const iconSize = contextualSize ? iconSizeMap(parentHeight, parentFontSize) : size;\n const inlineStyles = contextualSize && parentHeight !== null ? { height: `${parentHeight}px` } : {};\n const baseProps = getBaseProps(props);\n\n baseProps.className = clsx(\n baseProps.className,\n styles.icon,\n contextualSize && styles['icon-flex-height'],\n badge && styles.badge,\n !contextualSize && styles[`size-${iconSize}-mapped-height`],\n styles[`size-${iconSize}`],\n styles[`variant-${variant}`],\n styles[`name-${name}`]\n );\n\n // Possible infinite loop is not a concern here because line\n // height should not change without an external state update.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useLayoutEffect(() => {\n if (!contextualSize || !iconRef.current) {\n return;\n }\n const computedStyle = getComputedStyle(iconRef.current);\n const { lineHeight, fontSize } = computedStyle;\n const newParentHeight = parseInt(lineHeight, 10);\n const newParentFontSize = parseInt(fontSize, 10);\n setParentHeight(newParentHeight);\n setParentFontSize(newParentFontSize);\n });\n\n const mergedRef = useMergeRefs(iconRef, __internalRootRef);\n const hasAriaLabel = typeof ariaLabel === 'string';\n const labelAttributes = hasAriaLabel ? { role: 'img', 'aria-label': ariaLabel } : {};\n\n if (svg) {\n if (url) {\n warnOnce(\n 'Icon',\n 'You have specified both `url` and `svg`. `svg` will take precedence and `url` will be ignored.'\n );\n }\n return (\n <WithNativeAttributes\n {...baseProps}\n {...labelAttributes}\n tag=\"span\"\n componentName=\"Icon\"\n nativeAttributes={nativeAttributes}\n ref={mergedRef}\n aria-hidden={!hasAriaLabel}\n style={inlineStyles}\n >\n {svg}\n </WithNativeAttributes>\n );\n }\n\n if (url) {\n return (\n <WithNativeAttributes\n {...baseProps}\n tag=\"span\"\n componentName=\"Icon\"\n nativeAttributes={nativeAttributes}\n ref={mergedRef}\n style={inlineStyles}\n >\n <img src={url} alt={ariaLabel ?? alt} />\n </WithNativeAttributes>\n );\n }\n\n const validIcon = name && Object.prototype.hasOwnProperty.call(icons, name);\n\n function iconMap(name: IconProps.Name) {\n if (name === 'gen-ai' && iconSize === 'small') {\n return (\n <svg\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 16 16\"\n xmlns=\"http://www.w3.org/2000/svg\"\n focusable=\"false\"\n aria-hidden=\"true\"\n data-testid=\"gen-ai-filled\"\n >\n <path\n d=\"m8 4.4 1.018 2.582L11.6 8 9.018 9.018 8 11.6 6.982 9.018 4.4 8l2.582-1.018L8 4.4ZM2.405 2.41l.002-.003.003-.002-.003-.002-.002-.003-.002.003-.003.002.003.002.002.003Z\"\n className=\"filled\"\n />\n </svg>\n );\n } else {\n const icon = icons[name];\n if (!icon) {\n warnOnce(\n 'Icon',\n `You have specified \\`name=\"${name}\"\\` but no icon with that name was found in the current IconProvider context. If this is a custom icon, ensure your app is wrapped in an \\`IconProvider\\` with the icon defined via \\`defineIcons\\`.`\n );\n }\n return icon;\n }\n }\n\n return (\n <WithNativeAttributes\n {...baseProps}\n {...labelAttributes}\n tag=\"span\"\n componentName=\"Icon\"\n nativeAttributes={nativeAttributes}\n ref={mergedRef}\n style={inlineStyles}\n >\n {validIcon ? iconMap(name) : undefined}\n </WithNativeAttributes>\n );\n};\n\nexport { InternalIconProps };\nexport default InternalIcon;\n"]}
@@ -1,46 +1,44 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "icon": "awsui_icon_h11ix_106m5_189",
5
- "icon-flex-height": "awsui_icon-flex-height_h11ix_106m5_197",
6
- "size-x-small": "awsui_size-x-small_h11ix_106m5_225",
7
- "size-x-small-mapped-height": "awsui_size-x-small-mapped-height_h11ix_106m5_230",
8
- "size-small": "awsui_size-small_h11ix_106m5_245",
9
- "size-small-mapped-height": "awsui_size-small-mapped-height_h11ix_106m5_250",
10
- "size-normal": "awsui_size-normal_h11ix_106m5_265",
11
- "size-normal-mapped-height": "awsui_size-normal-mapped-height_h11ix_106m5_270",
12
- "size-medium": "awsui_size-medium_h11ix_106m5_285",
13
- "size-medium-mapped-height": "awsui_size-medium-mapped-height_h11ix_106m5_290",
14
- "size-big": "awsui_size-big_h11ix_106m5_305",
15
- "size-big-mapped-height": "awsui_size-big-mapped-height_h11ix_106m5_310",
16
- "size-large": "awsui_size-large_h11ix_106m5_325",
17
- "size-large-mapped-height": "awsui_size-large-mapped-height_h11ix_106m5_330",
18
- "variant-normal": "awsui_variant-normal_h11ix_106m5_345",
19
- "variant-disabled": "awsui_variant-disabled_h11ix_106m5_348",
20
- "variant-inverted": "awsui_variant-inverted_h11ix_106m5_351",
21
- "variant-subtle": "awsui_variant-subtle_h11ix_106m5_354",
22
- "variant-warning": "awsui_variant-warning_h11ix_106m5_357",
23
- "variant-error": "awsui_variant-error_h11ix_106m5_360",
24
- "variant-success": "awsui_variant-success_h11ix_106m5_363",
25
- "variant-link": "awsui_variant-link_h11ix_106m5_366",
26
- "name-angle-left-double": "awsui_name-angle-left-double_h11ix_106m5_369",
27
- "name-angle-left": "awsui_name-angle-left_h11ix_106m5_369",
28
- "name-angle-right-double": "awsui_name-angle-right-double_h11ix_106m5_371",
29
- "name-angle-right": "awsui_name-angle-right_h11ix_106m5_371",
30
- "name-arrow-left": "awsui_name-arrow-left_h11ix_106m5_373",
31
- "name-arrow-right": "awsui_name-arrow-right_h11ix_106m5_374",
32
- "name-caret-left-filled": "awsui_name-caret-left-filled_h11ix_106m5_375",
33
- "name-caret-right-filled": "awsui_name-caret-right-filled_h11ix_106m5_376",
34
- "name-audio-full": "awsui_name-audio-full_h11ix_106m5_377",
35
- "name-audio-half": "awsui_name-audio-half_h11ix_106m5_378",
36
- "name-audio-off": "awsui_name-audio-off_h11ix_106m5_379",
37
- "name-external": "awsui_name-external_h11ix_106m5_380",
38
- "name-redo": "awsui_name-redo_h11ix_106m5_381",
39
- "name-resize-area": "awsui_name-resize-area_h11ix_106m5_382",
40
- "name-send": "awsui_name-send_h11ix_106m5_383",
41
- "name-shrink": "awsui_name-shrink_h11ix_106m5_384",
42
- "name-undo": "awsui_name-undo_h11ix_106m5_385",
43
- "name-view-vertical": "awsui_name-view-vertical_h11ix_106m5_386",
44
- "badge": "awsui_badge_h11ix_106m5_410"
4
+ "icon": "awsui_icon_h11ix_y1ugs_189",
5
+ "icon-flex-height": "awsui_icon-flex-height_h11ix_y1ugs_197",
6
+ "size-small": "awsui_size-small_h11ix_y1ugs_225",
7
+ "size-small-mapped-height": "awsui_size-small-mapped-height_h11ix_y1ugs_229",
8
+ "size-normal": "awsui_size-normal_h11ix_y1ugs_244",
9
+ "size-normal-mapped-height": "awsui_size-normal-mapped-height_h11ix_y1ugs_248",
10
+ "size-medium": "awsui_size-medium_h11ix_y1ugs_263",
11
+ "size-medium-mapped-height": "awsui_size-medium-mapped-height_h11ix_y1ugs_267",
12
+ "size-big": "awsui_size-big_h11ix_y1ugs_282",
13
+ "size-big-mapped-height": "awsui_size-big-mapped-height_h11ix_y1ugs_286",
14
+ "size-large": "awsui_size-large_h11ix_y1ugs_301",
15
+ "size-large-mapped-height": "awsui_size-large-mapped-height_h11ix_y1ugs_305",
16
+ "variant-normal": "awsui_variant-normal_h11ix_y1ugs_320",
17
+ "variant-disabled": "awsui_variant-disabled_h11ix_y1ugs_323",
18
+ "variant-inverted": "awsui_variant-inverted_h11ix_y1ugs_326",
19
+ "variant-subtle": "awsui_variant-subtle_h11ix_y1ugs_329",
20
+ "variant-warning": "awsui_variant-warning_h11ix_y1ugs_332",
21
+ "variant-error": "awsui_variant-error_h11ix_y1ugs_335",
22
+ "variant-success": "awsui_variant-success_h11ix_y1ugs_338",
23
+ "variant-link": "awsui_variant-link_h11ix_y1ugs_341",
24
+ "name-angle-left-double": "awsui_name-angle-left-double_h11ix_y1ugs_344",
25
+ "name-angle-left": "awsui_name-angle-left_h11ix_y1ugs_344",
26
+ "name-angle-right-double": "awsui_name-angle-right-double_h11ix_y1ugs_346",
27
+ "name-angle-right": "awsui_name-angle-right_h11ix_y1ugs_346",
28
+ "name-arrow-left": "awsui_name-arrow-left_h11ix_y1ugs_348",
29
+ "name-arrow-right": "awsui_name-arrow-right_h11ix_y1ugs_349",
30
+ "name-caret-left-filled": "awsui_name-caret-left-filled_h11ix_y1ugs_350",
31
+ "name-caret-right-filled": "awsui_name-caret-right-filled_h11ix_y1ugs_351",
32
+ "name-audio-full": "awsui_name-audio-full_h11ix_y1ugs_352",
33
+ "name-audio-half": "awsui_name-audio-half_h11ix_y1ugs_353",
34
+ "name-audio-off": "awsui_name-audio-off_h11ix_y1ugs_354",
35
+ "name-external": "awsui_name-external_h11ix_y1ugs_355",
36
+ "name-redo": "awsui_name-redo_h11ix_y1ugs_356",
37
+ "name-resize-area": "awsui_name-resize-area_h11ix_y1ugs_357",
38
+ "name-send": "awsui_name-send_h11ix_y1ugs_358",
39
+ "name-shrink": "awsui_name-shrink_h11ix_y1ugs_359",
40
+ "name-undo": "awsui_name-undo_h11ix_y1ugs_360",
41
+ "name-view-vertical": "awsui_name-view-vertical_h11ix_y1ugs_361",
42
+ "badge": "awsui_badge_h11ix_y1ugs_385"
45
43
  };
46
44
 
@@ -186,7 +186,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
186
186
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
187
187
  SPDX-License-Identifier: Apache-2.0
188
188
  */
189
- .awsui_icon_h11ix_106m5_189:not(#\9) {
189
+ .awsui_icon_h11ix_y1ugs_189:not(#\9) {
190
190
  position: relative;
191
191
  display: inline-block;
192
192
  vertical-align: top;
@@ -194,220 +194,195 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
194
194
  /* stylelint-disable selector-max-type, selector-max-universal */
195
195
  /* stylelint-enable selector-max-type, selector-max-universal */
196
196
  }
197
- .awsui_icon-flex-height_h11ix_106m5_197:not(#\9) {
197
+ .awsui_icon-flex-height_h11ix_y1ugs_197:not(#\9) {
198
198
  display: inline-flex;
199
199
  align-items: center;
200
200
  }
201
- .awsui_icon_h11ix_106m5_189 > svg:not(#\9) {
201
+ .awsui_icon_h11ix_y1ugs_189 > svg:not(#\9) {
202
202
  pointer-events: none;
203
203
  }
204
- .awsui_icon_h11ix_106m5_189 > svg:not(#\9) {
204
+ .awsui_icon_h11ix_y1ugs_189 > svg:not(#\9) {
205
205
  fill: none;
206
206
  }
207
- .awsui_icon_h11ix_106m5_189 > svg *:not(#\9) {
207
+ .awsui_icon_h11ix_y1ugs_189 > svg *:not(#\9) {
208
208
  stroke: currentColor;
209
209
  }
210
- .awsui_icon_h11ix_106m5_189 > svg .stroke-linejoin-round:not(#\9) {
210
+ .awsui_icon_h11ix_y1ugs_189 > svg .stroke-linejoin-round:not(#\9) {
211
211
  stroke-linejoin: round;
212
212
  }
213
- .awsui_icon_h11ix_106m5_189 > svg .stroke-linecap-square:not(#\9) {
213
+ .awsui_icon_h11ix_y1ugs_189 > svg .stroke-linecap-square:not(#\9) {
214
214
  stroke-linecap: square;
215
215
  }
216
- .awsui_icon_h11ix_106m5_189 > svg .stroke-linecap-round:not(#\9) {
216
+ .awsui_icon_h11ix_y1ugs_189 > svg .stroke-linecap-round:not(#\9) {
217
217
  stroke-linecap: round;
218
218
  }
219
- .awsui_icon_h11ix_106m5_189 > svg .filled:not(#\9) {
219
+ .awsui_icon_h11ix_y1ugs_189 > svg .filled:not(#\9) {
220
220
  fill: currentColor;
221
221
  }
222
- .awsui_icon_h11ix_106m5_189 > svg .no-stroke:not(#\9) {
222
+ .awsui_icon_h11ix_y1ugs_189 > svg .no-stroke:not(#\9) {
223
223
  stroke: none;
224
224
  }
225
- .awsui_icon_h11ix_106m5_189.awsui_size-x-small_h11ix_106m5_225:not(#\9) {
226
- inline-size: var(--awsui-icon-size-override-jsjyte, var(--size-icon-x-small-bajx8s, 12px));
227
- block-size: max(var(--size-icon-x-small-bajx8s, 12px), var(--awsui-icon-size-override-jsjyte, var(--size-icon-x-small-bajx8s, 12px)));
225
+ .awsui_icon_h11ix_y1ugs_189.awsui_size-small_h11ix_y1ugs_225:not(#\9) {
226
+ inline-size: var(--size-icon-normal-levt08, 16px);
228
227
  box-sizing: border-box;
229
228
  }
230
- .awsui_icon_h11ix_106m5_189.awsui_size-x-small-mapped-height_h11ix_106m5_230:not(#\9) {
231
- block-size: max(var(--line-height-body-s-nu5hx1, 16px), var(--awsui-icon-size-override-jsjyte, var(--size-icon-x-small-bajx8s, 12px)));
232
- padding-block: calc((var(--line-height-body-s-nu5hx1, 16px) - var(--size-icon-x-small-bajx8s, 12px)) / 2);
233
- padding-inline: 0;
234
- }
235
- .awsui_icon_h11ix_106m5_189.awsui_size-x-small_h11ix_106m5_225 > svg:not(#\9),
236
- .awsui_icon_h11ix_106m5_189.awsui_size-x-small_h11ix_106m5_225 > img:not(#\9) {
237
- inline-size: var(--awsui-icon-size-override-jsjyte, var(--size-icon-x-small-bajx8s, 12px));
238
- block-size: max(var(--size-icon-x-small-bajx8s, 12px), var(--awsui-icon-size-override-jsjyte, var(--size-icon-x-small-bajx8s, 12px)));
239
- vertical-align: top;
240
- }
241
- .awsui_icon_h11ix_106m5_189.awsui_size-x-small_h11ix_106m5_225 > svg:not(#\9),
242
- .awsui_icon_h11ix_106m5_189.awsui_size-x-small_h11ix_106m5_225 > svg *:not(#\9) {
243
- stroke-width: var(--awsui-icon-stroke-width-override-jsjyte, calc(var(--border-width-icon-x-small-45lnog, 1.5px) / 0.75 * var(--awsui-icon-stroke-scale-jsjyte, 1)));
244
- }
245
- .awsui_icon_h11ix_106m5_189.awsui_size-small_h11ix_106m5_245:not(#\9) {
246
- inline-size: var(--awsui-icon-size-override-jsjyte, var(--size-icon-normal-levt08, 16px));
247
- block-size: max(var(--size-icon-normal-levt08, 16px), var(--awsui-icon-size-override-jsjyte, var(--size-icon-normal-levt08, 16px)));
248
- box-sizing: border-box;
249
- }
250
- .awsui_icon_h11ix_106m5_189.awsui_size-small-mapped-height_h11ix_106m5_250:not(#\9) {
251
- block-size: max(var(--line-height-body-s-nu5hx1, 16px), var(--awsui-icon-size-override-jsjyte, var(--size-icon-normal-levt08, 16px)));
229
+ .awsui_icon_h11ix_y1ugs_189.awsui_size-small-mapped-height_h11ix_y1ugs_229:not(#\9) {
230
+ block-size: var(--line-height-body-s-nu5hx1, 16px);
252
231
  padding-block: calc((var(--line-height-body-s-nu5hx1, 16px) - var(--size-icon-normal-levt08, 16px)) / 2);
253
232
  padding-inline: 0;
254
233
  }
255
- .awsui_icon_h11ix_106m5_189.awsui_size-small_h11ix_106m5_245 > svg:not(#\9),
256
- .awsui_icon_h11ix_106m5_189.awsui_size-small_h11ix_106m5_245 > img:not(#\9) {
257
- inline-size: var(--awsui-icon-size-override-jsjyte, var(--size-icon-normal-levt08, 16px));
258
- block-size: max(var(--size-icon-normal-levt08, 16px), var(--awsui-icon-size-override-jsjyte, var(--size-icon-normal-levt08, 16px)));
234
+ .awsui_icon_h11ix_y1ugs_189.awsui_size-small_h11ix_y1ugs_225 > svg:not(#\9),
235
+ .awsui_icon_h11ix_y1ugs_189.awsui_size-small_h11ix_y1ugs_225 > img:not(#\9) {
236
+ inline-size: var(--size-icon-normal-levt08, 16px);
237
+ block-size: var(--size-icon-normal-levt08, 16px);
259
238
  vertical-align: top;
260
239
  }
261
- .awsui_icon_h11ix_106m5_189.awsui_size-small_h11ix_106m5_245 > svg:not(#\9),
262
- .awsui_icon_h11ix_106m5_189.awsui_size-small_h11ix_106m5_245 > svg *:not(#\9) {
263
- stroke-width: var(--awsui-icon-stroke-width-override-jsjyte, calc(var(--border-width-icon-small-z55i5t, 2px) / 1 * var(--awsui-icon-stroke-scale-jsjyte, 1)));
240
+ .awsui_icon_h11ix_y1ugs_189.awsui_size-small_h11ix_y1ugs_225 > svg:not(#\9),
241
+ .awsui_icon_h11ix_y1ugs_189.awsui_size-small_h11ix_y1ugs_225 > svg *:not(#\9) {
242
+ stroke-width: calc(var(--border-width-icon-small-z55i5t, 2px) / 1);
264
243
  }
265
- .awsui_icon_h11ix_106m5_189.awsui_size-normal_h11ix_106m5_265:not(#\9) {
266
- inline-size: var(--awsui-icon-size-override-jsjyte, var(--size-icon-normal-levt08, 16px));
267
- block-size: max(var(--size-icon-normal-levt08, 16px), var(--awsui-icon-size-override-jsjyte, var(--size-icon-normal-levt08, 16px)));
244
+ .awsui_icon_h11ix_y1ugs_189.awsui_size-normal_h11ix_y1ugs_244:not(#\9) {
245
+ inline-size: var(--size-icon-normal-levt08, 16px);
268
246
  box-sizing: border-box;
269
247
  }
270
- .awsui_icon_h11ix_106m5_189.awsui_size-normal-mapped-height_h11ix_106m5_270:not(#\9) {
271
- block-size: max(var(--line-height-body-m-2mh3ke, 20px), var(--awsui-icon-size-override-jsjyte, var(--size-icon-normal-levt08, 16px)));
248
+ .awsui_icon_h11ix_y1ugs_189.awsui_size-normal-mapped-height_h11ix_y1ugs_248:not(#\9) {
249
+ block-size: var(--line-height-body-m-2mh3ke, 20px);
272
250
  padding-block: calc((var(--line-height-body-m-2mh3ke, 20px) - var(--size-icon-normal-levt08, 16px)) / 2);
273
251
  padding-inline: 0;
274
252
  }
275
- .awsui_icon_h11ix_106m5_189.awsui_size-normal_h11ix_106m5_265 > svg:not(#\9),
276
- .awsui_icon_h11ix_106m5_189.awsui_size-normal_h11ix_106m5_265 > img:not(#\9) {
277
- inline-size: var(--awsui-icon-size-override-jsjyte, var(--size-icon-normal-levt08, 16px));
278
- block-size: max(var(--size-icon-normal-levt08, 16px), var(--awsui-icon-size-override-jsjyte, var(--size-icon-normal-levt08, 16px)));
253
+ .awsui_icon_h11ix_y1ugs_189.awsui_size-normal_h11ix_y1ugs_244 > svg:not(#\9),
254
+ .awsui_icon_h11ix_y1ugs_189.awsui_size-normal_h11ix_y1ugs_244 > img:not(#\9) {
255
+ inline-size: var(--size-icon-normal-levt08, 16px);
256
+ block-size: var(--size-icon-normal-levt08, 16px);
279
257
  vertical-align: top;
280
258
  }
281
- .awsui_icon_h11ix_106m5_189.awsui_size-normal_h11ix_106m5_265 > svg:not(#\9),
282
- .awsui_icon_h11ix_106m5_189.awsui_size-normal_h11ix_106m5_265 > svg *:not(#\9) {
283
- stroke-width: var(--awsui-icon-stroke-width-override-jsjyte, calc(var(--border-width-icon-normal-9h7vj7, 2px) / 1 * var(--awsui-icon-stroke-scale-jsjyte, 1)));
259
+ .awsui_icon_h11ix_y1ugs_189.awsui_size-normal_h11ix_y1ugs_244 > svg:not(#\9),
260
+ .awsui_icon_h11ix_y1ugs_189.awsui_size-normal_h11ix_y1ugs_244 > svg *:not(#\9) {
261
+ stroke-width: calc(var(--border-width-icon-normal-9h7vj7, 2px) / 1);
284
262
  }
285
- .awsui_icon_h11ix_106m5_189.awsui_size-medium_h11ix_106m5_285:not(#\9) {
286
- inline-size: var(--awsui-icon-size-override-jsjyte, var(--size-icon-medium-uv8xcz, 20px));
287
- block-size: max(var(--size-icon-medium-uv8xcz, 20px), var(--awsui-icon-size-override-jsjyte, var(--size-icon-medium-uv8xcz, 20px)));
263
+ .awsui_icon_h11ix_y1ugs_189.awsui_size-medium_h11ix_y1ugs_263:not(#\9) {
264
+ inline-size: var(--size-icon-medium-uv8xcz, 20px);
288
265
  box-sizing: border-box;
289
266
  }
290
- .awsui_icon_h11ix_106m5_189.awsui_size-medium-mapped-height_h11ix_106m5_290:not(#\9) {
291
- block-size: max(var(--line-height-heading-l-mg5bx6, 24px), var(--awsui-icon-size-override-jsjyte, var(--size-icon-medium-uv8xcz, 20px)));
267
+ .awsui_icon_h11ix_y1ugs_189.awsui_size-medium-mapped-height_h11ix_y1ugs_267:not(#\9) {
268
+ block-size: var(--line-height-heading-l-mg5bx6, 24px);
292
269
  padding-block: calc((var(--line-height-heading-l-mg5bx6, 24px) - var(--size-icon-medium-uv8xcz, 20px)) / 2);
293
270
  padding-inline: 0;
294
271
  }
295
- .awsui_icon_h11ix_106m5_189.awsui_size-medium_h11ix_106m5_285 > svg:not(#\9),
296
- .awsui_icon_h11ix_106m5_189.awsui_size-medium_h11ix_106m5_285 > img:not(#\9) {
297
- inline-size: var(--awsui-icon-size-override-jsjyte, var(--size-icon-medium-uv8xcz, 20px));
298
- block-size: max(var(--size-icon-medium-uv8xcz, 20px), var(--awsui-icon-size-override-jsjyte, var(--size-icon-medium-uv8xcz, 20px)));
272
+ .awsui_icon_h11ix_y1ugs_189.awsui_size-medium_h11ix_y1ugs_263 > svg:not(#\9),
273
+ .awsui_icon_h11ix_y1ugs_189.awsui_size-medium_h11ix_y1ugs_263 > img:not(#\9) {
274
+ inline-size: var(--size-icon-medium-uv8xcz, 20px);
275
+ block-size: var(--size-icon-medium-uv8xcz, 20px);
299
276
  vertical-align: top;
300
277
  }
301
- .awsui_icon_h11ix_106m5_189.awsui_size-medium_h11ix_106m5_285 > svg:not(#\9),
302
- .awsui_icon_h11ix_106m5_189.awsui_size-medium_h11ix_106m5_285 > svg *:not(#\9) {
303
- stroke-width: var(--awsui-icon-stroke-width-override-jsjyte, calc(var(--border-width-icon-medium-b7icqv, 2px) / 1.25 * var(--awsui-icon-stroke-scale-jsjyte, 1)));
278
+ .awsui_icon_h11ix_y1ugs_189.awsui_size-medium_h11ix_y1ugs_263 > svg:not(#\9),
279
+ .awsui_icon_h11ix_y1ugs_189.awsui_size-medium_h11ix_y1ugs_263 > svg *:not(#\9) {
280
+ stroke-width: calc(var(--border-width-icon-medium-b7icqv, 2px) / 1.25);
304
281
  }
305
- .awsui_icon_h11ix_106m5_189.awsui_size-big_h11ix_106m5_305:not(#\9) {
306
- inline-size: var(--awsui-icon-size-override-jsjyte, var(--size-icon-big-7pq9l3, 32px));
307
- block-size: max(var(--size-icon-big-7pq9l3, 32px), var(--awsui-icon-size-override-jsjyte, var(--size-icon-big-7pq9l3, 32px)));
282
+ .awsui_icon_h11ix_y1ugs_189.awsui_size-big_h11ix_y1ugs_282:not(#\9) {
283
+ inline-size: var(--size-icon-big-7pq9l3, 32px);
308
284
  box-sizing: border-box;
309
285
  }
310
- .awsui_icon_h11ix_106m5_189.awsui_size-big-mapped-height_h11ix_106m5_310:not(#\9) {
311
- block-size: max(var(--line-height-heading-xl-hko6p0, 30px), var(--awsui-icon-size-override-jsjyte, var(--size-icon-big-7pq9l3, 32px)));
286
+ .awsui_icon_h11ix_y1ugs_189.awsui_size-big-mapped-height_h11ix_y1ugs_286:not(#\9) {
287
+ block-size: var(--line-height-heading-xl-hko6p0, 30px);
312
288
  padding-block: calc((var(--line-height-heading-xl-hko6p0, 30px) - var(--size-icon-big-7pq9l3, 32px)) / 2);
313
289
  padding-inline: 0;
314
290
  }
315
- .awsui_icon_h11ix_106m5_189.awsui_size-big_h11ix_106m5_305 > svg:not(#\9),
316
- .awsui_icon_h11ix_106m5_189.awsui_size-big_h11ix_106m5_305 > img:not(#\9) {
317
- inline-size: var(--awsui-icon-size-override-jsjyte, var(--size-icon-big-7pq9l3, 32px));
318
- block-size: max(var(--size-icon-big-7pq9l3, 32px), var(--awsui-icon-size-override-jsjyte, var(--size-icon-big-7pq9l3, 32px)));
291
+ .awsui_icon_h11ix_y1ugs_189.awsui_size-big_h11ix_y1ugs_282 > svg:not(#\9),
292
+ .awsui_icon_h11ix_y1ugs_189.awsui_size-big_h11ix_y1ugs_282 > img:not(#\9) {
293
+ inline-size: var(--size-icon-big-7pq9l3, 32px);
294
+ block-size: var(--size-icon-big-7pq9l3, 32px);
319
295
  vertical-align: top;
320
296
  }
321
- .awsui_icon_h11ix_106m5_189.awsui_size-big_h11ix_106m5_305 > svg:not(#\9),
322
- .awsui_icon_h11ix_106m5_189.awsui_size-big_h11ix_106m5_305 > svg *:not(#\9) {
323
- stroke-width: var(--awsui-icon-stroke-width-override-jsjyte, calc(var(--border-width-icon-big-ymgy42, 3px) / 2 * var(--awsui-icon-stroke-scale-jsjyte, 1)));
297
+ .awsui_icon_h11ix_y1ugs_189.awsui_size-big_h11ix_y1ugs_282 > svg:not(#\9),
298
+ .awsui_icon_h11ix_y1ugs_189.awsui_size-big_h11ix_y1ugs_282 > svg *:not(#\9) {
299
+ stroke-width: calc(var(--border-width-icon-big-ymgy42, 3px) / 2);
324
300
  }
325
- .awsui_icon_h11ix_106m5_189.awsui_size-large_h11ix_106m5_325:not(#\9) {
326
- inline-size: var(--awsui-icon-size-override-jsjyte, var(--size-icon-large-mb6y6y, 48px));
327
- block-size: max(var(--size-icon-large-mb6y6y, 48px), var(--awsui-icon-size-override-jsjyte, var(--size-icon-large-mb6y6y, 48px)));
301
+ .awsui_icon_h11ix_y1ugs_189.awsui_size-large_h11ix_y1ugs_301:not(#\9) {
302
+ inline-size: var(--size-icon-large-mb6y6y, 48px);
328
303
  box-sizing: border-box;
329
304
  }
330
- .awsui_icon_h11ix_106m5_189.awsui_size-large-mapped-height_h11ix_106m5_330:not(#\9) {
331
- block-size: max(var(--line-height-display-l-vwanzp, 48px), var(--awsui-icon-size-override-jsjyte, var(--size-icon-large-mb6y6y, 48px)));
305
+ .awsui_icon_h11ix_y1ugs_189.awsui_size-large-mapped-height_h11ix_y1ugs_305:not(#\9) {
306
+ block-size: var(--line-height-display-l-vwanzp, 48px);
332
307
  padding-block: calc((var(--line-height-display-l-vwanzp, 48px) - var(--size-icon-large-mb6y6y, 48px)) / 2);
333
308
  padding-inline: 0;
334
309
  }
335
- .awsui_icon_h11ix_106m5_189.awsui_size-large_h11ix_106m5_325 > svg:not(#\9),
336
- .awsui_icon_h11ix_106m5_189.awsui_size-large_h11ix_106m5_325 > img:not(#\9) {
337
- inline-size: var(--awsui-icon-size-override-jsjyte, var(--size-icon-large-mb6y6y, 48px));
338
- block-size: max(var(--size-icon-large-mb6y6y, 48px), var(--awsui-icon-size-override-jsjyte, var(--size-icon-large-mb6y6y, 48px)));
310
+ .awsui_icon_h11ix_y1ugs_189.awsui_size-large_h11ix_y1ugs_301 > svg:not(#\9),
311
+ .awsui_icon_h11ix_y1ugs_189.awsui_size-large_h11ix_y1ugs_301 > img:not(#\9) {
312
+ inline-size: var(--size-icon-large-mb6y6y, 48px);
313
+ block-size: var(--size-icon-large-mb6y6y, 48px);
339
314
  vertical-align: top;
340
315
  }
341
- .awsui_icon_h11ix_106m5_189.awsui_size-large_h11ix_106m5_325 > svg:not(#\9),
342
- .awsui_icon_h11ix_106m5_189.awsui_size-large_h11ix_106m5_325 > svg *:not(#\9) {
343
- stroke-width: var(--awsui-icon-stroke-width-override-jsjyte, calc(var(--border-width-icon-large-u645rg, 4px) / 3 * var(--awsui-icon-stroke-scale-jsjyte, 1)));
316
+ .awsui_icon_h11ix_y1ugs_189.awsui_size-large_h11ix_y1ugs_301 > svg:not(#\9),
317
+ .awsui_icon_h11ix_y1ugs_189.awsui_size-large_h11ix_y1ugs_301 > svg *:not(#\9) {
318
+ stroke-width: calc(var(--border-width-icon-large-u645rg, 4px) / 3);
344
319
  }
345
- .awsui_icon_h11ix_106m5_189.awsui_variant-normal_h11ix_106m5_345:not(#\9) {
320
+ .awsui_icon_h11ix_y1ugs_189.awsui_variant-normal_h11ix_y1ugs_320:not(#\9) {
346
321
  color: currentColor;
347
322
  }
348
- .awsui_icon_h11ix_106m5_189.awsui_variant-disabled_h11ix_106m5_348:not(#\9) {
323
+ .awsui_icon_h11ix_y1ugs_189.awsui_variant-disabled_h11ix_y1ugs_323:not(#\9) {
349
324
  color: var(--color-text-interactive-disabled-1bqmrl, #b4b4bb);
350
325
  }
351
- .awsui_icon_h11ix_106m5_189.awsui_variant-inverted_h11ix_106m5_351:not(#\9) {
326
+ .awsui_icon_h11ix_y1ugs_189.awsui_variant-inverted_h11ix_y1ugs_326:not(#\9) {
352
327
  color: var(--color-text-inverted-4v4dmq, #ffffff);
353
328
  }
354
- .awsui_icon_h11ix_106m5_189.awsui_variant-subtle_h11ix_106m5_354:not(#\9) {
329
+ .awsui_icon_h11ix_y1ugs_189.awsui_variant-subtle_h11ix_y1ugs_329:not(#\9) {
355
330
  color: var(--color-text-icon-subtle-3sgxlr, #656871);
356
331
  }
357
- .awsui_icon_h11ix_106m5_189.awsui_variant-warning_h11ix_106m5_357:not(#\9) {
332
+ .awsui_icon_h11ix_y1ugs_189.awsui_variant-warning_h11ix_y1ugs_332:not(#\9) {
358
333
  color: var(--color-text-status-warning-6meo06, #855900);
359
334
  }
360
- .awsui_icon_h11ix_106m5_189.awsui_variant-error_h11ix_106m5_360:not(#\9) {
335
+ .awsui_icon_h11ix_y1ugs_189.awsui_variant-error_h11ix_y1ugs_335:not(#\9) {
361
336
  color: var(--color-text-status-error-ksqavh, #db0000);
362
337
  }
363
- .awsui_icon_h11ix_106m5_189.awsui_variant-success_h11ix_106m5_363:not(#\9) {
338
+ .awsui_icon_h11ix_y1ugs_189.awsui_variant-success_h11ix_y1ugs_338:not(#\9) {
364
339
  color: var(--color-text-status-success-ybmii8, #00802f);
365
340
  }
366
- .awsui_icon_h11ix_106m5_189.awsui_variant-link_h11ix_106m5_366:not(#\9) {
341
+ .awsui_icon_h11ix_y1ugs_189.awsui_variant-link_h11ix_y1ugs_341:not(#\9) {
367
342
  color: var(--color-text-link-default-hude44, #006ce0);
368
343
  }
369
- .awsui_icon_h11ix_106m5_189:not(#\9):is(.awsui_name-angle-left-double_h11ix_106m5_369,
370
- .awsui_name-angle-left_h11ix_106m5_369,
371
- .awsui_name-angle-right-double_h11ix_106m5_371,
372
- .awsui_name-angle-right_h11ix_106m5_371,
373
- .awsui_name-arrow-left_h11ix_106m5_373,
374
- .awsui_name-arrow-right_h11ix_106m5_374,
375
- .awsui_name-caret-left-filled_h11ix_106m5_375,
376
- .awsui_name-caret-right-filled_h11ix_106m5_376,
377
- .awsui_name-audio-full_h11ix_106m5_377,
378
- .awsui_name-audio-half_h11ix_106m5_378,
379
- .awsui_name-audio-off_h11ix_106m5_379,
380
- .awsui_name-external_h11ix_106m5_380,
381
- .awsui_name-redo_h11ix_106m5_381,
382
- .awsui_name-resize-area_h11ix_106m5_382,
383
- .awsui_name-send_h11ix_106m5_383,
384
- .awsui_name-shrink_h11ix_106m5_384,
385
- .awsui_name-undo_h11ix_106m5_385,
386
- .awsui_name-view-vertical_h11ix_106m5_386) {
344
+ .awsui_icon_h11ix_y1ugs_189:not(#\9):is(.awsui_name-angle-left-double_h11ix_y1ugs_344,
345
+ .awsui_name-angle-left_h11ix_y1ugs_344,
346
+ .awsui_name-angle-right-double_h11ix_y1ugs_346,
347
+ .awsui_name-angle-right_h11ix_y1ugs_346,
348
+ .awsui_name-arrow-left_h11ix_y1ugs_348,
349
+ .awsui_name-arrow-right_h11ix_y1ugs_349,
350
+ .awsui_name-caret-left-filled_h11ix_y1ugs_350,
351
+ .awsui_name-caret-right-filled_h11ix_y1ugs_351,
352
+ .awsui_name-audio-full_h11ix_y1ugs_352,
353
+ .awsui_name-audio-half_h11ix_y1ugs_353,
354
+ .awsui_name-audio-off_h11ix_y1ugs_354,
355
+ .awsui_name-external_h11ix_y1ugs_355,
356
+ .awsui_name-redo_h11ix_y1ugs_356,
357
+ .awsui_name-resize-area_h11ix_y1ugs_357,
358
+ .awsui_name-send_h11ix_y1ugs_358,
359
+ .awsui_name-shrink_h11ix_y1ugs_359,
360
+ .awsui_name-undo_h11ix_y1ugs_360,
361
+ .awsui_name-view-vertical_h11ix_y1ugs_361) {
387
362
  /* stylelint-disable-next-line plugin/no-unsupported-browser-features */
388
363
  }
389
- .awsui_icon_h11ix_106m5_189:not(#\9):is(.awsui_name-angle-left-double_h11ix_106m5_369,
390
- .awsui_name-angle-left_h11ix_106m5_369,
391
- .awsui_name-angle-right-double_h11ix_106m5_371,
392
- .awsui_name-angle-right_h11ix_106m5_371,
393
- .awsui_name-arrow-left_h11ix_106m5_373,
394
- .awsui_name-arrow-right_h11ix_106m5_374,
395
- .awsui_name-caret-left-filled_h11ix_106m5_375,
396
- .awsui_name-caret-right-filled_h11ix_106m5_376,
397
- .awsui_name-audio-full_h11ix_106m5_377,
398
- .awsui_name-audio-half_h11ix_106m5_378,
399
- .awsui_name-audio-off_h11ix_106m5_379,
400
- .awsui_name-external_h11ix_106m5_380,
401
- .awsui_name-redo_h11ix_106m5_381,
402
- .awsui_name-resize-area_h11ix_106m5_382,
403
- .awsui_name-send_h11ix_106m5_383,
404
- .awsui_name-shrink_h11ix_106m5_384,
405
- .awsui_name-undo_h11ix_106m5_385,
406
- .awsui_name-view-vertical_h11ix_106m5_386):dir(rtl) {
364
+ .awsui_icon_h11ix_y1ugs_189:not(#\9):is(.awsui_name-angle-left-double_h11ix_y1ugs_344,
365
+ .awsui_name-angle-left_h11ix_y1ugs_344,
366
+ .awsui_name-angle-right-double_h11ix_y1ugs_346,
367
+ .awsui_name-angle-right_h11ix_y1ugs_346,
368
+ .awsui_name-arrow-left_h11ix_y1ugs_348,
369
+ .awsui_name-arrow-right_h11ix_y1ugs_349,
370
+ .awsui_name-caret-left-filled_h11ix_y1ugs_350,
371
+ .awsui_name-caret-right-filled_h11ix_y1ugs_351,
372
+ .awsui_name-audio-full_h11ix_y1ugs_352,
373
+ .awsui_name-audio-half_h11ix_y1ugs_353,
374
+ .awsui_name-audio-off_h11ix_y1ugs_354,
375
+ .awsui_name-external_h11ix_y1ugs_355,
376
+ .awsui_name-redo_h11ix_y1ugs_356,
377
+ .awsui_name-resize-area_h11ix_y1ugs_357,
378
+ .awsui_name-send_h11ix_y1ugs_358,
379
+ .awsui_name-shrink_h11ix_y1ugs_359,
380
+ .awsui_name-undo_h11ix_y1ugs_360,
381
+ .awsui_name-view-vertical_h11ix_y1ugs_361):dir(rtl) {
407
382
  transform: scaleX(-1);
408
383
  }
409
384
 
410
- .awsui_badge_h11ix_106m5_410:not(#\9)::after {
385
+ .awsui_badge_h11ix_y1ugs_385:not(#\9)::after {
411
386
  content: "";
412
387
  position: absolute;
413
388
  inline-size: 6px;