@cloudscape-design/components 3.0.1403 → 3.0.1404

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 (31) hide show
  1. package/internal/base-component/styles.scoped.css +1 -1
  2. package/internal/components/control-group/index.d.ts.map +1 -1
  3. package/internal/components/control-group/index.js +41 -14
  4. package/internal/components/control-group/index.js.map +1 -1
  5. package/internal/components/control-group/interfaces.d.ts +8 -1
  6. package/internal/components/control-group/interfaces.d.ts.map +1 -1
  7. package/internal/components/control-group/interfaces.js.map +1 -1
  8. package/internal/components/control-group/styles.css.js +20 -16
  9. package/internal/components/control-group/styles.scoped.css +52 -16
  10. package/internal/components/control-group/styles.selectors.js +20 -16
  11. package/internal/components/control-group/test-classes/styles.css.js +4 -3
  12. package/internal/components/control-group/test-classes/styles.scoped.css +7 -3
  13. package/internal/components/control-group/test-classes/styles.selectors.js +4 -3
  14. package/internal/environment.js +2 -2
  15. package/internal/environment.json +2 -2
  16. package/internal/hooks/use-fits-inline.d.ts +15 -0
  17. package/internal/hooks/use-fits-inline.d.ts.map +1 -0
  18. package/internal/hooks/use-fits-inline.js +31 -0
  19. package/internal/hooks/use-fits-inline.js.map +1 -0
  20. package/internal/manifest.json +1 -1
  21. package/manifest.json +2 -2
  22. package/package.json +1 -1
  23. package/test-utils/dom/internal/control-group.d.ts +4 -0
  24. package/test-utils/dom/internal/control-group.js +6 -0
  25. package/test-utils/dom/internal/control-group.js.map +1 -1
  26. package/test-utils/selectors/internal/control-group.d.ts +4 -0
  27. package/test-utils/selectors/internal/control-group.js +6 -0
  28. package/test-utils/selectors/internal/control-group.js.map +1 -1
  29. package/toggle/styles.css.js +10 -10
  30. package/toggle/styles.scoped.css +30 -17
  31. package/toggle/styles.selectors.js +10 -10
@@ -40,5 +40,5 @@
40
40
  }
41
41
  }
42
42
  :root {
43
- --awsui-version-info-af861d17: true;
43
+ --awsui-version-info-c38721c2: true;
44
44
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/control-group/index.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAKjD,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAE7B,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACnC,QAAQ,EACR,SAAwB,EACxB,eAAe,EACf,YAAY,EACZ,GAAG,KAAK,EACT,EAAE,iBAAiB,eAyEnB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/control-group/index.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAKjD,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAE7B,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACnC,QAAQ,EACR,SAAkB,EAClB,eAAe,EACf,YAAY,EACZ,GAAG,KAAK,EACT,EAAE,iBAAiB,eA2GnB"}
@@ -5,31 +5,58 @@ import clsx from 'clsx';
5
5
  import { useUniqueId } from '@cloudscape-design/component-toolkit/internal';
6
6
  import { InternalButton } from '../../../button/internal';
7
7
  import { getBaseProps } from '../../base-component';
8
- import { GroupedControlContext } from '../../context/control-group-context';
8
+ import { GroupedControlContext, } from '../../context/control-group-context';
9
+ import { useFitsInline } from '../../hooks/use-fits-inline';
9
10
  import { flattenChildren } from '../../utils/flatten-children';
10
11
  import styles from './styles.css.js';
11
12
  import testUtilStyles from './test-classes/styles.css.js';
12
- export default function ControlGroup({ children, direction = 'horizontal', inlineLabelText, actionButton, ...props }) {
13
+ export default function ControlGroup({ children, direction = 'auto', inlineLabelText, actionButton, ...props }) {
13
14
  const baseProps = getBaseProps(props);
14
15
  const labelId = useUniqueId('control-group-label');
15
16
  const flattenedChildren = flattenChildren(children, 'ControlGroup');
16
17
  const controlCount = flattenedChildren.length;
18
+ const { fits, ghostRef, sensorRef } = useFitsInline();
19
+ const resolvedDirection = direction === 'auto' ? (fits ? 'horizontal' : 'vertical') : direction;
17
20
  const rootClassnames = [styles.root, baseProps.className, testUtilStyles.root];
18
- const controls = (React.createElement("div", { ...(inlineLabelText ? { 'aria-labelledby': labelId } : actionButton ? {} : baseProps), role: "group", className: clsx(styles.controls, styles[`controls-${direction}`], !actionButton && !inlineLabelText && rootClassnames) }, flattenedChildren.map((child, index) => {
19
- const key = child && typeof child === 'object' ? child.key : undefined;
20
- const position = controlCount === 1 ? 'only' : index === 0 ? 'first' : index === controlCount - 1 ? 'last' : 'middle';
21
- return (React.createElement("div", { key: key ? String(key) : index, className: clsx(styles.control, styles[`control-${position}-${direction}`]) },
22
- React.createElement(GroupedControlContext.Provider, { value: { position, direction, hasAction: !!actionButton } }, child)));
23
- })));
24
- const controlsWithAction = actionButton ? (React.createElement("div", { ...(inlineLabelText ? {} : baseProps), className: clsx(styles['group-layout'], styles[`group-layout-${direction}`], !inlineLabelText && rootClassnames) },
25
- controls,
26
- React.createElement("div", { className: styles['action-slot'] },
27
- React.createElement(InternalButton, { className: testUtilStyles['action-button'], variant: "control-group-action", formAction: "none", iconName: actionButton.iconName, ariaLabel: actionButton.ariaLabel, disabled: actionButton.disabled, disabledReason: actionButton.disabledReason, ariaDescribedby: actionButton.ariaDescribedby, onClick: actionButton.onClick })))) : (controls);
21
+ const renderControlSlots = (isGhost) => {
22
+ const slotDirection = isGhost
23
+ ? 'horizontal' // The ghost always uses horizontal mode for measuring
24
+ : resolvedDirection;
25
+ return flattenedChildren.map((child, index) => {
26
+ const key = child && typeof child === 'object' ? child.key : undefined;
27
+ const position = controlCount === 1 ? 'only' : index === 0 ? 'first' : index === controlCount - 1 ? 'last' : 'middle';
28
+ return (React.createElement("div", { key: key !== null && key !== undefined ? String(key) : index, className: clsx(
29
+ // Make sure that test utils exclude the ghost
30
+ !isGhost && testUtilStyles.control, styles.control, styles[`control-${position}-${slotDirection}`]) },
31
+ React.createElement(GroupedControlContext.Provider, { value: { position, direction: slotDirection, hasAction: !!actionButton } }, child)));
32
+ });
33
+ };
34
+ const renderActionButton = (isGhost) => actionButton ? (React.createElement("div", { className: styles['action-slot'] },
35
+ React.createElement(InternalButton
36
+ // Make sure that test utils exclude the ghost
37
+ , {
38
+ // Make sure that test utils exclude the ghost
39
+ className: isGhost ? undefined : testUtilStyles['action-button'], variant: "control-group-action", formAction: "none", iconName: actionButton.iconName, ariaLabel: actionButton.ariaLabel, disabled: actionButton.disabled, disabledReason: actionButton.disabledReason, ariaDescribedby: actionButton.ariaDescribedby, onClick: actionButton.onClick }))) : null;
40
+ // A single render path for both the real group layout and the ghost copy, so the ghost measures
41
+ // the whole group (controls + action button, including the overlap seam between them) as one unit.
42
+ // The ghost copy carries no role, no aria-labelledby, no base props, and no test-util classes.
43
+ const renderGroupLayout = (isGhost) => {
44
+ const slotDirection = isGhost ? 'horizontal' : resolvedDirection;
45
+ return (React.createElement("div", { className: clsx(styles['group-layout'], styles[`group-layout-${slotDirection}`]) },
46
+ React.createElement("div", { ...(isGhost ? {} : inlineLabelText ? { role: 'group', 'aria-labelledby': labelId } : { role: 'group' }), className: clsx(styles.controls, styles[`controls-${slotDirection}`]) }, renderControlSlots(isGhost)),
47
+ renderActionButton(isGhost)));
48
+ };
49
+ const groupLayoutWrapper = (React.createElement("div", { ...(inlineLabelText ? {} : baseProps), className: clsx(styles['group-layout-wrapper'], !inlineLabelText && rootClassnames) },
50
+ renderGroupLayout(false),
51
+ direction === 'auto' && (React.createElement(React.Fragment, null,
52
+ React.createElement("div", { ref: sensorRef, className: styles.sensor, "aria-hidden": "true" }),
53
+ React.createElement("div", { className: styles['ghost-anchor'] },
54
+ React.createElement("div", { ref: ghostRef, className: styles.ghost, "aria-hidden": "true" }, renderGroupLayout(true)))))));
28
55
  if (inlineLabelText) {
29
56
  return (React.createElement("div", { ...baseProps, className: clsx(...rootClassnames, styles['inline-label-wrapper']) },
30
57
  React.createElement("label", { id: labelId, className: clsx(styles['inline-label'], testUtilStyles['inline-label']) }, inlineLabelText),
31
- React.createElement("div", { className: styles['inline-label-trigger-wrapper'] }, controlsWithAction)));
58
+ React.createElement("div", { className: styles['inline-label-trigger-wrapper'] }, groupLayoutWrapper)));
32
59
  }
33
- return controlsWithAction;
60
+ return groupLayoutWrapper;
34
61
  }
