@cloudscape-design/components 3.0.1304 → 3.0.1305
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.
- package/alert/styles.css.js +27 -27
- package/alert/styles.scoped.css +50 -50
- package/alert/styles.selectors.js +27 -27
- package/annotation-context/annotation/styles.css.js +13 -13
- package/annotation-context/annotation/styles.scoped.css +21 -21
- package/annotation-context/annotation/styles.selectors.js +13 -13
- package/app-layout/notifications/styles.css.js +3 -3
- package/app-layout/notifications/styles.scoped.css +7 -7
- package/app-layout/notifications/styles.selectors.js +3 -3
- package/app-layout/visual-refresh/styles.css.js +86 -86
- package/app-layout/visual-refresh/styles.scoped.css +258 -258
- package/app-layout/visual-refresh/styles.selectors.js +86 -86
- package/app-layout/visual-refresh-toolbar/drawer/styles.css.js +32 -32
- package/app-layout/visual-refresh-toolbar/drawer/styles.scoped.css +89 -89
- package/app-layout/visual-refresh-toolbar/drawer/styles.selectors.js +32 -32
- package/app-layout/visual-refresh-toolbar/navigation/styles.css.js +4 -4
- package/app-layout/visual-refresh-toolbar/navigation/styles.scoped.css +7 -7
- package/app-layout/visual-refresh-toolbar/navigation/styles.selectors.js +4 -4
- package/app-layout/visual-refresh-toolbar/skeleton/styles.css.js +29 -27
- package/app-layout/visual-refresh-toolbar/skeleton/styles.scoped.css +123 -54
- package/app-layout/visual-refresh-toolbar/skeleton/styles.selectors.js +29 -27
- package/app-layout/visual-refresh-toolbar/state/props-merger.js +3 -3
- package/app-layout/visual-refresh-toolbar/state/props-merger.js.map +1 -1
- package/app-layout/visual-refresh-toolbar/state/use-app-layout.d.ts.map +1 -1
- package/app-layout/visual-refresh-toolbar/state/use-app-layout.js +2 -1
- package/app-layout/visual-refresh-toolbar/state/use-app-layout.js.map +1 -1
- package/app-layout/visual-refresh-toolbar/widget-areas/before-main-slot.d.ts.map +1 -1
- package/app-layout/visual-refresh-toolbar/widget-areas/before-main-slot.js +5 -0
- package/app-layout/visual-refresh-toolbar/widget-areas/before-main-slot.js.map +1 -1
- package/attribute-editor/styles.css.js +15 -15
- package/attribute-editor/styles.scoped.css +28 -28
- package/attribute-editor/styles.selectors.js +15 -15
- package/breadcrumb-group/item/styles.css.js +7 -7
- package/breadcrumb-group/item/styles.scoped.css +28 -28
- package/breadcrumb-group/item/styles.selectors.js +7 -7
- package/button/styles.css.js +22 -22
- package/button/styles.scoped.css +256 -256
- package/button/styles.selectors.js +22 -22
- package/button-dropdown/item-element/styles.css.js +21 -21
- package/button-dropdown/item-element/styles.scoped.css +37 -37
- package/button-dropdown/item-element/styles.selectors.js +21 -21
- package/calendar/styles.css.js +21 -21
- package/calendar/styles.scoped.css +44 -44
- package/calendar/styles.selectors.js +21 -21
- package/checkbox/styles.css.js +3 -3
- package/checkbox/styles.scoped.css +11 -11
- package/checkbox/styles.selectors.js +3 -3
- package/content-layout/styles.css.js +14 -14
- package/content-layout/styles.scoped.css +27 -27
- package/content-layout/styles.selectors.js +14 -14
- package/date-range-picker/calendar/grids/styles.css.js +30 -30
- package/date-range-picker/calendar/grids/styles.scoped.css +56 -56
- package/date-range-picker/calendar/grids/styles.selectors.js +30 -30
- package/dropdown/styles.css.js +20 -20
- package/dropdown/styles.scoped.css +49 -49
- package/dropdown/styles.selectors.js +20 -20
- package/expandable-section/styles.css.js +35 -35
- package/expandable-section/styles.scoped.css +66 -68
- package/expandable-section/styles.selectors.js +35 -35
- package/file-token-group/styles.css.js +23 -23
- package/file-token-group/styles.scoped.css +36 -36
- package/file-token-group/styles.selectors.js +23 -23
- package/flashbar/styles.css.js +50 -50
- package/flashbar/styles.scoped.css +187 -187
- package/flashbar/styles.selectors.js +50 -50
- package/help-panel/styles.css.js +6 -6
- package/help-panel/styles.scoped.css +73 -73
- package/help-panel/styles.selectors.js +6 -6
- package/icon/interfaces.d.ts +1 -1
- package/icon/interfaces.d.ts.map +1 -1
- package/icon/interfaces.js.map +1 -1
- package/icon/internal.d.ts.map +1 -1
- package/icon/internal.js +4 -86
- package/icon/internal.js.map +1 -1
- package/icon/styles.css.js +39 -41
- package/icon/styles.scoped.css +110 -135
- package/icon/styles.selectors.js +39 -41
- package/icon-provider/context.d.ts +3 -34
- package/icon-provider/context.d.ts.map +1 -1
- package/icon-provider/context.js +3 -7
- package/icon-provider/context.js.map +1 -1
- package/icon-provider/index.d.ts +0 -3
- package/icon-provider/index.d.ts.map +1 -1
- package/icon-provider/index.js +0 -3
- package/icon-provider/index.js.map +1 -1
- package/icon-provider/interfaces.d.ts +0 -52
- package/icon-provider/interfaces.d.ts.map +1 -1
- package/icon-provider/interfaces.js.map +1 -1
- package/icon-provider/internal.d.ts +1 -3
- package/icon-provider/internal.d.ts.map +1 -1
- package/icon-provider/internal.js +4 -13
- package/icon-provider/internal.js.map +1 -1
- package/input/styles.css.js +18 -18
- package/input/styles.scoped.css +82 -82
- package/input/styles.selectors.js +18 -18
- package/internal/base-component/styles.scoped.css +17 -8
- package/internal/components/drag-handle-wrapper/styles.css.js +30 -30
- package/internal/components/drag-handle-wrapper/styles.scoped.css +58 -58
- package/internal/components/drag-handle-wrapper/styles.selectors.js +30 -30
- package/internal/components/radio-button/styles.css.js +7 -7
- package/internal/components/radio-button/styles.scoped.css +18 -18
- package/internal/components/radio-button/styles.selectors.js +7 -7
- package/internal/components/token-list/styles.css.js +10 -10
- package/internal/components/token-list/styles.scoped.css +25 -25
- package/internal/components/token-list/styles.selectors.js +10 -10
- package/internal/environment.js +2 -2
- package/internal/environment.json +2 -2
- package/internal/generated/custom-css-properties/index.d.ts +0 -3
- package/internal/generated/custom-css-properties/index.d.ts.map +1 -1
- package/internal/generated/custom-css-properties/index.js +159 -162
- package/internal/generated/custom-css-properties/index.js.map +1 -1
- package/internal/generated/styles/tokens.d.ts +7 -7
- package/internal/generated/styles/tokens.js +7 -7
- package/internal/generated/theming/index.cjs +93 -39
- package/internal/generated/theming/index.cjs.d.ts +72 -63
- package/internal/generated/theming/index.d.ts +72 -63
- package/internal/generated/theming/index.js +93 -39
- package/internal/manifest.json +1 -1
- package/item-card/styles.css.js +14 -14
- package/item-card/styles.scoped.css +63 -63
- package/item-card/styles.selectors.js +14 -14
- package/link/styles.css.js +21 -21
- package/link/styles.scoped.css +104 -104
- package/link/styles.selectors.js +21 -21
- package/manifest.json +2 -2
- package/modal/styles.css.js +31 -31
- package/modal/styles.scoped.css +48 -48
- package/modal/styles.selectors.js +31 -31
- package/navigable-group/index.d.ts +0 -3
- package/navigable-group/index.d.ts.map +1 -1
- package/navigable-group/index.js +0 -3
- package/navigable-group/index.js.map +1 -1
- package/package.json +1 -1
- package/progress-bar/styles.css.js +18 -18
- package/progress-bar/styles.scoped.css +48 -48
- package/progress-bar/styles.selectors.js +18 -18
- package/prompt-input/styles.css.js +26 -26
- package/prompt-input/styles.scoped.css +105 -105
- package/prompt-input/styles.selectors.js +26 -26
- package/segmented-control/styles.css.js +16 -16
- package/segmented-control/styles.scoped.css +46 -46
- package/segmented-control/styles.selectors.js +16 -16
- package/slider/styles.css.js +26 -26
- package/slider/styles.scoped.css +165 -165
- package/slider/styles.selectors.js +26 -26
- package/spinner/styles.css.js +13 -13
- package/spinner/styles.scoped.css +39 -39
- package/spinner/styles.selectors.js +13 -13
- package/tabs/styles.css.js +30 -30
- package/tabs/styles.scoped.css +76 -76
- package/tabs/styles.selectors.js +30 -30
- package/tag-editor/styles.css.js +3 -3
- package/tag-editor/styles.scoped.css +13 -13
- package/tag-editor/styles.selectors.js +3 -3
- package/text-content/styles.css.js +1 -1
- package/text-content/styles.scoped.css +66 -66
- package/text-content/styles.selectors.js +1 -1
- package/textarea/styles.css.js +5 -5
- package/textarea/styles.scoped.css +45 -45
- package/textarea/styles.selectors.js +5 -5
- package/toggle/styles.css.js +10 -10
- package/toggle/styles.scoped.css +23 -23
- package/toggle/styles.selectors.js +10 -10
- package/toggle-button/styles.css.js +3 -3
- package/toggle-button/styles.scoped.css +6 -2
- package/toggle-button/styles.selectors.js +3 -3
- package/token/styles.css.js +14 -14
- package/token/styles.scoped.css +46 -46
- 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
|
|
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
|
|
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
|
-
|
|
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' &&
|
|
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
|
}
|
package/icon/internal.js.map
CHANGED
|
@@ -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,CAA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V,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,KAAK,EAAC,4BAA4B,EAClC,SAAS,EAAC,OAAO,iBACL,MAAM,iBACN,eAAe;gBAE3B,8BACE,CAAC,EAAC,wKAAwK,EAC1K,SAAS,EAAC,QAAQ,GAClB,CACE,CACP,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;YACzB,IAAI,CAAC,IAAI,EAAE,CAAC;gBACV,QAAQ,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 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,EA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AAC,CAAC;IAE5E,SAAS,OAAO,CAAC,IAAoB;QACnC,IAAI,IAAI,KAAK,QAAQ,IAAI,QAAQ,KAAK,OAAO,EAAE,CAAC;YAC9C,OAAO,CACL,6BACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,KAAK,EAAC,4BAA4B,EAClC,SAAS,EAAC,OAAO,iBACL,MAAM,iBACN,eAAe;gBAE3B,8BACE,CAAC,EAAC,wKAAwK,EAC1K,SAAS,EAAC,QAAQ,GAClB,CACE,CACP,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;YACzB,IAAI,CAAC,IAAI,EAAE,CAAC;gBACV,QAAQ,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"]}
|
package/icon/styles.css.js
CHANGED
|
@@ -1,46 +1,44 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"icon": "
|
|
5
|
-
"icon-flex-height": "awsui_icon-flex-
|
|
6
|
-
"size-
|
|
7
|
-
"size-
|
|
8
|
-
"size-
|
|
9
|
-
"size-
|
|
10
|
-
"size-
|
|
11
|
-
"size-
|
|
12
|
-
"size-
|
|
13
|
-
"size-
|
|
14
|
-
"size-
|
|
15
|
-
"size-
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"variant-
|
|
19
|
-
"variant-
|
|
20
|
-
"variant-
|
|
21
|
-
"variant-
|
|
22
|
-
"variant-
|
|
23
|
-
"variant-
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"name-angle-
|
|
27
|
-
"name-angle-
|
|
28
|
-
"name-
|
|
29
|
-
"name-
|
|
30
|
-
"name-
|
|
31
|
-
"name-
|
|
32
|
-
"name-
|
|
33
|
-
"name-
|
|
34
|
-
"name-audio-
|
|
35
|
-
"name-
|
|
36
|
-
"name-
|
|
37
|
-
"name-
|
|
38
|
-
"name-
|
|
39
|
-
"name-
|
|
40
|
-
"name-
|
|
41
|
-
"name-
|
|
42
|
-
"
|
|
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
|
|
package/icon/styles.scoped.css
CHANGED
|
@@ -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
|
-
.
|
|
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-
|
|
197
|
+
.awsui_icon-flex-height_h11ix_y1ugs_197:not(#\9) {
|
|
198
198
|
display: inline-flex;
|
|
199
199
|
align-items: center;
|
|
200
200
|
}
|
|
201
|
-
.
|
|
201
|
+
.awsui_icon_h11ix_y1ugs_189 > svg:not(#\9) {
|
|
202
202
|
pointer-events: none;
|
|
203
203
|
}
|
|
204
|
-
.
|
|
204
|
+
.awsui_icon_h11ix_y1ugs_189 > svg:not(#\9) {
|
|
205
205
|
fill: none;
|
|
206
206
|
}
|
|
207
|
-
.
|
|
207
|
+
.awsui_icon_h11ix_y1ugs_189 > svg *:not(#\9) {
|
|
208
208
|
stroke: currentColor;
|
|
209
209
|
}
|
|
210
|
-
.
|
|
210
|
+
.awsui_icon_h11ix_y1ugs_189 > svg .stroke-linejoin-round:not(#\9) {
|
|
211
211
|
stroke-linejoin: round;
|
|
212
212
|
}
|
|
213
|
-
.
|
|
213
|
+
.awsui_icon_h11ix_y1ugs_189 > svg .stroke-linecap-square:not(#\9) {
|
|
214
214
|
stroke-linecap: square;
|
|
215
215
|
}
|
|
216
|
-
.
|
|
216
|
+
.awsui_icon_h11ix_y1ugs_189 > svg .stroke-linecap-round:not(#\9) {
|
|
217
217
|
stroke-linecap: round;
|
|
218
218
|
}
|
|
219
|
-
.
|
|
219
|
+
.awsui_icon_h11ix_y1ugs_189 > svg .filled:not(#\9) {
|
|
220
220
|
fill: currentColor;
|
|
221
221
|
}
|
|
222
|
-
.
|
|
222
|
+
.awsui_icon_h11ix_y1ugs_189 > svg .no-stroke:not(#\9) {
|
|
223
223
|
stroke: none;
|
|
224
224
|
}
|
|
225
|
-
.
|
|
226
|
-
inline-size: var(--
|
|
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
|
-
.
|
|
231
|
-
block-size:
|
|
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
|
-
.
|
|
256
|
-
.
|
|
257
|
-
inline-size: var(--
|
|
258
|
-
block-size:
|
|
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
|
-
.
|
|
262
|
-
.
|
|
263
|
-
stroke-width:
|
|
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
|
-
.
|
|
266
|
-
inline-size: var(--
|
|
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
|
-
.
|
|
271
|
-
block-size:
|
|
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
|
-
.
|
|
276
|
-
.
|
|
277
|
-
inline-size: var(--
|
|
278
|
-
block-size:
|
|
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
|
-
.
|
|
282
|
-
.
|
|
283
|
-
stroke-width:
|
|
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
|
-
.
|
|
286
|
-
inline-size: var(--
|
|
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
|
-
.
|
|
291
|
-
block-size:
|
|
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
|
-
.
|
|
296
|
-
.
|
|
297
|
-
inline-size: var(--
|
|
298
|
-
block-size:
|
|
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
|
-
.
|
|
302
|
-
.
|
|
303
|
-
stroke-width:
|
|
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
|
-
.
|
|
306
|
-
inline-size: var(--
|
|
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
|
-
.
|
|
311
|
-
block-size:
|
|
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
|
-
.
|
|
316
|
-
.
|
|
317
|
-
inline-size: var(--
|
|
318
|
-
block-size:
|
|
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
|
-
.
|
|
322
|
-
.
|
|
323
|
-
stroke-width:
|
|
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
|
-
.
|
|
326
|
-
inline-size: var(--
|
|
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
|
-
.
|
|
331
|
-
block-size:
|
|
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
|
-
.
|
|
336
|
-
.
|
|
337
|
-
inline-size: var(--
|
|
338
|
-
block-size:
|
|
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
|
-
.
|
|
342
|
-
.
|
|
343
|
-
stroke-width:
|
|
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
|
-
.
|
|
320
|
+
.awsui_icon_h11ix_y1ugs_189.awsui_variant-normal_h11ix_y1ugs_320:not(#\9) {
|
|
346
321
|
color: currentColor;
|
|
347
322
|
}
|
|
348
|
-
.
|
|
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
|
-
.
|
|
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
|
-
.
|
|
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
|
-
.
|
|
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
|
-
.
|
|
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
|
-
.
|
|
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
|
-
.
|
|
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
|
-
.
|
|
370
|
-
.awsui_name-angle-
|
|
371
|
-
.awsui_name-angle-right-
|
|
372
|
-
.awsui_name-angle-
|
|
373
|
-
.awsui_name-arrow-
|
|
374
|
-
.awsui_name-arrow-
|
|
375
|
-
.awsui_name-caret-left-
|
|
376
|
-
.awsui_name-caret-right-
|
|
377
|
-
.awsui_name-audio-
|
|
378
|
-
.awsui_name-audio-
|
|
379
|
-
.awsui_name-audio-
|
|
380
|
-
.awsui_name-
|
|
381
|
-
.awsui_name-
|
|
382
|
-
.awsui_name-resize-
|
|
383
|
-
.awsui_name-
|
|
384
|
-
.awsui_name-
|
|
385
|
-
.awsui_name-
|
|
386
|
-
.awsui_name-view-
|
|
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
|
-
.
|
|
390
|
-
.awsui_name-angle-
|
|
391
|
-
.awsui_name-angle-right-
|
|
392
|
-
.awsui_name-angle-
|
|
393
|
-
.awsui_name-arrow-
|
|
394
|
-
.awsui_name-arrow-
|
|
395
|
-
.awsui_name-caret-left-
|
|
396
|
-
.awsui_name-caret-right-
|
|
397
|
-
.awsui_name-audio-
|
|
398
|
-
.awsui_name-audio-
|
|
399
|
-
.awsui_name-audio-
|
|
400
|
-
.awsui_name-
|
|
401
|
-
.awsui_name-
|
|
402
|
-
.awsui_name-resize-
|
|
403
|
-
.awsui_name-
|
|
404
|
-
.awsui_name-
|
|
405
|
-
.awsui_name-
|
|
406
|
-
.awsui_name-view-
|
|
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
|
-
.
|
|
385
|
+
.awsui_badge_h11ix_y1ugs_385:not(#\9)::after {
|
|
411
386
|
content: "";
|
|
412
387
|
position: absolute;
|
|
413
388
|
inline-size: 6px;
|