@cloudscape-design/components-themeable 3.0.1394 → 3.0.1395
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/lib/internal/manifest.json +1 -1
- package/lib/internal/scss/internal/components/control-group/styles.scss +29 -0
- package/lib/internal/scss/internal/components/control-group/test-classes/styles.scss +4 -0
- package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +1 -1
- package/lib/internal/scss/internal/styles/utils/mixins.scss +6 -0
- package/lib/internal/scss/toggle/motion.scss +46 -20
- package/lib/internal/scss/toggle/styles.scss +4 -3
- package/lib/internal/template/internal/base-component/styles.scoped.css +1 -1
- package/lib/internal/template/internal/components/control-group/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/control-group/index.js +41 -14
- package/lib/internal/template/internal/components/control-group/index.js.map +1 -1
- package/lib/internal/template/internal/components/control-group/interfaces.d.ts +8 -1
- package/lib/internal/template/internal/components/control-group/interfaces.d.ts.map +1 -1
- package/lib/internal/template/internal/components/control-group/interfaces.js.map +1 -1
- package/lib/internal/template/internal/components/control-group/styles.css.js +20 -16
- package/lib/internal/template/internal/components/control-group/styles.scoped.css +52 -16
- package/lib/internal/template/internal/components/control-group/styles.selectors.js +20 -16
- package/lib/internal/template/internal/components/control-group/test-classes/styles.css.js +4 -3
- package/lib/internal/template/internal/components/control-group/test-classes/styles.scoped.css +7 -3
- package/lib/internal/template/internal/components/control-group/test-classes/styles.selectors.js +4 -3
- package/lib/internal/template/internal/environment.js +2 -2
- package/lib/internal/template/internal/environment.json +2 -2
- package/lib/internal/template/internal/hooks/use-fits-inline.d.ts +16 -0
- package/lib/internal/template/internal/hooks/use-fits-inline.d.ts.map +1 -0
- package/lib/internal/template/internal/hooks/use-fits-inline.js +31 -0
- package/lib/internal/template/internal/hooks/use-fits-inline.js.map +1 -0
- package/lib/internal/template/test-utils/dom/internal/control-group.d.ts +4 -0
- package/lib/internal/template/test-utils/dom/internal/control-group.js +6 -0
- package/lib/internal/template/test-utils/dom/internal/control-group.js.map +1 -1
- package/lib/internal/template/test-utils/selectors/internal/control-group.d.ts +4 -0
- package/lib/internal/template/test-utils/selectors/internal/control-group.js +6 -0
- package/lib/internal/template/test-utils/selectors/internal/control-group.js.map +1 -1
- package/lib/internal/template/toggle/styles.css.js +10 -10
- package/lib/internal/template/toggle/styles.scoped.css +30 -17
- package/lib/internal/template/toggle/styles.selectors.js +10 -10
- package/package.json +1 -1
|
@@ -13,9 +13,17 @@ $margin-overlap: calc(-1 * #{awsui.$border-width-field});
|
|
|
13
13
|
@include styles.styles-reset;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
// Spans the whole row (controls + action) and hosts the measurement scaffolding (sensor + ghost).
|
|
17
|
+
// It must have `position: static` so the sensor resolves against the nearest positioned ancestor
|
|
18
|
+
// outside the component instead of this wrapper.
|
|
19
|
+
.group-layout-wrapper {
|
|
20
|
+
position: static;
|
|
21
|
+
}
|
|
22
|
+
|
|
16
23
|
.action-slot {
|
|
17
24
|
display: flex;
|
|
18
25
|
margin-inline-start: $margin-overlap;
|
|
26
|
+
flex-shrink: 0;
|
|
19
27
|
}
|
|
20
28
|
|
|
21
29
|
.group-layout {
|
|
@@ -42,10 +50,13 @@ $margin-overlap: calc(-1 * #{awsui.$border-width-field});
|
|
|
42
50
|
&-horizontal {
|
|
43
51
|
flex-direction: row;
|
|
44
52
|
flex-wrap: nowrap;
|
|
53
|
+
min-inline-size: 0;
|
|
54
|
+
flex-shrink: 1;
|
|
45
55
|
}
|
|
46
56
|
|
|
47
57
|
&-vertical {
|
|
48
58
|
flex-direction: column;
|
|
59
|
+
flex-grow: 1;
|
|
49
60
|
}
|
|
50
61
|
}
|
|
51
62
|
|
|
@@ -77,6 +88,17 @@ $margin-overlap: calc(-1 * #{awsui.$border-width-field});
|
|
|
77
88
|
}
|
|
78
89
|
}
|
|
79
90
|
|
|
91
|
+
// Width sensor
|
|
92
|
+
.sensor {
|
|
93
|
+
@include styles.measurement-ghost;
|
|
94
|
+
inset-inline-end: 0;
|
|
95
|
+
min-inline-size: 0;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.ghost-anchor {
|
|
99
|
+
@include styles.measurement-ghost-anchor;
|
|
100
|
+
}
|
|
101
|
+
|
|
80
102
|
.inline-label {
|
|
81
103
|
@include forms.inline-label;
|
|
82
104
|
// A grouped Multiselect always renders inline tokens, whose row sits higher
|
|
@@ -98,3 +120,10 @@ $margin-overlap: calc(-1 * #{awsui.$border-width-field});
|
|
|
98
120
|
.inline-label-trigger-wrapper {
|
|
99
121
|
@include forms.inline-label-trigger-wrapper;
|
|
100
122
|
}
|
|
123
|
+
|
|
124
|
+
// Hidden single-row copy of the layout, laid out at its natural width so its
|
|
125
|
+
// `max-content` size is the true required width including the action button.
|
|
126
|
+
.ghost {
|
|
127
|
+
@include styles.measurement-ghost;
|
|
128
|
+
inline-size: max-content;
|
|
129
|
+
}
|
|
@@ -20,6 +20,12 @@
|
|
|
20
20
|
pointer-events: none;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
// A zero-height relative anchor for the absolutely-positioned measurement ghost.
|
|
24
|
+
@mixin measurement-ghost-anchor {
|
|
25
|
+
position: relative;
|
|
26
|
+
block-size: 0;
|
|
27
|
+
}
|
|
28
|
+
|
|
23
29
|
@mixin text-wrapping {
|
|
24
30
|
// When using with Flexbox, a flex item has min-width set to "auto" by default, which
|
|
25
31
|
// prevents the text wrapping. We need to override the min-width by setting it to "0"
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
+
@use 'sass:math';
|
|
5
|
+
@use '../internal/styles' as styles;
|
|
4
6
|
@use '../internal/styles/tokens' as awsui;
|
|
5
7
|
@use '../internal/styles/utils/theming' as theming;
|
|
6
8
|
|
|
@@ -25,51 +27,75 @@ $tail-stretch: 4px;
|
|
|
25
27
|
}
|
|
26
28
|
}
|
|
27
29
|
|
|
28
|
-
// Include inside the handle rule. `$handle-size` is the handle's resting inline size
|
|
29
|
-
|
|
30
|
+
// Include inside the handle rule. `$handle-size` is the handle's resting inline size,
|
|
31
|
+
// `$travel` the distance it moves to the checked position.
|
|
32
|
+
//
|
|
33
|
+
// Travel (`translate`) and tail (`scale`) are transforms so they keep running while a change
|
|
34
|
+
// handler blocks the main thread; layout properties froze mid-stretch and snapped. They use
|
|
35
|
+
// separate properties because one `transform` animation would override the travel transition.
|
|
36
|
+
@mixin handle($handle-size, $travel) {
|
|
30
37
|
@include toggle-expressive-with-motion {
|
|
31
38
|
transition:
|
|
32
|
-
|
|
39
|
+
translate $travel-duration $settle-easing,
|
|
33
40
|
background-color $travel-duration $settle-easing;
|
|
34
41
|
}
|
|
35
42
|
|
|
36
|
-
|
|
43
|
+
&.toggle-handle-checked {
|
|
44
|
+
@include toggle-expressive-with-motion {
|
|
45
|
+
transform: none;
|
|
46
|
+
translate: $travel 0;
|
|
47
|
+
}
|
|
48
|
+
@include styles.with-direction('rtl') {
|
|
49
|
+
@include toggle-expressive-with-motion {
|
|
50
|
+
translate: -$travel 0;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// The tail only plays once the state has changed since mount. It stretches away from the leading
|
|
56
|
+
// edge: inline-end going on, inline-start going off. `transform-origin` is physical, so RTL swaps.
|
|
37
57
|
&[data-awsui-motion-ready] {
|
|
38
58
|
@include toggle-expressive-with-motion {
|
|
39
59
|
animation: awsui-toggle-tail-off $tail-duration $settle-easing;
|
|
60
|
+
transform-origin: 0 50%;
|
|
61
|
+
}
|
|
62
|
+
@include styles.with-direction('rtl') {
|
|
63
|
+
@include toggle-expressive-with-motion {
|
|
64
|
+
transform-origin: 100% 50%;
|
|
65
|
+
}
|
|
40
66
|
}
|
|
41
67
|
&.toggle-handle-checked {
|
|
42
68
|
@include toggle-expressive-with-motion {
|
|
43
69
|
animation-name: awsui-toggle-tail-on;
|
|
70
|
+
transform-origin: 100% 50%;
|
|
71
|
+
}
|
|
72
|
+
@include styles.with-direction('rtl') {
|
|
73
|
+
@include toggle-expressive-with-motion {
|
|
74
|
+
transform-origin: 0 50%;
|
|
75
|
+
}
|
|
44
76
|
}
|
|
45
77
|
}
|
|
46
78
|
}
|
|
47
79
|
|
|
80
|
+
// Identical keyframes under two names: the animation only restarts when `animation-name` changes.
|
|
48
81
|
@if theming.has-expressive-motion() {
|
|
82
|
+
$tail-scale: math.div($handle-size + $tail-stretch, $handle-size);
|
|
49
83
|
@keyframes awsui-toggle-tail-on {
|
|
50
|
-
0
|
|
51
|
-
|
|
52
|
-
|
|
84
|
+
0%,
|
|
85
|
+
100% {
|
|
86
|
+
scale: 1;
|
|
53
87
|
}
|
|
54
88
|
35% {
|
|
55
|
-
|
|
56
|
-
margin-inline-start: -$tail-stretch;
|
|
57
|
-
}
|
|
58
|
-
100% {
|
|
59
|
-
inline-size: $handle-size;
|
|
60
|
-
margin-inline-start: 0;
|
|
89
|
+
scale: $tail-scale 1;
|
|
61
90
|
}
|
|
62
91
|
}
|
|
63
|
-
// Going off, the trailing edge is the end edge, so the width alone grows.
|
|
64
92
|
@keyframes awsui-toggle-tail-off {
|
|
65
|
-
0
|
|
66
|
-
|
|
93
|
+
0%,
|
|
94
|
+
100% {
|
|
95
|
+
scale: 1;
|
|
67
96
|
}
|
|
68
97
|
35% {
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
100% {
|
|
72
|
-
inline-size: $handle-size;
|
|
98
|
+
scale: $tail-scale 1;
|
|
73
99
|
}
|
|
74
100
|
}
|
|
75
101
|
}
|
|
@@ -14,6 +14,7 @@ $toggle-width: 2.4 * styles.$base-size;
|
|
|
14
14
|
$toggle-height: 1.6 * styles.$base-size;
|
|
15
15
|
$handle-size: 1.2 * styles.$base-size;
|
|
16
16
|
$handle-offset: 0.2 * styles.$base-size;
|
|
17
|
+
$handle-travel: 0.8 * styles.$base-size;
|
|
17
18
|
$shadow-color: awsui.$color-shadow-toggle-handle;
|
|
18
19
|
|
|
19
20
|
$control-props: style-api.combine((color, background-color), style-api.$focus-ring);
|
|
@@ -90,10 +91,10 @@ $description-tokens: style-api.resolve((color), public);
|
|
|
90
91
|
}
|
|
91
92
|
|
|
92
93
|
&-checked {
|
|
93
|
-
transform: translateX(
|
|
94
|
+
transform: translateX($handle-travel);
|
|
94
95
|
|
|
95
96
|
@include styles.with-direction('rtl') {
|
|
96
|
-
transform: translateX(-
|
|
97
|
+
transform: translateX(-$handle-travel);
|
|
97
98
|
}
|
|
98
99
|
}
|
|
99
100
|
|
|
@@ -109,5 +110,5 @@ $description-tokens: style-api.resolve((color), public);
|
|
|
109
110
|
}
|
|
110
111
|
}
|
|
111
112
|
|
|
112
|
-
@include motion.handle($handle-size);
|
|
113
|
+
@include motion.handle($handle-size, $handle-travel);
|
|
113
114
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/control-group/index.tsx"],"names":[],"mappings":"
|
|
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 = '
|
|
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
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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'] },
|
|
58
|
+
React.createElement("div", { className: styles['inline-label-trigger-wrapper'] }, groupLayoutWrapper)));
|
|
32
59
|
}
|
|
33
|
-
return
|
|
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,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/components/control-group/index.tsx"],"names":[],"mappings":"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","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 {\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
|
-
|
|
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,
|
|
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?:
|
|
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": "
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"group-layout
|
|
8
|
-
"group-layout-
|
|
9
|
-
"
|
|
10
|
-
"controls
|
|
11
|
-
"controls-
|
|
12
|
-
"
|
|
13
|
-
"control
|
|
14
|
-
"control-
|
|
15
|
-
"control-
|
|
16
|
-
"control-
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
4
|
+
"root": "awsui_root_o08jm_17hgw_9",
|
|
5
|
+
"group-layout-wrapper": "awsui_group-layout-wrapper_o08jm_17hgw_41",
|
|
6
|
+
"action-slot": "awsui_action-slot_o08jm_17hgw_45",
|
|
7
|
+
"group-layout": "awsui_group-layout_o08jm_17hgw_41",
|
|
8
|
+
"group-layout-horizontal": "awsui_group-layout-horizontal_o08jm_17hgw_55",
|
|
9
|
+
"group-layout-vertical": "awsui_group-layout-vertical_o08jm_17hgw_58",
|
|
10
|
+
"controls": "awsui_controls_o08jm_17hgw_62",
|
|
11
|
+
"controls-horizontal": "awsui_controls-horizontal_o08jm_17hgw_66",
|
|
12
|
+
"controls-vertical": "awsui_controls-vertical_o08jm_17hgw_72",
|
|
13
|
+
"control": "awsui_control_o08jm_17hgw_62",
|
|
14
|
+
"control-middle-horizontal": "awsui_control-middle-horizontal_o08jm_17hgw_81",
|
|
15
|
+
"control-last-horizontal": "awsui_control-last-horizontal_o08jm_17hgw_81",
|
|
16
|
+
"control-middle-vertical": "awsui_control-middle-vertical_o08jm_17hgw_84",
|
|
17
|
+
"control-last-vertical": "awsui_control-last-vertical_o08jm_17hgw_84",
|
|
18
|
+
"sensor": "awsui_sensor_o08jm_17hgw_93",
|
|
19
|
+
"ghost-anchor": "awsui_ghost-anchor_o08jm_17hgw_105",
|
|
20
|
+
"inline-label": "awsui_inline-label_o08jm_17hgw_110",
|
|
21
|
+
"inline-label-wrapper": "awsui_inline-label-wrapper_o08jm_17hgw_135",
|
|
22
|
+
"inline-label-trigger-wrapper": "awsui_inline-label-trigger-wrapper_o08jm_17hgw_140",
|
|
23
|
+
"ghost": "awsui_ghost_o08jm_17hgw_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
|
-
.
|
|
9
|
+
.awsui_root_o08jm_17hgw_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
|
-
.
|
|
41
|
+
.awsui_group-layout-wrapper_o08jm_17hgw_41:not(#\9) {
|
|
42
|
+
position: static;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.awsui_action-slot_o08jm_17hgw_45:not(#\9) {
|
|
42
46
|
display: flex;
|
|
43
47
|
margin-inline-start: calc(-1 * var(--border-width-field-2365x3, 1px));
|
|
48
|
+
flex-shrink: 0;
|
|
44
49
|
}
|
|
45
50
|
|
|
46
|
-
.awsui_group-
|
|
51
|
+
.awsui_group-layout_o08jm_17hgw_41:not(#\9) {
|
|
47
52
|
display: flex;
|
|
48
53
|
flex-direction: row;
|
|
49
54
|
}
|
|
50
|
-
.awsui_group-layout-
|
|
55
|
+
.awsui_group-layout-horizontal_o08jm_17hgw_55:not(#\9) {
|
|
51
56
|
align-items: flex-end;
|
|
52
57
|
}
|
|
53
|
-
.awsui_group-layout-
|
|
58
|
+
.awsui_group-layout-vertical_o08jm_17hgw_58:not(#\9), .awsui_group-layout-vertical_o08jm_17hgw_58 > .awsui_action-slot_o08jm_17hgw_45:not(#\9) {
|
|
54
59
|
align-items: stretch;
|
|
55
60
|
}
|
|
56
61
|
|
|
57
|
-
.
|
|
62
|
+
.awsui_controls_o08jm_17hgw_62:not(#\9) {
|
|
58
63
|
display: flex;
|
|
59
64
|
align-items: stretch;
|
|
60
65
|
}
|
|
61
|
-
.awsui_controls-
|
|
66
|
+
.awsui_controls-horizontal_o08jm_17hgw_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-
|
|
72
|
+
.awsui_controls-vertical_o08jm_17hgw_72:not(#\9) {
|
|
66
73
|
flex-direction: column;
|
|
74
|
+
flex-grow: 1;
|
|
67
75
|
}
|
|
68
76
|
|
|
69
|
-
.
|
|
77
|
+
.awsui_control_o08jm_17hgw_62:not(#\9) {
|
|
70
78
|
min-inline-size: 0;
|
|
71
79
|
isolation: isolate;
|
|
72
80
|
}
|
|
73
|
-
.awsui_control-middle-
|
|
81
|
+
.awsui_control-middle-horizontal_o08jm_17hgw_81:not(#\9), .awsui_control-last-horizontal_o08jm_17hgw_81:not(#\9) {
|
|
74
82
|
margin-inline-start: calc(-1 * var(--border-width-field-2365x3, 1px));
|
|
75
83
|
}
|
|
76
|
-
.awsui_control-middle-
|
|
84
|
+
.awsui_control-middle-vertical_o08jm_17hgw_84:not(#\9), .awsui_control-last-vertical_o08jm_17hgw_84:not(#\9) {
|
|
77
85
|
margin-block-start: calc(-1 * var(--border-width-field-2365x3, 1px));
|
|
78
86
|
}
|
|
79
87
|
|
|
80
|
-
.awsui_action-
|
|
81
|
-
.
|
|
88
|
+
.awsui_action-slot_o08jm_17hgw_45:not(#\9):focus-within,
|
|
89
|
+
.awsui_control_o08jm_17hgw_62:not(#\9):focus-within {
|
|
82
90
|
z-index: 1;
|
|
83
91
|
}
|
|
84
92
|
|
|
85
|
-
.
|
|
93
|
+
.awsui_sensor_o08jm_17hgw_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_17hgw_105:not(#\9) {
|
|
106
|
+
position: relative;
|
|
107
|
+
block-size: 0;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.awsui_inline-label_o08jm_17hgw_110:not(#\9) {
|
|
86
111
|
background: linear-gradient(to bottom, var(--awsui-inline-label-background-color-ka4djm, var(--color-background-layout-main-y4565g, #f2f3f3)), var(--color-background-input-default-1u0v1p, #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-
|
|
135
|
+
.awsui_inline-label-wrapper_o08jm_17hgw_135:not(#\9) {
|
|
111
136
|
margin-block-start: calc(var(--space-scaled-xs-pajbd1, 8px) * -1);
|
|
112
137
|
isolation: isolate;
|
|
113
138
|
}
|
|
114
139
|
|
|
115
|
-
.awsui_inline-label-trigger-
|
|
140
|
+
.awsui_inline-label-trigger-wrapper_o08jm_17hgw_140:not(#\9) {
|
|
116
141
|
margin-block-start: -7px;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.awsui_ghost_o08jm_17hgw_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": "
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"group-layout
|
|
9
|
-
"group-layout-
|
|
10
|
-
"
|
|
11
|
-
"controls
|
|
12
|
-
"controls-
|
|
13
|
-
"
|
|
14
|
-
"control
|
|
15
|
-
"control-
|
|
16
|
-
"control-
|
|
17
|
-
"control-
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
5
|
+
"root": "awsui_root_o08jm_17hgw_9",
|
|
6
|
+
"group-layout-wrapper": "awsui_group-layout-wrapper_o08jm_17hgw_41",
|
|
7
|
+
"action-slot": "awsui_action-slot_o08jm_17hgw_45",
|
|
8
|
+
"group-layout": "awsui_group-layout_o08jm_17hgw_41",
|
|
9
|
+
"group-layout-horizontal": "awsui_group-layout-horizontal_o08jm_17hgw_55",
|
|
10
|
+
"group-layout-vertical": "awsui_group-layout-vertical_o08jm_17hgw_58",
|
|
11
|
+
"controls": "awsui_controls_o08jm_17hgw_62",
|
|
12
|
+
"controls-horizontal": "awsui_controls-horizontal_o08jm_17hgw_66",
|
|
13
|
+
"controls-vertical": "awsui_controls-vertical_o08jm_17hgw_72",
|
|
14
|
+
"control": "awsui_control_o08jm_17hgw_62",
|
|
15
|
+
"control-middle-horizontal": "awsui_control-middle-horizontal_o08jm_17hgw_81",
|
|
16
|
+
"control-last-horizontal": "awsui_control-last-horizontal_o08jm_17hgw_81",
|
|
17
|
+
"control-middle-vertical": "awsui_control-middle-vertical_o08jm_17hgw_84",
|
|
18
|
+
"control-last-vertical": "awsui_control-last-vertical_o08jm_17hgw_84",
|
|
19
|
+
"sensor": "awsui_sensor_o08jm_17hgw_93",
|
|
20
|
+
"ghost-anchor": "awsui_ghost-anchor_o08jm_17hgw_105",
|
|
21
|
+
"inline-label": "awsui_inline-label_o08jm_17hgw_110",
|
|
22
|
+
"inline-label-wrapper": "awsui_inline-label-wrapper_o08jm_17hgw_135",
|
|
23
|
+
"inline-label-trigger-wrapper": "awsui_inline-label-trigger-wrapper_o08jm_17hgw_140",
|
|
24
|
+
"ghost": "awsui_ghost_o08jm_17hgw_105"
|
|
21
25
|
};
|
|
22
26
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"root": "
|
|
5
|
-
"action-button": "awsui_action-
|
|
6
|
-
"
|
|
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
|
|
package/lib/internal/template/internal/components/control-group/test-classes/styles.scoped.css
CHANGED
|
@@ -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
|
-
.
|
|
5
|
+
.awsui_root_1gp1v_1w0bf_5:not(#\9) {
|
|
6
6
|
/* used in test-utils */
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
.awsui_action-
|
|
9
|
+
.awsui_action-button_1gp1v_1w0bf_9:not(#\9) {
|
|
10
10
|
/* used in test-utils */
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
.
|
|
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
|
}
|
package/lib/internal/template/internal/components/control-group/test-classes/styles.selectors.js
CHANGED
|
@@ -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": "
|
|
6
|
-
"action-button": "awsui_action-
|
|
7
|
-
"
|
|
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 (
|
|
3
|
-
export var GIT_SHA = "
|
|
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;
|
|
@@ -0,0 +1,16 @@
|
|
|
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 {};
|
|
16
|
+
//# sourceMappingURL=use-fits-inline.d.ts.map
|
|
@@ -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"]}
|
|
@@ -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;;
|
|
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;;
|
|
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": "
|
|
5
|
-
"outline": "
|
|
6
|
-
"toggle-control": "awsui_toggle-
|
|
7
|
-
"toggle-control-checked": "awsui_toggle-control-
|
|
8
|
-
"toggle-control-disabled": "awsui_toggle-control-
|
|
9
|
-
"toggle-control-readonly": "awsui_toggle-control-
|
|
10
|
-
"toggle-handle": "awsui_toggle-
|
|
11
|
-
"toggle-handle-checked": "awsui_toggle-handle-
|
|
12
|
-
"toggle-handle-disabled": "awsui_toggle-handle-
|
|
13
|
-
"toggle-handle-readonly": "awsui_toggle-handle-
|
|
4
|
+
"root": "awsui_root_4yi2u_v0uut_44",
|
|
5
|
+
"outline": "awsui_outline_4yi2u_v0uut_77",
|
|
6
|
+
"toggle-control": "awsui_toggle-control_4yi2u_v0uut_99",
|
|
7
|
+
"toggle-control-checked": "awsui_toggle-control-checked_4yi2u_v0uut_119",
|
|
8
|
+
"toggle-control-disabled": "awsui_toggle-control-disabled_4yi2u_v0uut_122",
|
|
9
|
+
"toggle-control-readonly": "awsui_toggle-control-readonly_4yi2u_v0uut_128",
|
|
10
|
+
"toggle-handle": "awsui_toggle-handle_4yi2u_v0uut_131",
|
|
11
|
+
"toggle-handle-checked": "awsui_toggle-handle-checked_4yi2u_v0uut_156",
|
|
12
|
+
"toggle-handle-disabled": "awsui_toggle-handle-disabled_4yi2u_v0uut_163",
|
|
13
|
+
"toggle-handle-readonly": "awsui_toggle-handle-readonly_4yi2u_v0uut_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
|
-
.
|
|
44
|
+
.awsui_root_4yi2u_v0uut_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
|
-
.
|
|
77
|
+
.awsui_outline_4yi2u_v0uut_77:not(#\9) {
|
|
74
78
|
position: relative;
|
|
75
79
|
}
|
|
76
|
-
.
|
|
80
|
+
.awsui_outline_4yi2u_v0uut_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
|
-
.
|
|
84
|
+
.awsui_outline_4yi2u_v0uut_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-sewkzn, #0073bb)));
|
|
93
97
|
}
|
|
94
98
|
|
|
95
|
-
.awsui_toggle-
|
|
99
|
+
.awsui_toggle-control_4yi2u_v0uut_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-
|
|
119
|
+
.awsui_toggle-control-checked_4yi2u_v0uut_119:not(#\9) {
|
|
116
120
|
background: var(--awsui-internal-style-background-color, var(--color-background-control-checked-ksqwhc, #0073bb));
|
|
117
121
|
}
|
|
118
|
-
.awsui_toggle-control-
|
|
122
|
+
.awsui_toggle-control-disabled_4yi2u_v0uut_122:not(#\9) {
|
|
119
123
|
background: var(--awsui-internal-style-background-color, var(--color-background-control-disabled-m61b8s, #d5dbdb));
|
|
120
124
|
}
|
|
121
|
-
.awsui_toggle-control-
|
|
125
|
+
.awsui_toggle-control-disabled_4yi2u_v0uut_122.awsui_toggle-control-checked_4yi2u_v0uut_119:not(#\9) {
|
|
122
126
|
background: var(--awsui-internal-style-background-color, var(--color-background-toggle-checked-disabled-81loy3, #99cbe4));
|
|
123
127
|
}
|
|
124
|
-
.awsui_toggle-control-
|
|
128
|
+
.awsui_toggle-control-readonly_4yi2u_v0uut_128:not(#\9) {
|
|
125
129
|
background: var(--awsui-internal-style-background-color, var(--color-background-control-disabled-m61b8s, #d5dbdb));
|
|
126
130
|
}
|
|
127
|
-
.awsui_toggle-
|
|
131
|
+
.awsui_toggle-handle_4yi2u_v0uut_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-yb0m8k, 90ms) var(--motion-easing-ease-out-quart-k5q7pi, cubic-bezier(0.165, 0.84, 0.44, 1)), background-color var(--motion-duration-fast-yb0m8k, 90ms) var(--motion-easing-ease-out-quart-k5q7pi, cubic-bezier(0.165, 0.84, 0.44, 1));
|
|
141
145
|
}
|
|
142
146
|
@media (prefers-reduced-motion: reduce) {
|
|
143
|
-
.awsui_toggle-
|
|
147
|
+
.awsui_toggle-handle_4yi2u_v0uut_131:not(#\9) {
|
|
144
148
|
animation: none;
|
|
145
149
|
transition: none;
|
|
146
150
|
}
|
|
147
151
|
}
|
|
148
|
-
.awsui-motion-disabled .awsui_toggle-
|
|
152
|
+
.awsui-motion-disabled .awsui_toggle-handle_4yi2u_v0uut_131:not(#\9), .awsui-mode-entering .awsui_toggle-handle_4yi2u_v0uut_131:not(#\9) {
|
|
149
153
|
animation: none;
|
|
150
154
|
transition: none;
|
|
151
155
|
}
|
|
152
|
-
.awsui_toggle-handle-
|
|
156
|
+
.awsui_toggle-handle-checked_4yi2u_v0uut_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-
|
|
160
|
+
.awsui_toggle-handle-checked_4yi2u_v0uut_156:not(#\9):dir(rtl) {
|
|
157
161
|
transform: translateX(-8px);
|
|
158
162
|
}
|
|
159
|
-
.awsui_toggle-handle-
|
|
163
|
+
.awsui_toggle-handle-disabled_4yi2u_v0uut_163:not(#\9) {
|
|
160
164
|
background: var(--awsui-internal-style-color, var(--color-foreground-control-disabled-bikivj, #ffffff));
|
|
161
165
|
box-shadow: none;
|
|
162
166
|
}
|
|
163
|
-
.awsui_toggle-handle-
|
|
167
|
+
.awsui_toggle-handle-readonly_4yi2u_v0uut_167:not(#\9):not(.awsui_toggle-handle-disabled_4yi2u_v0uut_163) {
|
|
164
168
|
box-shadow: none;
|
|
165
169
|
}
|
|
166
|
-
.awsui_toggle-handle-
|
|
170
|
+
.awsui_toggle-handle-readonly_4yi2u_v0uut_167:not(#\9):not(.awsui_toggle-handle-disabled_4yi2u_v0uut_163).awsui_toggle-handle-checked_4yi2u_v0uut_156 {
|
|
167
171
|
background: var(--awsui-internal-style-color, var(--color-foreground-control-read-only-8sqxyy, #687078));
|
|
172
|
+
}
|
|
173
|
+
.awsui_toggle-handle_4yi2u_v0uut_131.awsui_toggle-handle-checked_4yi2u_v0uut_156:not(#\9) {
|
|
174
|
+
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
175
|
+
}
|
|
176
|
+
.awsui_toggle-handle_4yi2u_v0uut_131[data-awsui-motion-ready]:not(#\9) {
|
|
177
|
+
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
178
|
+
}
|
|
179
|
+
.awsui_toggle-handle_4yi2u_v0uut_131[data-awsui-motion-ready].awsui_toggle-handle-checked_4yi2u_v0uut_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": "
|
|
6
|
-
"outline": "
|
|
7
|
-
"toggle-control": "awsui_toggle-
|
|
8
|
-
"toggle-control-checked": "awsui_toggle-control-
|
|
9
|
-
"toggle-control-disabled": "awsui_toggle-control-
|
|
10
|
-
"toggle-control-readonly": "awsui_toggle-control-
|
|
11
|
-
"toggle-handle": "awsui_toggle-
|
|
12
|
-
"toggle-handle-checked": "awsui_toggle-handle-
|
|
13
|
-
"toggle-handle-disabled": "awsui_toggle-handle-
|
|
14
|
-
"toggle-handle-readonly": "awsui_toggle-handle-
|
|
5
|
+
"root": "awsui_root_4yi2u_v0uut_44",
|
|
6
|
+
"outline": "awsui_outline_4yi2u_v0uut_77",
|
|
7
|
+
"toggle-control": "awsui_toggle-control_4yi2u_v0uut_99",
|
|
8
|
+
"toggle-control-checked": "awsui_toggle-control-checked_4yi2u_v0uut_119",
|
|
9
|
+
"toggle-control-disabled": "awsui_toggle-control-disabled_4yi2u_v0uut_122",
|
|
10
|
+
"toggle-control-readonly": "awsui_toggle-control-readonly_4yi2u_v0uut_128",
|
|
11
|
+
"toggle-handle": "awsui_toggle-handle_4yi2u_v0uut_131",
|
|
12
|
+
"toggle-handle-checked": "awsui_toggle-handle-checked_4yi2u_v0uut_156",
|
|
13
|
+
"toggle-handle-disabled": "awsui_toggle-handle-disabled_4yi2u_v0uut_163",
|
|
14
|
+
"toggle-handle-readonly": "awsui_toggle-handle-readonly_4yi2u_v0uut_167"
|
|
15
15
|
};
|
|
16
16
|
|