35
62
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/components/control-group/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAE5E,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAA0B,MAAM,qCAAqC,CAAC;AACpG,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAG/D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAI1D,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACnC,QAAQ,EACR,SAAS,GAAG,YAAY,EACxB,eAAe,EACf,YAAY,EACZ,GAAG,KAAK,EACU;IAClB,MAAM,SAAS,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IACtC,MAAM,OAAO,GAAG,WAAW,CAAC,qBAAqB,CAAC,CAAC;IAEnD,MAAM,iBAAiB,GAAG,eAAe,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;IACpE,MAAM,YAAY,GAAG,iBAAiB,CAAC,MAAM,CAAC;IAE9C,MAAM,cAAc,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,SAAS,EAAE,cAAc,CAAC,IAAI,CAAC,CAAC;IAE/E,MAAM,QAAQ,GAAG,CACf,gCACM,CAAC,eA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AAE,CAAC,CAAC,CAAC,SAAS,CAAC,EACtC,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC,gBAAgB,SAAS,EAAE,CAAC,EAAE,CAAC,eAAe,IAAI,cAAc,CAAC;QAE/G,QAAQ;QACT,6BAAK,SAAS,EAAE,MAAM,CAAC,aAAa,CAAC;YACnC,oBAAC,cAAc,IACb,SAAS,EAAE,cAAc,CAAC,eAAe,CAAC,EAC1C,OAAO,EAAC,sBAAsB,EAC9B,UAAU,EAAC,MAAM,EACjB,QAAQ,EAAE,YAAY,CAAC,QAAQ,EAC/B,SAAS,EAAE,YAAY,CAAC,SAAS,EACjC,QAAQ,EAAE,YAAY,CAAC,QAAQ,EAC/B,cAAc,EAAE,YAAY,CAAC,cAAc,EAC3C,eAAe,EAAE,YAAY,CAAC,eAAe,EAC7C,OAAO,EAAE,YAAY,CAAC,OAAO,GAC7B,CACE,CACF,CACP,CAAC,CAAC,CAAC,CACF,QAAQ,CACT,CAAC;IAEF,IAAI,eAAe,EAAE,CAAC;QACpB,OAAO,CACL,gCAAS,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,GAAG,cAAc,EAAE,MAAM,CAAC,sBAAsB,CAAC,CAAC;YACpF,+BAAO,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC,IACxF,eAAe,CACV;YACR,6BAAK,SAAS,EAAE,MAAM,CAAC,8BAA8B,CAAC,IAAG,kBAAkB,CAAO,CAC9E,CACP,CAAC;IACJ,CAAC;IAED,OAAO,kBAAkB,CAAC;AAC5B,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport { useUniqueId } from '@cloudscape-design/component-toolkit/internal';\n\nimport { InternalButton } from '../../../button/internal';\nimport { getBaseProps } from '../../base-component';\nimport { GroupedControlContext, GroupedControlPosition } from '../../context/control-group-context';\nimport { flattenChildren } from '../../utils/flatten-children';\nimport { ControlGroupProps } from './interfaces';\n\nimport styles from './styles.css.js';\nimport testUtilStyles from './test-classes/styles.css.js';\n\nexport { ControlGroupProps };\n\nexport default function ControlGroup({\n children,\n direction = 'horizontal',\n inlineLabelText,\n actionButton,\n ...props\n}: ControlGroupProps) {\n const baseProps = getBaseProps(props);\n const labelId = useUniqueId('control-group-label');\n\n const flattenedChildren = flattenChildren(children, 'ControlGroup');\n const controlCount = flattenedChildren.length;\n\n const rootClassnames = [styles.root, baseProps.className, testUtilStyles.root];\n\n const controls = (\n <div\n {...(inlineLabelText ? { 'aria-labelledby': labelId } : actionButton ? {} : baseProps)}\n role=\"group\"\n className={clsx(\n styles.controls,\n styles[`controls-${direction}`],\n !actionButton && !inlineLabelText && rootClassnames\n )}\n >\n {flattenedChildren.map((child, index) => {\n const key = child && typeof child === 'object' ? (child as Record<'key', unknown>).key : undefined;\n const position: GroupedControlPosition =\n controlCount === 1 ? 'only' : index === 0 ? 'first' : index === controlCount - 1 ? 'last' : 'middle';\n return (\n <div\n key={key ? String(key) : index}\n className={clsx(styles.control, styles[`control-${position}-${direction}`])}\n >\n <GroupedControlContext.Provider value={{ position, direction, hasAction: !!actionButton }}>\n {child}\n </GroupedControlContext.Provider>\n </div>\n );\n })}\n </div>\n );\n\n const controlsWithAction = actionButton ? (\n <div\n {...(inlineLabelText ? {} : baseProps)}\n className={clsx(styles['group-layout'], styles[`group-layout-${direction}`], !inlineLabelText && rootClassnames)}\n >\n {controls}\n <div className={styles['action-slot']}>\n <InternalButton\n className={testUtilStyles['action-button']}\n variant=\"control-group-action\"\n formAction=\"none\"\n iconName={actionButton.iconName}\n ariaLabel={actionButton.ariaLabel}\n disabled={actionButton.disabled}\n disabledReason={actionButton.disabledReason}\n ariaDescribedby={actionButton.ariaDescribedby}\n onClick={actionButton.onClick}\n />\n </div>\n </div>\n ) : (\n controls\n );\n\n if (inlineLabelText) {\n return (\n <div {...baseProps} className={clsx(...rootClassnames, styles['inline-label-wrapper'])}>\n <label id={labelId} className={clsx(styles['inline-label'], testUtilStyles['inline-label'])}>\n {inlineLabelText}\n </label>\n <div className={styles['inline-label-trigger-wrapper']}>{controlsWithAction}</div>\n </div>\n );\n }\n\n return controlsWithAction;\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/components/control-group/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAE5E,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EACL,qBAAqB,GAGtB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAG/D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAI1D,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACnC,QAAQ,EACR,SAAS,GAAG,MAAM,EAClB,eAAe,EACf,YAAY,EACZ,GAAG,KAAK,EACU;IAClB,MAAM,SAAS,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IACtC,MAAM,OAAO,GAAG,WAAW,CAAC,qBAAqB,CAAC,CAAC;IAEnD,MAAM,iBAAiB,GAAG,eAAe,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;IACpE,MAAM,YAAY,GAAG,iBAAiB,CAAC,MAAM,CAAC;IAE9C,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,aAAa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amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport { useUniqueId } from '@cloudscape-design/component-toolkit/internal';\n\nimport { InternalButton } from '../../../button/internal';\nimport { getBaseProps } from '../../base-component';\nimport {\n GroupedControlContext,\n GroupedControlDirection,\n GroupedControlPosition,\n} from '../../context/control-group-context';\nimport { useFitsInline } from '../../hooks/use-fits-inline';\nimport { flattenChildren } from '../../utils/flatten-children';\nimport { ControlGroupProps } from './interfaces';\n\nimport styles from './styles.css.js';\nimport testUtilStyles from './test-classes/styles.css.js';\n\nexport { ControlGroupProps };\n\nexport default function ControlGroup({\n children,\n direction = 'auto',\n inlineLabelText,\n actionButton,\n ...props\n}: ControlGroupProps) {\n const baseProps = getBaseProps(props);\n const labelId = useUniqueId('control-group-label');\n\n const flattenedChildren = flattenChildren(children, 'ControlGroup');\n const controlCount = flattenedChildren.length;\n\n const { fits, ghostRef, sensorRef } = useFitsInline<HTMLDivElement>();\n const resolvedDirection: GroupedControlDirection =\n direction === 'auto' ? (fits ? 'horizontal' : 'vertical') : direction;\n\n const rootClassnames = [styles.root, baseProps.className, testUtilStyles.root];\n\n const renderControlSlots = (isGhost: boolean) => {\n const slotDirection: GroupedControlDirection = isGhost\n ? 'horizontal' // The ghost always uses horizontal mode for measuring\n : resolvedDirection;\n return flattenedChildren.map((child, index) => {\n const key = child && typeof child === 'object' ? (child as Record<'key', unknown>).key : undefined;\n const position: GroupedControlPosition =\n controlCount === 1 ? 'only' : index === 0 ? 'first' : index === controlCount - 1 ? 'last' : 'middle';\n return (\n <div\n key={key !== null && key !== undefined ? String(key) : index}\n className={clsx(\n // Make sure that test utils exclude the ghost\n !isGhost && testUtilStyles.control,\n styles.control,\n styles[`control-${position}-${slotDirection}`]\n )}\n >\n <GroupedControlContext.Provider value={{ position, direction: slotDirection, hasAction: !!actionButton }}>\n {child}\n </GroupedControlContext.Provider>\n </div>\n );\n });\n };\n\n const renderActionButton = (isGhost: boolean) =>\n actionButton ? (\n <div className={styles['action-slot']}>\n <InternalButton\n // Make sure that test utils exclude the ghost\n className={isGhost ? undefined : testUtilStyles['action-button']}\n variant=\"control-group-action\"\n formAction=\"none\"\n iconName={actionButton.iconName}\n ariaLabel={actionButton.ariaLabel}\n disabled={actionButton.disabled}\n disabledReason={actionButton.disabledReason}\n ariaDescribedby={actionButton.ariaDescribedby}\n onClick={actionButton.onClick}\n />\n </div>\n ) : null;\n\n // A single render path for both the real group layout and the ghost copy, so the ghost measures\n // the whole group (controls + action button, including the overlap seam between them) as one unit.\n // The ghost copy carries no role, no aria-labelledby, no base props, and no test-util classes.\n const renderGroupLayout = (isGhost: boolean) => {\n const slotDirection: GroupedControlDirection = isGhost ? 'horizontal' : resolvedDirection;\n return (\n <div className={clsx(styles['group-layout'], styles[`group-layout-${slotDirection}`])}>\n <div\n {...(isGhost ? {} : inlineLabelText ? { role: 'group', 'aria-labelledby': labelId } : { role: 'group' })}\n className={clsx(styles.controls, styles[`controls-${slotDirection}`])}\n >\n {renderControlSlots(isGhost)}\n </div>\n {renderActionButton(isGhost)}\n </div>\n );\n };\n\n const groupLayoutWrapper = (\n <div\n {...(inlineLabelText ? {} : baseProps)}\n className={clsx(styles['group-layout-wrapper'], !inlineLabelText && rootClassnames)}\n >\n {renderGroupLayout(false)}\n\n {direction === 'auto' && (\n <>\n <div ref={sensorRef} className={styles.sensor} aria-hidden=\"true\" />\n <div className={styles['ghost-anchor']}>\n <div ref={ghostRef} className={styles.ghost} aria-hidden=\"true\">\n {renderGroupLayout(true)}\n </div>\n </div>\n </>\n )}\n </div>\n );\n\n if (inlineLabelText) {\n return (\n <div {...baseProps} className={clsx(...rootClassnames, styles['inline-label-wrapper'])}>\n <label id={labelId} className={clsx(styles['inline-label'], testUtilStyles['inline-label'])}>\n {inlineLabelText}\n </label>\n <div className={styles['inline-label-trigger-wrapper']}>{groupLayoutWrapper}</div>\n </div>\n );\n }\n\n return groupLayoutWrapper;\n}\n"]}
@@ -5,7 +5,13 @@ import { GroupedControlDirection } from '../../context/control-group-context';
5
5
  import { CancelableEventHandler } from '../../events';
6
6
  export interface ControlGroupProps extends BaseComponentProps {
7
7
  children?: React.ReactNode;
8
- direction?: GroupedControlDirection;
8
+ /**
9
+ * The axis along which the controls are laid out (`horizontal`, `vertical` or `auto`).
10
+ * When set to `auto` (default), the component decides the direction based on whether it
11
+ * fits in the padding box of its
12
+ * [containing block](https://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Display/Containing_block).
13
+ */
14
+ direction?: ControlGroupProps.ControlGroupDirection;
9
15
  inlineLabelText?: string;
10
16
  /**
11
17
  * Specifies an action button rendered next to the grouped controls.
@@ -13,6 +19,7 @@ export interface ControlGroupProps extends BaseComponentProps {
13
19
  actionButton?: ControlGroupProps.ActionButton;
14
20
  }
15
21
  export declare namespace ControlGroupProps {
22
+ type ControlGroupDirection = GroupedControlDirection | 'auto';
16
23
  interface ActionButton {
17
24
  /**
18
25
  * Called when the user clicks on the button and the button is not disabled.
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/control-group/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAEtD,MAAM,WAAW,iBAAkB,SAAQ,kBAAkB;IAC3D,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,uBAAuB,CAAC;IACpC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,YAAY,CAAC,EAAE,iBAAiB,CAAC,YAAY,CAAC;CAC/C;AAED,yBAAiB,iBAAiB,CAAC;IACjC,UAAiB,YAAY;QAC3B;;WAEG;QACH,OAAO,CAAC,EAAE,sBAAsB,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;QAE1D;;WAEG;QACH,QAAQ,CAAC,EAAE,OAAO,CAAC;QAEnB;;;WAGG;QACH,cAAc,CAAC,EAAE,MAAM,CAAC;QAExB;;;WAGG;QACH,SAAS,EAAE,MAAM,CAAC;QAElB;;WAEG;QACH,eAAe,CAAC,EAAE,MAAM,CAAC;QAEzB,uEAAuE;QACvE,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC;KAC1B;CACF"}
1
+ {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/control-group/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAEtD,MAAM,WAAW,iBAAkB,SAAQ,kBAAkB;IAC3D,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;;;;OAKG;IACH,SAAS,CAAC,EAAE,iBAAiB,CAAC,qBAAqB,CAAC;IACpD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,YAAY,CAAC,EAAE,iBAAiB,CAAC,YAAY,CAAC;CAC/C;AAED,yBAAiB,iBAAiB,CAAC;IAGjC,KAAY,qBAAqB,GAAG,uBAAuB,GAAG,MAAM,CAAC;IAErE,UAAiB,YAAY;QAC3B;;WAEG;QACH,OAAO,CAAC,EAAE,sBAAsB,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;QAE1D;;WAEG;QACH,QAAQ,CAAC,EAAE,OAAO,CAAC;QAEnB;;;WAGG;QACH,cAAc,CAAC,EAAE,MAAM,CAAC;QAExB;;;WAGG;QACH,SAAS,EAAE,MAAM,CAAC;QAElB;;WAEG;QACH,eAAe,CAAC,EAAE,MAAM,CAAC;QAEzB,uEAAuE;QACvE,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC;KAC1B;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../../src/internal/components/control-group/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ButtonProps } from '../../../button/interfaces';\nimport { IconProps } from '../../../icon/interfaces';\nimport { BaseComponentProps } from '../../../types/base-component';\nimport { GroupedControlDirection } from '../../context/control-group-context';\nimport { CancelableEventHandler } from '../../events';\n\nexport interface ControlGroupProps extends BaseComponentProps {\n children?: React.ReactNode;\n direction?: GroupedControlDirection;\n inlineLabelText?: string;\n /**\n * Specifies an action button rendered next to the grouped controls.\n */\n actionButton?: ControlGroupProps.ActionButton;\n}\n\nexport namespace ControlGroupProps {\n export interface ActionButton {\n /**\n * Called when the user clicks on the button and the button is not disabled.\n */\n onClick?: CancelableEventHandler<ButtonProps.ClickDetail>;\n\n /**\n * Renders the button as disabled and prevents clicks.\n */\n disabled?: boolean;\n\n /**\n * Provides a reason why the button is disabled (only when `disabled` is `true`).\n * If provided, the button becomes focusable.\n */\n disabledReason?: string;\n\n /**\n * Adds `aria-label` to the button element.\n * The text will also be added to the `title` attribute of the button.\n */\n ariaLabel: string;\n\n /**\n * Adds `aria-describedby` to the button.\n */\n ariaDescribedby?: string;\n\n /** Specifies the icon to display (for example `remove` or `close`). */\n iconName: IconProps.Name;\n }\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../../src/internal/components/control-group/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ButtonProps } from '../../../button/interfaces';\nimport { IconProps } from '../../../icon/interfaces';\nimport { BaseComponentProps } from '../../../types/base-component';\nimport { GroupedControlDirection } from '../../context/control-group-context';\nimport { CancelableEventHandler } from '../../events';\n\nexport interface ControlGroupProps extends BaseComponentProps {\n children?: React.ReactNode;\n /**\n * The axis along which the controls are laid out (`horizontal`, `vertical` or `auto`).\n * When set to `auto` (default), the component decides the direction based on whether it\n * fits in the padding box of its\n * [containing block](https://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Display/Containing_block).\n */\n direction?: ControlGroupProps.ControlGroupDirection;\n inlineLabelText?: string;\n /**\n * Specifies an action button rendered next to the grouped controls.\n */\n actionButton?: ControlGroupProps.ActionButton;\n}\n\nexport namespace ControlGroupProps {\n // `'auto'` exists only for the control group but not for the inner grouped controls,\n // which receive a definite value (`horizontal` or `vertical`).\n export type ControlGroupDirection = GroupedControlDirection | 'auto';\n\n export interface ActionButton {\n /**\n * Called when the user clicks on the button and the button is not disabled.\n */\n onClick?: CancelableEventHandler<ButtonProps.ClickDetail>;\n\n /**\n * Renders the button as disabled and prevents clicks.\n */\n disabled?: boolean;\n\n /**\n * Provides a reason why the button is disabled (only when `disabled` is `true`).\n * If provided, the button becomes focusable.\n */\n disabledReason?: string;\n\n /**\n * Adds `aria-label` to the button element.\n * The text will also be added to the `title` attribute of the button.\n */\n ariaLabel: string;\n\n /**\n * Adds `aria-describedby` to the button.\n */\n ariaDescribedby?: string;\n\n /** Specifies the icon to display (for example `remove` or `close`). */\n iconName: IconProps.Name;\n }\n}\n"]}
@@ -1,21 +1,25 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "root": "awsui_root_o08jm_w2s8e_9",
5
- "action-slot": "awsui_action-slot_o08jm_w2s8e_41",
6
- "group-layout": "awsui_group-layout_o08jm_w2s8e_46",
7
- "group-layout-horizontal": "awsui_group-layout-horizontal_o08jm_w2s8e_50",
8
- "group-layout-vertical": "awsui_group-layout-vertical_o08jm_w2s8e_53",
9
- "controls": "awsui_controls_o08jm_w2s8e_57",
10
- "controls-horizontal": "awsui_controls-horizontal_o08jm_w2s8e_61",
11
- "controls-vertical": "awsui_controls-vertical_o08jm_w2s8e_65",
12
- "control": "awsui_control_o08jm_w2s8e_57",
13
- "control-middle-horizontal": "awsui_control-middle-horizontal_o08jm_w2s8e_73",
14
- "control-last-horizontal": "awsui_control-last-horizontal_o08jm_w2s8e_73",
15
- "control-middle-vertical": "awsui_control-middle-vertical_o08jm_w2s8e_76",
16
- "control-last-vertical": "awsui_control-last-vertical_o08jm_w2s8e_76",
17
- "inline-label": "awsui_inline-label_o08jm_w2s8e_85",
18
- "inline-label-wrapper": "awsui_inline-label-wrapper_o08jm_w2s8e_110",
19
- "inline-label-trigger-wrapper": "awsui_inline-label-trigger-wrapper_o08jm_w2s8e_115"
4
+ "root": "awsui_root_o08jm_4qu6h_9",
5
+ "group-layout-wrapper": "awsui_group-layout-wrapper_o08jm_4qu6h_41",
6
+ "action-slot": "awsui_action-slot_o08jm_4qu6h_45",
7
+ "group-layout": "awsui_group-layout_o08jm_4qu6h_41",
8
+ "group-layout-horizontal": "awsui_group-layout-horizontal_o08jm_4qu6h_55",
9
+ "group-layout-vertical": "awsui_group-layout-vertical_o08jm_4qu6h_58",
10
+ "controls": "awsui_controls_o08jm_4qu6h_62",
11
+ "controls-horizontal": "awsui_controls-horizontal_o08jm_4qu6h_66",
12
+ "controls-vertical": "awsui_controls-vertical_o08jm_4qu6h_72",
13
+ "control": "awsui_control_o08jm_4qu6h_62",
14
+ "control-middle-horizontal": "awsui_control-middle-horizontal_o08jm_4qu6h_81",
15
+ "control-last-horizontal": "awsui_control-last-horizontal_o08jm_4qu6h_81",
16
+ "control-middle-vertical": "awsui_control-middle-vertical_o08jm_4qu6h_84",
17
+ "control-last-vertical": "awsui_control-last-vertical_o08jm_4qu6h_84",
18
+ "sensor": "awsui_sensor_o08jm_4qu6h_93",
19
+ "ghost-anchor": "awsui_ghost-anchor_o08jm_4qu6h_105",
20
+ "inline-label": "awsui_inline-label_o08jm_4qu6h_110",
21
+ "inline-label-wrapper": "awsui_inline-label-wrapper_o08jm_4qu6h_135",
22
+ "inline-label-trigger-wrapper": "awsui_inline-label-trigger-wrapper_o08jm_4qu6h_140",
23
+ "ghost": "awsui_ghost_o08jm_4qu6h_105"
20
24
  };
21
25
 
@@ -6,7 +6,7 @@
6
6
  /* stylelint-enable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
7
7
  /* Style used for links in slots/components that are text heavy, to help links stand out among
8
8
  surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F73#description */
9
- .awsui_root_o08jm_w2s8e_9:not(#\9) {
9
+ .awsui_root_o08jm_4qu6h_9:not(#\9) {
10
10
  border-collapse: separate;
11
11
  border-spacing: 0;
12
12
  box-sizing: border-box;
@@ -38,51 +38,76 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
38
38
  -moz-osx-font-smoothing: auto;
39
39
  }
40
40
 
41
- .awsui_action-slot_o08jm_w2s8e_41:not(#\9) {
41
+ .awsui_group-layout-wrapper_o08jm_4qu6h_41:not(#\9) {
42
+ position: static;
43
+ }
44
+
45
+ .awsui_action-slot_o08jm_4qu6h_45:not(#\9) {
42
46
  display: flex;
43
47
  margin-inline-start: calc(-1 * var(--border-width-field-f7slp9, 1px));
48
+ flex-shrink: 0;
44
49
  }
45
50
 
46
- .awsui_group-layout_o08jm_w2s8e_46:not(#\9) {
51
+ .awsui_group-layout_o08jm_4qu6h_41:not(#\9) {
47
52
  display: flex;
48
53
  flex-direction: row;
49
54
  }
50
- .awsui_group-layout-horizontal_o08jm_w2s8e_50:not(#\9) {
55
+ .awsui_group-layout-horizontal_o08jm_4qu6h_55:not(#\9) {
51
56
  align-items: flex-end;
52
57
  }
53
- .awsui_group-layout-vertical_o08jm_w2s8e_53:not(#\9), .awsui_group-layout-vertical_o08jm_w2s8e_53 > .awsui_action-slot_o08jm_w2s8e_41:not(#\9) {
58
+ .awsui_group-layout-vertical_o08jm_4qu6h_58:not(#\9), .awsui_group-layout-vertical_o08jm_4qu6h_58 > .awsui_action-slot_o08jm_4qu6h_45:not(#\9) {
54
59
  align-items: stretch;
55
60
  }
56
61
 
57
- .awsui_controls_o08jm_w2s8e_57:not(#\9) {
62
+ .awsui_controls_o08jm_4qu6h_62:not(#\9) {
58
63
  display: flex;
59
64
  align-items: stretch;
60
65
  }
61
- .awsui_controls-horizontal_o08jm_w2s8e_61:not(#\9) {
66
+ .awsui_controls-horizontal_o08jm_4qu6h_66:not(#\9) {
62
67
  flex-direction: row;
63
68
  flex-wrap: nowrap;
69
+ min-inline-size: 0;
70
+ flex-shrink: 1;
64
71
  }
65
- .awsui_controls-vertical_o08jm_w2s8e_65:not(#\9) {
72
+ .awsui_controls-vertical_o08jm_4qu6h_72:not(#\9) {
66
73
  flex-direction: column;
74
+ flex-grow: 1;
67
75
  }
68
76
 
69
- .awsui_control_o08jm_w2s8e_57:not(#\9) {
77
+ .awsui_control_o08jm_4qu6h_62:not(#\9) {
70
78
  min-inline-size: 0;
71
79
  isolation: isolate;
72
80
  }
73
- .awsui_control-middle-horizontal_o08jm_w2s8e_73:not(#\9), .awsui_control-last-horizontal_o08jm_w2s8e_73:not(#\9) {
81
+ .awsui_control-middle-horizontal_o08jm_4qu6h_81:not(#\9), .awsui_control-last-horizontal_o08jm_4qu6h_81:not(#\9) {
74
82
  margin-inline-start: calc(-1 * var(--border-width-field-f7slp9, 1px));
75
83
  }
76
- .awsui_control-middle-vertical_o08jm_w2s8e_76:not(#\9), .awsui_control-last-vertical_o08jm_w2s8e_76:not(#\9) {
84
+ .awsui_control-middle-vertical_o08jm_4qu6h_84:not(#\9), .awsui_control-last-vertical_o08jm_4qu6h_84:not(#\9) {
77
85
  margin-block-start: calc(-1 * var(--border-width-field-f7slp9, 1px));
78
86
  }
79
87
 
80
- .awsui_action-slot_o08jm_w2s8e_41:not(#\9):focus-within,
81
- .awsui_control_o08jm_w2s8e_57:not(#\9):focus-within {
88
+ .awsui_action-slot_o08jm_4qu6h_45:not(#\9):focus-within,
89
+ .awsui_control_o08jm_4qu6h_62:not(#\9):focus-within {
82
90
  z-index: 1;
83
91
  }
84
92
 
85
- .awsui_inline-label_o08jm_w2s8e_85:not(#\9) {
93
+ .awsui_sensor_o08jm_4qu6h_93:not(#\9) {
94
+ position: absolute;
95
+ inset-block-start: 0;
96
+ inset-inline-start: 0;
97
+ block-size: 0;
98
+ overflow: hidden;
99
+ visibility: hidden;
100
+ pointer-events: none;
101
+ inset-inline-end: 0;
102
+ min-inline-size: 0;
103
+ }
104
+
105
+ .awsui_ghost-anchor_o08jm_4qu6h_105:not(#\9) {
106
+ position: relative;
107
+ block-size: 0;
108
+ }
109
+
110
+ .awsui_inline-label_o08jm_4qu6h_110:not(#\9) {
86
111
  background: linear-gradient(to bottom, var(--awsui-inline-label-background-color-ka4djm, var(--color-background-layout-main-lursna, #ffffff)), var(--color-background-input-default-dfjnbd, #ffffff));
87
112
  border-start-start-radius: 2px;
88
113
  border-start-end-radius: 2px;
@@ -107,11 +132,22 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
107
132
  z-index: 2;
108
133
  }
109
134
 
110
- .awsui_inline-label-wrapper_o08jm_w2s8e_110:not(#\9) {
135
+ .awsui_inline-label-wrapper_o08jm_4qu6h_135:not(#\9) {
111
136
  margin-block-start: calc(var(--space-scaled-xs-65ylh6, 8px) * -1);
112
137
  isolation: isolate;
113
138
  }
114
139
 
115
- .awsui_inline-label-trigger-wrapper_o08jm_w2s8e_115:not(#\9) {
140
+ .awsui_inline-label-trigger-wrapper_o08jm_4qu6h_140:not(#\9) {
116
141
  margin-block-start: -7px;
142
+ }
143
+
144
+ .awsui_ghost_o08jm_4qu6h_105:not(#\9) {
145
+ position: absolute;
146
+ inset-block-start: 0;
147
+ inset-inline-start: 0;
148
+ block-size: 0;
149
+ overflow: hidden;
150
+ visibility: hidden;
151
+ pointer-events: none;
152
+ inline-size: max-content;
117
153
  }
@@ -2,21 +2,25 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "root": "awsui_root_o08jm_w2s8e_9",
6
- "action-slot": "awsui_action-slot_o08jm_w2s8e_41",
7
- "group-layout": "awsui_group-layout_o08jm_w2s8e_46",
8
- "group-layout-horizontal": "awsui_group-layout-horizontal_o08jm_w2s8e_50",
9
- "group-layout-vertical": "awsui_group-layout-vertical_o08jm_w2s8e_53",
10
- "controls": "awsui_controls_o08jm_w2s8e_57",
11
- "controls-horizontal": "awsui_controls-horizontal_o08jm_w2s8e_61",
12
- "controls-vertical": "awsui_controls-vertical_o08jm_w2s8e_65",
13
- "control": "awsui_control_o08jm_w2s8e_57",
14
- "control-middle-horizontal": "awsui_control-middle-horizontal_o08jm_w2s8e_73",
15
- "control-last-horizontal": "awsui_control-last-horizontal_o08jm_w2s8e_73",
16
- "control-middle-vertical": "awsui_control-middle-vertical_o08jm_w2s8e_76",
17
- "control-last-vertical": "awsui_control-last-vertical_o08jm_w2s8e_76",
18
- "inline-label": "awsui_inline-label_o08jm_w2s8e_85",
19
- "inline-label-wrapper": "awsui_inline-label-wrapper_o08jm_w2s8e_110",
20
- "inline-label-trigger-wrapper": "awsui_inline-label-trigger-wrapper_o08jm_w2s8e_115"
5
+ "root": "awsui_root_o08jm_4qu6h_9",
6
+ "group-layout-wrapper": "awsui_group-layout-wrapper_o08jm_4qu6h_41",
7
+ "action-slot": "awsui_action-slot_o08jm_4qu6h_45",
8
+ "group-layout": "awsui_group-layout_o08jm_4qu6h_41",
9
+ "group-layout-horizontal": "awsui_group-layout-horizontal_o08jm_4qu6h_55",
10
+ "group-layout-vertical": "awsui_group-layout-vertical_o08jm_4qu6h_58",
11
+ "controls": "awsui_controls_o08jm_4qu6h_62",
12
+ "controls-horizontal": "awsui_controls-horizontal_o08jm_4qu6h_66",
13
+ "controls-vertical": "awsui_controls-vertical_o08jm_4qu6h_72",
14
+ "control": "awsui_control_o08jm_4qu6h_62",
15
+ "control-middle-horizontal": "awsui_control-middle-horizontal_o08jm_4qu6h_81",
16
+ "control-last-horizontal": "awsui_control-last-horizontal_o08jm_4qu6h_81",
17
+ "control-middle-vertical": "awsui_control-middle-vertical_o08jm_4qu6h_84",
18
+ "control-last-vertical": "awsui_control-last-vertical_o08jm_4qu6h_84",
19
+ "sensor": "awsui_sensor_o08jm_4qu6h_93",
20
+ "ghost-anchor": "awsui_ghost-anchor_o08jm_4qu6h_105",
21
+ "inline-label": "awsui_inline-label_o08jm_4qu6h_110",
22
+ "inline-label-wrapper": "awsui_inline-label-wrapper_o08jm_4qu6h_135",
23
+ "inline-label-trigger-wrapper": "awsui_inline-label-trigger-wrapper_o08jm_4qu6h_140",
24
+ "ghost": "awsui_ghost_o08jm_4qu6h_105"
21
25
  };
22
26
 
@@ -1,8 +1,9 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "root": "awsui_root_1gp1v_ju9sr_5",
5
- "action-button": "awsui_action-button_1gp1v_ju9sr_9",
6
- "inline-label": "awsui_inline-label_1gp1v_ju9sr_13"
4
+ "root": "awsui_root_1gp1v_1w0bf_5",
5
+ "action-button": "awsui_action-button_1gp1v_1w0bf_9",
6
+ "control": "awsui_control_1gp1v_1w0bf_13",
7
+ "inline-label": "awsui_inline-label_1gp1v_1w0bf_17"
7
8
  };
8
9
 
@@ -2,14 +2,18 @@
2
2
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  SPDX-License-Identifier: Apache-2.0
4
4
  */
5
- .awsui_root_1gp1v_ju9sr_5:not(#\9) {
5
+ .awsui_root_1gp1v_1w0bf_5:not(#\9) {
6
6
  /* used in test-utils */
7
7
  }
8
8
 
9
- .awsui_action-button_1gp1v_ju9sr_9:not(#\9) {
9
+ .awsui_action-button_1gp1v_1w0bf_9:not(#\9) {
10
10
  /* used in test-utils */
11
11
  }
12
12
 
13
- .awsui_inline-label_1gp1v_ju9sr_13:not(#\9) {
13
+ .awsui_control_1gp1v_1w0bf_13:not(#\9) {
14
+ /* used in test-utils */
15
+ }
16
+
17
+ .awsui_inline-label_1gp1v_1w0bf_17:not(#\9) {
14
18
  /* used in test-utils */
15
19
  }
@@ -2,8 +2,9 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "root": "awsui_root_1gp1v_ju9sr_5",
6
- "action-button": "awsui_action-button_1gp1v_ju9sr_9",
7
- "inline-label": "awsui_inline-label_1gp1v_ju9sr_13"
5
+ "root": "awsui_root_1gp1v_1w0bf_5",
6
+ "action-button": "awsui_action-button_1gp1v_1w0bf_9",
7
+ "control": "awsui_control_1gp1v_1w0bf_13",
8
+ "inline-label": "awsui_inline-label_1gp1v_1w0bf_17"
8
9
  };
9
10
 
@@ -1,6 +1,6 @@
1
1
  export var PACKAGE_SOURCE = "components";
2
- export var PACKAGE_VERSION = "3.0.0 (af861d17)";
3
- export var GIT_SHA = "af861d17";
2
+ export var PACKAGE_VERSION = "3.0.0 (c38721c2)";
3
+ export var GIT_SHA = "c38721c2";
4
4
  export var THEME = "open-source-visual-refresh";
5
5
  export var SYSTEM = "core";
6
6
  export var ALWAYS_VISUAL_REFRESH = true;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "PACKAGE_SOURCE": "components",
3
- "PACKAGE_VERSION": "3.0.0 (af861d17)",
4
- "GIT_SHA": "af861d17",
3
+ "PACKAGE_VERSION": "3.0.0 (c38721c2)",
4
+ "GIT_SHA": "c38721c2",
5
5
  "THEME": "open-source-visual-refresh",
6
6
  "SYSTEM": "core",
7
7
  "ALWAYS_VISUAL_REFRESH": true,
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ interface UseFitsInlineResult<T extends HTMLElement> {
3
+ fits: boolean;
4
+ ghostRef: React.Ref<T>;
5
+ sensorRef: React.Ref<T>;
6
+ }
7
+ /**
8
+ * Reports whether content fits by comparing the available width (hidden sensor) against the
9
+ * required width (hidden single-row ghost). Measuring these independently avoids the feedback
10
+ * loop where the content's own collapse would shrink the measurement and never re-expand.
11
+ *
12
+ * The ghost is a hidden single-row copy of everything on the row.
13
+ */
14
+ export declare function useFitsInline<T extends HTMLElement = HTMLElement>(): UseFitsInlineResult<T>;
15
+ export {};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-fits-inline.d.ts","sourceRoot":"","sources":["../../../../src/internal/hooks/use-fits-inline.ts"],"names":[],"mappings":"AAEA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAK3C,UAAU,mBAAmB,CAAC,CAAC,SAAS,WAAW;IAEjD,IAAI,EAAE,OAAO,CAAC;IAGd,QAAQ,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAEvB,SAAS,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACzB;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,KAAK,mBAAmB,CAAC,CAAC,CAAC,CAoB3F"}
@@ -0,0 +1,31 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import { useCallback } from 'react';
4
+ import { useContainerQuery } from '@cloudscape-design/component-toolkit';
5
+ import { useMergeRefs } from '@cloudscape-design/component-toolkit/internal';
6
+ /**
7
+ * Reports whether content fits by comparing the available width (hidden sensor) against the
8
+ * required width (hidden single-row ghost). Measuring these independently avoids the feedback
9
+ * loop where the content's own collapse would shrink the measurement and never re-expand.
10
+ *
11
+ * The ghost is a hidden single-row copy of everything on the row.
12
+ */
13
+ export function useFitsInline() {
14
+ const [availableWidth, sensorWidthRef] = useContainerQuery(entry => entry.contentBoxWidth);
15
+ const [requiredWidth, ghostWidthRef] = useContainerQuery(entry => entry.contentBoxWidth);
16
+ // Mark the ghost subtree `inert` so its duplicated content adds no tab stops and is hidden from
17
+ // assistive tech. A ref callback rather than an effect, since `inert` isn't rendered by React < 19.
18
+ const ghostInertRef = useCallback((node) => {
19
+ if (node) {
20
+ node.inert = true;
21
+ }
22
+ }, []);
23
+ // `-1` tolerance avoids flipping on sub-pixel rounding.
24
+ const fits = availableWidth !== null && requiredWidth !== null ? availableWidth >= requiredWidth - 1 : true;
25
+ return {
26
+ fits,
27
+ ghostRef: useMergeRefs(ghostWidthRef, ghostInertRef),
28
+ sensorRef: sensorWidthRef,
29
+ };
30
+ }
31
+ //# sourceMappingURL=use-fits-inline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-fits-inline.js","sourceRoot":"","sources":["../../../../src/internal/hooks/use-fits-inline.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAc,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAY7E;;;;;;GAMG;AACH,MAAM,UAAU,aAAa;IAC3B,MAAM,CAAC,cAAc,EAAE,cAAc,CAAC,GAAG,iBAAiB,CAAS,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;IACnG,MAAM,CAAC,aAAa,EAAE,aAAa,CAAC,GAAG,iBAAiB,CAAS,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;IAEjG,gGAAgG;IAChG,oGAAoG;IACpG,MAAM,aAAa,GAAG,WAAW,CAAC,CAAC,IAAc,EAAE,EAAE;QACnD,IAAI,IAAI,EAAE,CAAC;YACT,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QACpB,CAAC;IACH,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,wDAAwD;IACxD,MAAM,IAAI,GAAG,cAAc,KAAK,IAAI,IAAI,aAAa,KAAK,IAAI,CAAC,CAAC,CAAC,cAAc,IAAI,aAAa,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAE5G,OAAO;QACL,IAAI;QACJ,QAAQ,EAAE,YAAY,CAAC,aAAa,EAAE,aAAa,CAAC;QACpD,SAAS,EAAE,cAAc;KAC1B,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useCallback } from 'react';\n\nimport { useContainerQuery } from '@cloudscape-design/component-toolkit';\nimport { useMergeRefs } from '@cloudscape-design/component-toolkit/internal';\n\ninterface UseFitsInlineResult<T extends HTMLElement> {\n // `true` when content fits; also `true` until both widths are known.\n fits: boolean;\n // Attach to the hidden single-row ghost (required width). The ghost must contain\n // everything that shares the row, so its measured width is the full required width.\n ghostRef: React.Ref<T>;\n // Attach to the hidden sensor (available width).\n sensorRef: React.Ref<T>;\n}\n\n/**\n * Reports whether content fits by comparing the available width (hidden sensor) against the\n * required width (hidden single-row ghost). Measuring these independently avoids the feedback\n * loop where the content's own collapse would shrink the measurement and never re-expand.\n *\n * The ghost is a hidden single-row copy of everything on the row.\n */\nexport function useFitsInline<T extends HTMLElement = HTMLElement>(): UseFitsInlineResult<T> {\n const [availableWidth, sensorWidthRef] = useContainerQuery<number>(entry => entry.contentBoxWidth);\n const [requiredWidth, ghostWidthRef] = useContainerQuery<number>(entry => entry.contentBoxWidth);\n\n // Mark the ghost subtree `inert` so its duplicated content adds no tab stops and is hidden from\n // assistive tech. A ref callback rather than an effect, since `inert` isn't rendered by React < 19.\n const ghostInertRef = useCallback((node: T | null) => {\n if (node) {\n node.inert = true;\n }\n }, []);\n\n // `-1` tolerance avoids flipping on sub-pixel rounding.\n const fits = availableWidth !== null && requiredWidth !== null ? availableWidth >= requiredWidth - 1 : true;\n\n return {\n fits,\n ghostRef: useMergeRefs(ghostWidthRef, ghostInertRef),\n sensorRef: sensorWidthRef,\n };\n}\n"]}
@@ -1,3 +1,3 @@
1
1
  {
2
- "commit": "af861d178cb6c5f52082d837c39d965f1b245d1c"
2
+ "commit": "c38721c200c19553cd5a21546367f5e101e22c02"
3
3
  }
package/manifest.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "artifactId": "12177409172",
2
+ "artifactId": "12264860564",
3
3
  "repoName": "components",
4
- "commitSha": "af861d178cb6c5f52082d837c39d965f1b245d1c"
4
+ "commitSha": "c38721c200c19553cd5a21546367f5e101e22c02"
5
5
  }
package/package.json CHANGED
@@ -377,7 +377,7 @@
377
377
  "./internal/base-theme/styles.css.js",
378
378
  "./internal/base-component/styles.css.js"
379
379
  ],
380
- "version": "3.0.1403",
380
+ "version": "3.0.1404",
381
381
  "repository": {
382
382
  "type": "git",
383
383
  "url": "https://github.com/cloudscape-design/components.git"
@@ -2,6 +2,10 @@ import { ComponentWrapper, ElementWrapper } from '@cloudscape-design/test-utils-
2
2
  import ButtonWrapper from '../button';
3
3
  export default class ControlGroupWrapper extends ComponentWrapper {
4
4
  static rootSelector: string;
5
+ /**
6
+ * Returns an array of the individual grouped controls.
7
+ */
8
+ findControls(): Array<ElementWrapper>;
5
9
  /**
6
10
  * Returns the visible inline label element, or null if no label is set.
7
11
  */
@@ -6,6 +6,12 @@ const dom_1 = require("@cloudscape-design/test-utils-core/dom");
6
6
  const button_1 = require("../button");
7
7
  const styles_selectors_js_1 = require("../../../internal/components/control-group/test-classes/styles.selectors.js");
8
8
  class ControlGroupWrapper extends dom_1.ComponentWrapper {
9
+ /**
10
+ * Returns an array of the individual grouped controls.
11
+ */
12
+ findControls() {
13
+ return this.findAll(`.${styles_selectors_js_1.default.control}`);
14
+ }
9
15
  /**
10
16
  * Returns the visible inline label element, or null if no label is set.
11
17
  */
@@ -1 +1 @@
1
- {"version":3,"file":"control-group.js","sourceRoot":"","sources":["../../../../../src/test-utils/dom/internal/control-group.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,gEAA0F;AAE1F,sCAAsC;AAEtC,qHAAyG;AAEzG,MAAqB,mBAAoB,SAAQ,sBAAgB;IAG/D;;OAEG;IACH,eAAe;QACb,OAAO,IAAI,CAAC,eAAe,CAAC,6BAAc,CAAC,cAAc,CAAC,CAAC,CAAC;IAC9D,CAAC;IAED;;OAEG;IACH,gBAAgB;QACd,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,6BAAc,CAAC,eAAe,CAAC,EAAE,EAAE,gBAAa,CAAC,CAAC;IAClF,CAAC;;AAdM,gCAAY,GAAW,6BAAc,CAAC,IAAI,CAAC;kBAD/B,mBAAmB"}
1
+ {"version":3,"file":"control-group.js","sourceRoot":"","sources":["../../../../../src/test-utils/dom/internal/control-group.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,gEAA0F;AAE1F,sCAAsC;AAEtC,qHAAyG;AAEzG,MAAqB,mBAAoB,SAAQ,sBAAgB;IAG/D;;OAEG;IACH,YAAY;QACV,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,6BAAc,CAAC,OAAO,EAAE,CAAC,CAAC;IACpD,CAAC;IAED;;OAEG;IACH,eAAe;QACb,OAAO,IAAI,CAAC,eAAe,CAAC,6BAAc,CAAC,cAAc,CAAC,CAAC,CAAC;IAC9D,CAAC;IAED;;OAEG;IACH,gBAAgB;QACd,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,6BAAc,CAAC,eAAe,CAAC,EAAE,EAAE,gBAAa,CAAC,CAAC;IAClF,CAAC;;AArBM,gCAAY,GAAW,6BAAc,CAAC,IAAI,CAAC;kBAD/B,mBAAmB"}
@@ -2,6 +2,10 @@ import { ComponentWrapper, ElementWrapper } from "@cloudscape-design/test-utils-
2
2
  import ButtonWrapper from '../button';
3
3
  export default class ControlGroupWrapper extends ComponentWrapper {
4
4
  static rootSelector: string;
5
+ /**
6
+ * Returns an array of the individual grouped controls.
7
+ */
8
+ findControls(): import("@cloudscape-design/test-utils-core/selectors").MultiElementWrapper<ElementWrapper>;
5
9
  /**
6
10
  * Returns the visible inline label element, or null if no label is set.
7
11
  */
@@ -6,6 +6,12 @@ const selectors_1 = require("@cloudscape-design/test-utils-core/selectors");
6
6
  const button_1 = require("../button");
7
7
  const styles_selectors_js_1 = require("../../../internal/components/control-group/test-classes/styles.selectors.js");
8
8
  class ControlGroupWrapper extends selectors_1.ComponentWrapper {
9
+ /**
10
+ * Returns an array of the individual grouped controls.
11
+ */
12
+ findControls() {
13
+ return this.findAll(`.${styles_selectors_js_1.default.control}`);
14
+ }
9
15
  /**
10
16
  * Returns the visible inline label element, or null if no label is set.
11
17
  */
@@ -1 +1 @@
1
- {"version":3,"file":"control-group.js","sourceRoot":"","sources":["../../../../../src/test-utils/selectors/internal/control-group.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,4EAAgG;AAChG,sCAAsC;AACtC,qHAAyG;AACzG,MAAqB,mBAAoB,SAAQ,4BAAgB;IAG/D;;OAEG;IACH,eAAe;QACb,OAAO,IAAI,CAAC,eAAe,CAAC,6BAAc,CAAC,cAAc,CAAC,CAAC,CAAC;IAC9D,CAAC;IAED;;OAEG;IACH,gBAAgB;QACd,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,6BAAc,CAAC,eAAe,CAAC,EAAE,EAAE,gBAAa,CAAC,CAAC;IAClF,CAAC;;AAdM,gCAAY,GAAW,6BAAc,CAAC,IAAI,CAAC;kBAD/B,mBAAmB"}
1
+ {"version":3,"file":"control-group.js","sourceRoot":"","sources":["../../../../../src/test-utils/selectors/internal/control-group.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,4EAAgG;AAChG,sCAAsC;AACtC,qHAAyG;AACzG,MAAqB,mBAAoB,SAAQ,4BAAgB;IAG/D;;OAEG;IACH,YAAY;QACV,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,6BAAc,CAAC,OAAO,EAAE,CAAC,CAAC;IACpD,CAAC;IAED;;OAEG;IACH,eAAe;QACb,OAAO,IAAI,CAAC,eAAe,CAAC,6BAAc,CAAC,cAAc,CAAC,CAAC,CAAC;IAC9D,CAAC;IAED;;OAEG;IACH,gBAAgB;QACd,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,6BAAc,CAAC,eAAe,CAAC,EAAE,EAAE,gBAAa,CAAC,CAAC;IAClF,CAAC;;AArBM,gCAAY,GAAW,6BAAc,CAAC,IAAI,CAAC;kBAD/B,mBAAmB"}
@@ -1,15 +1,15 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "root": "awsui_root_4yi2u_1nwqb_40",
5
- "outline": "awsui_outline_4yi2u_1nwqb_73",
6
- "toggle-control": "awsui_toggle-control_4yi2u_1nwqb_95",
7
- "toggle-control-checked": "awsui_toggle-control-checked_4yi2u_1nwqb_115",
8
- "toggle-control-disabled": "awsui_toggle-control-disabled_4yi2u_1nwqb_118",
9
- "toggle-control-readonly": "awsui_toggle-control-readonly_4yi2u_1nwqb_124",
10
- "toggle-handle": "awsui_toggle-handle_4yi2u_1nwqb_127",
11
- "toggle-handle-checked": "awsui_toggle-handle-checked_4yi2u_1nwqb_152",
12
- "toggle-handle-disabled": "awsui_toggle-handle-disabled_4yi2u_1nwqb_159",
13
- "toggle-handle-readonly": "awsui_toggle-handle-readonly_4yi2u_1nwqb_163"
4
+ "root": "awsui_root_4yi2u_1hgx5_44",
5
+ "outline": "awsui_outline_4yi2u_1hgx5_77",
6
+ "toggle-control": "awsui_toggle-control_4yi2u_1hgx5_99",
7
+ "toggle-control-checked": "awsui_toggle-control-checked_4yi2u_1hgx5_119",
8
+ "toggle-control-disabled": "awsui_toggle-control-disabled_4yi2u_1hgx5_122",
9
+ "toggle-control-readonly": "awsui_toggle-control-readonly_4yi2u_1hgx5_128",
10
+ "toggle-handle": "awsui_toggle-handle_4yi2u_1hgx5_131",
11
+ "toggle-handle-checked": "awsui_toggle-handle-checked_4yi2u_1hgx5_156",
12
+ "toggle-handle-disabled": "awsui_toggle-handle-disabled_4yi2u_1hgx5_163",
13
+ "toggle-handle-readonly": "awsui_toggle-handle-readonly_4yi2u_1hgx5_167"
14
14
  };
15
15
 
@@ -6,6 +6,10 @@
6
6
  /* stylelint-enable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
7
7
  /* Style used for links in slots/components that are text heavy, to help links stand out among
8
8
  surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F73#description */
9
+ /*
10
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
11
+ SPDX-License-Identifier: Apache-2.0
12
+ */
9
13
  @property --awsui-style-color {
10
14
  syntax: "*";
11
15
  inherits: false;
@@ -37,7 +41,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
37
41
  /* awsui:style-api-slot name=control tokens=color, background-color, focus-ring-color, focus-ring-width, focus-ring-radius, focus-ring-gutter-block, focus-ring-gutter-inline properties= */
38
42
  /* awsui:style-api-slot name=label tokens=color properties= */
39
43
  /* awsui:style-api-slot name=description tokens=color properties= */
40
- .awsui_root_4yi2u_1nwqb_40:not(#\9) {
44
+ .awsui_root_4yi2u_1hgx5_44:not(#\9) {
41
45
  border-collapse: separate;
42
46
  border-spacing: 0;
43
47
  box-sizing: border-box;
@@ -70,14 +74,14 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
70
74
  display: flex;
71
75
  }
72
76
 
73
- .awsui_outline_4yi2u_1nwqb_73:not(#\9) {
77
+ .awsui_outline_4yi2u_1hgx5_77:not(#\9) {
74
78
  position: relative;
75
79
  }
76
- .awsui_outline_4yi2u_1nwqb_73:not(#\9) {
80
+ .awsui_outline_4yi2u_1hgx5_77:not(#\9) {
77
81
  outline: 2px dotted transparent;
78
82
  outline-offset: calc(var(--awsui-internal-style-focus-ring-gutter-inline, 2px) - 1px);
79
83
  }
80
- .awsui_outline_4yi2u_1nwqb_73:not(#\9)::before {
84
+ .awsui_outline_4yi2u_1hgx5_77:not(#\9)::before {
81
85
  content: " ";
82
86
  display: block;
83
87
  position: absolute;
@@ -92,7 +96,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
92
96
  box-shadow: 0 0 0 var(--awsui-internal-style-focus-ring-width, var(--awsui-style-focus-ring-border-width-ka4djm, 2px)) var(--awsui-internal-style-focus-ring-color, var(--awsui-style-focus-ring-border-color-ka4djm, var(--color-border-item-focused-sb1fs0, #006ce0)));
93
97
  }
94
98
 
95
- .awsui_toggle-control_4yi2u_1nwqb_95:not(#\9) {
99
+ .awsui_toggle-control_4yi2u_1hgx5_99:not(#\9) {
96
100
  --awsui-internal-style-color: var(--awsui-style-color);
97
101
  --awsui-internal-style-background-color: var(--awsui-style-background-color);
98
102
  --awsui-internal-style-focus-ring-color: var(--awsui-style-focus-ring-color);
@@ -112,19 +116,19 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
112
116
  border-end-start-radius: 8px;
113
117
  border-end-end-radius: 8px;
114
118
  }
115
- .awsui_toggle-control-checked_4yi2u_1nwqb_115:not(#\9) {
119
+ .awsui_toggle-control-checked_4yi2u_1hgx5_119:not(#\9) {
116
120
  background: var(--awsui-internal-style-background-color, var(--color-background-control-checked-4bqnep, #006ce0));
117
121
  }
118
- .awsui_toggle-control-disabled_4yi2u_1nwqb_118:not(#\9) {
122
+ .awsui_toggle-control-disabled_4yi2u_1hgx5_122:not(#\9) {
119
123
  background: var(--awsui-internal-style-background-color, var(--color-background-control-disabled-tdp2nu, #dedee3));
120
124
  }
121
- .awsui_toggle-control-disabled_4yi2u_1nwqb_118.awsui_toggle-control-checked_4yi2u_1nwqb_115:not(#\9) {
125
+ .awsui_toggle-control-disabled_4yi2u_1hgx5_122.awsui_toggle-control-checked_4yi2u_1hgx5_119:not(#\9) {
122
126
  background: var(--awsui-internal-style-background-color, var(--color-background-toggle-checked-disabled-i54bpx, #b8e7ff));
123
127
  }
124
- .awsui_toggle-control-readonly_4yi2u_1nwqb_124:not(#\9) {
128
+ .awsui_toggle-control-readonly_4yi2u_1hgx5_128:not(#\9) {
125
129
  background: var(--awsui-internal-style-background-color, var(--color-background-control-disabled-tdp2nu, #dedee3));
126
130
  }
127
- .awsui_toggle-handle_4yi2u_1nwqb_127:not(#\9) {
131
+ .awsui_toggle-handle_4yi2u_1hgx5_131:not(#\9) {
128
132
  display: block;
129
133
  position: absolute;
130
134
  border-start-start-radius: 6px;
@@ -140,29 +144,38 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
140
144
  transition: transform var(--motion-duration-fast-0xpm7h, 90ms) var(--motion-easing-ease-out-quart-t49zcm, cubic-bezier(0.165, 0.84, 0.44, 1)), background-color var(--motion-duration-fast-0xpm7h, 90ms) var(--motion-easing-ease-out-quart-t49zcm, cubic-bezier(0.165, 0.84, 0.44, 1));
141
145
  }
142
146
  @media (prefers-reduced-motion: reduce) {
143
- .awsui_toggle-handle_4yi2u_1nwqb_127:not(#\9) {
147
+ .awsui_toggle-handle_4yi2u_1hgx5_131:not(#\9) {
144
148
  animation: none;
145
149
  transition: none;
146
150
  }
147
151
  }
148
- .awsui-motion-disabled .awsui_toggle-handle_4yi2u_1nwqb_127:not(#\9), .awsui-mode-entering .awsui_toggle-handle_4yi2u_1nwqb_127:not(#\9) {
152
+ .awsui-motion-disabled .awsui_toggle-handle_4yi2u_1hgx5_131:not(#\9), .awsui-mode-entering .awsui_toggle-handle_4yi2u_1hgx5_131:not(#\9) {
149
153
  animation: none;
150
154
  transition: none;
151
155
  }
152
- .awsui_toggle-handle-checked_4yi2u_1nwqb_152:not(#\9) {
156
+ .awsui_toggle-handle-checked_4yi2u_1hgx5_156:not(#\9) {
153
157
  transform: translateX(8px);
154
158
  /* stylelint-disable-next-line plugin/no-unsupported-browser-features */
155
159
  }
156
- .awsui_toggle-handle-checked_4yi2u_1nwqb_152:not(#\9):dir(rtl) {
160
+ .awsui_toggle-handle-checked_4yi2u_1hgx5_156:not(#\9):dir(rtl) {
157
161
  transform: translateX(-8px);
158
162
  }
159
- .awsui_toggle-handle-disabled_4yi2u_1nwqb_159:not(#\9) {
163
+ .awsui_toggle-handle-disabled_4yi2u_1hgx5_163:not(#\9) {
160
164
  background: var(--awsui-internal-style-color, var(--color-foreground-control-disabled-0eaxkw, #ffffff));
161
165
  box-shadow: none;
162
166
  }
163
- .awsui_toggle-handle-readonly_4yi2u_1nwqb_163:not(#\9):not(.awsui_toggle-handle-disabled_4yi2u_1nwqb_159) {
167
+ .awsui_toggle-handle-readonly_4yi2u_1hgx5_167:not(#\9):not(.awsui_toggle-handle-disabled_4yi2u_1hgx5_163) {
164
168
  box-shadow: none;
165
169
  }
166
- .awsui_toggle-handle-readonly_4yi2u_1nwqb_163:not(#\9):not(.awsui_toggle-handle-disabled_4yi2u_1nwqb_159).awsui_toggle-handle-checked_4yi2u_1nwqb_152 {
170
+ .awsui_toggle-handle-readonly_4yi2u_1hgx5_167:not(#\9):not(.awsui_toggle-handle-disabled_4yi2u_1hgx5_163).awsui_toggle-handle-checked_4yi2u_1hgx5_156 {
167
171
  background: var(--awsui-internal-style-color, var(--color-foreground-control-read-only-i0z7u3, #656871));
172
+ }
173
+ .awsui_toggle-handle_4yi2u_1hgx5_131.awsui_toggle-handle-checked_4yi2u_1hgx5_156:not(#\9) {
174
+ /* stylelint-disable-next-line plugin/no-unsupported-browser-features */
175
+ }
176
+ .awsui_toggle-handle_4yi2u_1hgx5_131[data-awsui-motion-ready]:not(#\9) {
177
+ /* stylelint-disable-next-line plugin/no-unsupported-browser-features */
178
+ }
179
+ .awsui_toggle-handle_4yi2u_1hgx5_131[data-awsui-motion-ready].awsui_toggle-handle-checked_4yi2u_1hgx5_156:not(#\9) {
180
+ /* stylelint-disable-next-line plugin/no-unsupported-browser-features */
168
181
  }
@@ -2,15 +2,15 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "root": "awsui_root_4yi2u_1nwqb_40",
6
- "outline": "awsui_outline_4yi2u_1nwqb_73",
7
- "toggle-control": "awsui_toggle-control_4yi2u_1nwqb_95",
8
- "toggle-control-checked": "awsui_toggle-control-checked_4yi2u_1nwqb_115",
9
- "toggle-control-disabled": "awsui_toggle-control-disabled_4yi2u_1nwqb_118",
10
- "toggle-control-readonly": "awsui_toggle-control-readonly_4yi2u_1nwqb_124",
11
- "toggle-handle": "awsui_toggle-handle_4yi2u_1nwqb_127",
12
- "toggle-handle-checked": "awsui_toggle-handle-checked_4yi2u_1nwqb_152",
13
- "toggle-handle-disabled": "awsui_toggle-handle-disabled_4yi2u_1nwqb_159",
14
- "toggle-handle-readonly": "awsui_toggle-handle-readonly_4yi2u_1nwqb_163"
5
+ "root": "awsui_root_4yi2u_1hgx5_44",
6
+ "outline": "awsui_outline_4yi2u_1hgx5_77",
7
+ "toggle-control": "awsui_toggle-control_4yi2u_1hgx5_99",
8
+ "toggle-control-checked": "awsui_toggle-control-checked_4yi2u_1hgx5_119",
9
+ "toggle-control-disabled": "awsui_toggle-control-disabled_4yi2u_1hgx5_122",
10
+ "toggle-control-readonly": "awsui_toggle-control-readonly_4yi2u_1hgx5_128",
11
+ "toggle-handle": "awsui_toggle-handle_4yi2u_1hgx5_131",
12
+ "toggle-handle-checked": "awsui_toggle-handle-checked_4yi2u_1hgx5_156",
13
+ "toggle-handle-disabled": "awsui_toggle-handle-disabled_4yi2u_1hgx5_163",
14
+ "toggle-handle-readonly": "awsui_toggle-handle-readonly_4yi2u_1hgx5_167"
15
15
  };
16
16