@cloudscape-design/components-themeable 3.0.1299 → 3.0.1301
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/generated/custom-css-properties/index.scss +1 -1
- package/lib/internal/scss/skeleton/styles.scss +121 -0
- package/lib/internal/template/flashbar/collapsible-flashbar.d.ts.map +1 -1
- package/lib/internal/template/flashbar/collapsible-flashbar.js +6 -1
- package/lib/internal/template/flashbar/collapsible-flashbar.js.map +1 -1
- package/lib/internal/template/flashbar/flash.d.ts.map +1 -1
- package/lib/internal/template/flashbar/flash.js +2 -5
- package/lib/internal/template/flashbar/flash.js.map +1 -1
- package/lib/internal/template/index.d.ts +1 -0
- package/lib/internal/template/index.d.ts.map +1 -1
- package/lib/internal/template/index.js +1 -0
- package/lib/internal/template/index.js.map +1 -1
- package/lib/internal/template/internal/base-component/styles.scoped.css +15 -1
- package/lib/internal/template/internal/components/focus-lock/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/focus-lock/index.js +4 -2
- package/lib/internal/template/internal/components/focus-lock/index.js.map +1 -1
- package/lib/internal/template/internal/environment.js +2 -2
- package/lib/internal/template/internal/environment.json +2 -2
- package/lib/internal/template/internal/generated/styles/tokens.d.ts +3 -0
- package/lib/internal/template/internal/generated/styles/tokens.js +3 -0
- package/lib/internal/template/internal/generated/theming/index.cjs +65 -0
- package/lib/internal/template/internal/generated/theming/index.js +65 -0
- package/lib/internal/template/live-region/internal.d.ts +5 -0
- package/lib/internal/template/live-region/internal.d.ts.map +1 -1
- package/lib/internal/template/live-region/internal.js +10 -2
- package/lib/internal/template/live-region/internal.js.map +1 -1
- package/lib/internal/template/package.json +1 -0
- package/lib/internal/template/skeleton/index.d.ts +4 -0
- package/lib/internal/template/skeleton/index.d.ts.map +1 -0
- package/lib/internal/template/skeleton/index.js +21 -0
- package/lib/internal/template/skeleton/index.js.map +1 -0
- package/lib/internal/template/skeleton/interfaces.d.ts +37 -0
- package/lib/internal/template/skeleton/interfaces.d.ts.map +1 -0
- package/lib/internal/template/skeleton/interfaces.js +2 -0
- package/lib/internal/template/skeleton/interfaces.js.map +1 -0
- package/lib/internal/template/skeleton/internal.d.ts +8 -0
- package/lib/internal/template/skeleton/internal.d.ts.map +1 -0
- package/lib/internal/template/skeleton/internal.js +13 -0
- package/lib/internal/template/skeleton/internal.js.map +1 -0
- package/lib/internal/template/skeleton/styles.css.js +20 -0
- package/lib/internal/template/skeleton/styles.scoped.css +273 -0
- package/lib/internal/template/skeleton/styles.selectors.js +21 -0
- package/lib/internal/template/test-utils/dom/index.d.ts +28 -0
- package/lib/internal/template/test-utils/dom/index.js +20 -1
- package/lib/internal/template/test-utils/dom/index.js.map +1 -1
- package/lib/internal/template/test-utils/dom/skeleton/index.d.ts +4 -0
- package/lib/internal/template/test-utils/dom/skeleton/index.js +11 -0
- package/lib/internal/template/test-utils/dom/skeleton/index.js.map +1 -0
- package/lib/internal/template/test-utils/selectors/index.d.ts +18 -0
- package/lib/internal/template/test-utils/selectors/index.js +15 -1
- package/lib/internal/template/test-utils/selectors/index.js.map +1 -1
- package/lib/internal/template/test-utils/selectors/skeleton/index.d.ts +4 -0
- package/lib/internal/template/test-utils/selectors/skeleton/index.js +11 -0
- package/lib/internal/template/test-utils/selectors/skeleton/index.js.map +1 -0
- package/lib/internal/template/tutorial-panel/components/tutorial-detail-view/index.d.ts.map +1 -1
- package/lib/internal/template/tutorial-panel/components/tutorial-detail-view/index.js +2 -1
- package/lib/internal/template/tutorial-panel/components/tutorial-detail-view/index.js.map +1 -1
- package/lib/internal/template/tutorial-panel/components/tutorial-list/index.js +11 -12
- package/lib/internal/template/tutorial-panel/components/tutorial-list/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -548,6 +548,8 @@
|
|
|
548
548
|
--color-icon-action-card-hover-6f6epc:var(--color-primary-900-fp8i41);
|
|
549
549
|
--color-icon-action-card-active-lvras4:var(--color-primary-900-fp8i41);
|
|
550
550
|
--color-icon-action-card-disabled-pby6he:var(--color-neutral-400-nr06g4);
|
|
551
|
+
--color-background-skeleton-ggsbkh:var(--color-neutral-250-hdfqdx);
|
|
552
|
+
--color-background-skeleton-wave-huwveo:var(--color-neutral-150-8fqber);
|
|
551
553
|
--font-button-letter-spacing-9h7rbb:0.25px;
|
|
552
554
|
--font-chart-detail-size-drm2a6:var(--font-size-body-m-vv54cm);
|
|
553
555
|
--font-display-label-weight-ise9n2:400;
|
|
@@ -672,6 +674,7 @@
|
|
|
672
674
|
--border-width-action-card-hover-v5f1fk:1px;
|
|
673
675
|
--border-width-action-card-active-qw9sq5:1px;
|
|
674
676
|
--border-width-action-card-disabled-8qg2x7:1px;
|
|
677
|
+
--border-radius-skeleton-r8data:8px;
|
|
675
678
|
--motion-duration-extra-slow-j8l6m4:270ms;
|
|
676
679
|
--motion-duration-fast-okdxjh:90ms;
|
|
677
680
|
--motion-duration-moderate-24bai8:135ms;
|
|
@@ -1129,6 +1132,8 @@
|
|
|
1129
1132
|
--color-icon-action-card-hover-6f6epc:var(--color-primary-300-jwvz31);
|
|
1130
1133
|
--color-icon-action-card-active-lvras4:var(--color-primary-300-jwvz31);
|
|
1131
1134
|
--color-icon-action-card-disabled-pby6he:var(--color-neutral-600-boivn8);
|
|
1135
|
+
--color-background-skeleton-ggsbkh:var(--color-neutral-750-gjawa6);
|
|
1136
|
+
--color-background-skeleton-wave-huwveo:var(--color-neutral-700-heh17v);
|
|
1132
1137
|
--shadow-container-3fh0j3:0 1px 1px 0 rgba(0, 0, 0, 0.3), 1px 1px 1px 0 rgba(0, 0, 0, 0.3), -1px 1px 1px 0 rgba(0, 0, 0, 0.3);
|
|
1133
1138
|
--shadow-dropup-44quix:0 -1px 1px 0 rgba(0, 0, 0, 0.3), 1px -1px 1px 0 rgba(0, 0, 0, 0.3), -1px -1px 1px 0 rgba(0, 0, 0, 0.3);
|
|
1134
1139
|
--shadow-split-bottom-0ncj9i:0 -2px 1px -1px rgba(0, 0, 0, 0.3), 0 -1px 1px -1px rgba(0, 0, 0, 0.3);
|
|
@@ -1419,6 +1424,8 @@
|
|
|
1419
1424
|
--color-icon-action-card-hover-6f6epc:var(--color-primary-300-jwvz31);
|
|
1420
1425
|
--color-icon-action-card-active-lvras4:var(--color-primary-300-jwvz31);
|
|
1421
1426
|
--color-icon-action-card-disabled-pby6he:var(--color-neutral-600-boivn8);
|
|
1427
|
+
--color-background-skeleton-ggsbkh:var(--color-neutral-750-gjawa6);
|
|
1428
|
+
--color-background-skeleton-wave-huwveo:var(--color-neutral-700-heh17v);
|
|
1422
1429
|
--color-text-direction-button-disabled-596cgx:var(--color-text-interactive-disabled-xwt2jl);
|
|
1423
1430
|
--color-background-code-editor-gutter-active-line-error-oqzpvs:var(--color-text-status-error-aknuvu);
|
|
1424
1431
|
--color-background-code-editor-loading-nj9xm5:var(--color-background-code-editor-status-bar-hv1hb6);
|
|
@@ -2129,6 +2136,7 @@
|
|
|
2129
2136
|
--color-text-action-card-disabled-3cdrhk:var(--color-neutral-500-h8gwav);
|
|
2130
2137
|
--color-icon-action-card-default-g1tv20:var(--color-primary-600-be1v6a);
|
|
2131
2138
|
--color-icon-action-card-disabled-pby6he:var(--color-neutral-400-nr06g4);
|
|
2139
|
+
--color-background-skeleton-ggsbkh:var(--color-neutral-250-hdfqdx);
|
|
2132
2140
|
--font-family-display-kvzztp:var(--font-family-base-8x5ngf);
|
|
2133
2141
|
--font-family-heading-gnchto:var(--font-family-base-8x5ngf);
|
|
2134
2142
|
--border-radius-card-default-45b7vy:var(--border-radius-container-l30zxy);
|
|
@@ -2309,6 +2317,7 @@
|
|
|
2309
2317
|
--color-background-action-card-disabled-f0sl41:var(--color-neutral-850-m3u7h5);
|
|
2310
2318
|
--color-icon-action-card-default-g1tv20:var(--color-primary-400-i8y8uk);
|
|
2311
2319
|
--color-icon-action-card-disabled-pby6he:var(--color-neutral-600-boivn8);
|
|
2320
|
+
--color-background-skeleton-ggsbkh:var(--color-neutral-750-gjawa6);
|
|
2312
2321
|
--shadow-container-3fh0j3:0px 1px 8px 2px rgba(0, 7, 22, 0.6);
|
|
2313
2322
|
--shadow-container-active-hawm65:0px 1px 1px 1px #192534, 0px 6px 36px #00040c;
|
|
2314
2323
|
--shadow-dropdown-skxpuu:0px 4px 20px 1px rgba(0, 4, 12, 1);
|
|
@@ -2645,6 +2654,7 @@
|
|
|
2645
2654
|
--color-background-action-card-disabled-f0sl41:var(--color-neutral-850-m3u7h5);
|
|
2646
2655
|
--color-icon-action-card-default-g1tv20:var(--color-primary-400-i8y8uk);
|
|
2647
2656
|
--color-icon-action-card-disabled-pby6he:var(--color-neutral-600-boivn8);
|
|
2657
|
+
--color-background-skeleton-ggsbkh:var(--color-neutral-750-gjawa6);
|
|
2648
2658
|
--color-background-button-primary-default-3w82vy:var(--color-border-button-normal-default-5aez2l);
|
|
2649
2659
|
--color-background-button-primary-hover-o7mzaq:var(--color-border-button-normal-hover-3y34o0);
|
|
2650
2660
|
--color-text-direction-button-disabled-596cgx:var(--color-text-interactive-disabled-xwt2jl);
|
|
@@ -2911,6 +2921,8 @@
|
|
|
2911
2921
|
--color-icon-action-card-hover-6f6epc:var(--color-primary-300-jwvz31);
|
|
2912
2922
|
--color-icon-action-card-active-lvras4:var(--color-primary-300-jwvz31);
|
|
2913
2923
|
--color-icon-action-card-disabled-pby6he:var(--color-neutral-600-boivn8);
|
|
2924
|
+
--color-background-skeleton-ggsbkh:var(--color-neutral-750-gjawa6);
|
|
2925
|
+
--color-background-skeleton-wave-huwveo:var(--color-neutral-700-heh17v);
|
|
2914
2926
|
--shadow-container-3fh0j3:0px 1px 8px 2px rgba(0, 7, 22, 0.6);
|
|
2915
2927
|
--shadow-container-active-hawm65:0px 1px 1px 1px #192534, 0px 6px 36px #00040c;
|
|
2916
2928
|
--shadow-dropdown-skxpuu:0px 4px 20px 1px rgba(0, 4, 12, 1);
|
|
@@ -3407,6 +3419,8 @@
|
|
|
3407
3419
|
--color-icon-action-card-hover-6f6epc:var(--color-primary-300-jwvz31);
|
|
3408
3420
|
--color-icon-action-card-active-lvras4:var(--color-primary-300-jwvz31);
|
|
3409
3421
|
--color-icon-action-card-disabled-pby6he:var(--color-neutral-600-boivn8);
|
|
3422
|
+
--color-background-skeleton-ggsbkh:var(--color-neutral-750-gjawa6);
|
|
3423
|
+
--color-background-skeleton-wave-huwveo:var(--color-neutral-700-heh17v);
|
|
3410
3424
|
--color-background-button-primary-default-3w82vy:var(--color-border-button-normal-default-5aez2l);
|
|
3411
3425
|
--color-background-button-primary-hover-o7mzaq:var(--color-border-button-normal-hover-3y34o0);
|
|
3412
3426
|
--color-text-direction-button-disabled-596cgx:var(--color-text-interactive-disabled-xwt2jl);
|
|
@@ -3663,5 +3677,5 @@
|
|
|
3663
3677
|
}
|
|
3664
3678
|
}
|
|
3665
3679
|
:root {
|
|
3666
|
-
--awsui-version-info-
|
|
3680
|
+
--awsui-version-info-be984ac7: true;
|
|
3667
3681
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/focus-lock/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAwE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/focus-lock/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAwE,MAAM,OAAO,CAAC;AAQ7F,MAAM,WAAW,cAAc;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,UAAU,IAAI,IAAI,CAAC;CACpB;;AA0ED,wBAA2C"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
import React, { useCallback, useEffect, useImperativeHandle, useRef, useState } from 'react';
|
|
4
|
+
import { nodeBelongs } from '@cloudscape-design/component-toolkit/dom';
|
|
4
5
|
import { useMergeRefs } from '@cloudscape-design/component-toolkit/internal';
|
|
5
6
|
import TabTrap from '../tab-trap/index';
|
|
6
7
|
import { getFirstFocusable, getLastFocusable } from './utils';
|
|
@@ -56,10 +57,11 @@ function FocusLock({ className, disabled, autoFocus, restoreFocus, children }, r
|
|
|
56
57
|
}, [restoreFocus]);
|
|
57
58
|
useImperativeHandle(ref, () => ({ focusFirst }));
|
|
58
59
|
const mergedRef = useMergeRefs(containerRef, restoreFocusHandler);
|
|
60
|
+
const isFocusInside = (event) => nodeBelongs(containerRef.current, event.relatedTarget);
|
|
59
61
|
return (React.createElement(React.Fragment, null,
|
|
60
|
-
React.createElement(TabTrap, { disabled: disabled, focusNextCallback: focusLast }),
|
|
62
|
+
React.createElement(TabTrap, { disabled: disabled, focusNextCallback: event => (isFocusInside(event) ? focusLast() : focusFirst()) }),
|
|
61
63
|
React.createElement("div", { className: className, ref: mergedRef }, children),
|
|
62
|
-
React.createElement(TabTrap, { disabled: disabled, focusNextCallback: focusFirst })));
|
|
64
|
+
React.createElement(TabTrap, { disabled: disabled, focusNextCallback: event => (isFocusInside(event) ? focusFirst() : focusLast()) })));
|
|
63
65
|
}
|
|
64
66
|
export default React.forwardRef(FocusLock);
|
|
65
67
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/components/focus-lock/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC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C,CAAC;IAC1G,OAAO,CACL;QACE,oBAAC,OAAO,IAAC,QAAQ,EAAE,QAAQ,EAAE,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,GAAI;QAChH,6BAAK,SAAS,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS,IACtC,QAAQ,CACL;QACN,oBAAC,OAAO,IAAC,QAAQ,EAAE,QAAQ,EAAE,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,GAAI,CAC/G,CACJ,CAAC;AACJ,CAAC;AAED,eAAe,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useCallback, useEffect, useImperativeHandle, useRef, useState } from 'react';\n\nimport { nodeBelongs } from '@cloudscape-design/component-toolkit/dom';\nimport { useMergeRefs } from '@cloudscape-design/component-toolkit/internal';\n\nimport TabTrap from '../tab-trap/index';\nimport { getFirstFocusable, getLastFocusable } from './utils';\n\nexport interface FocusLockProps {\n className?: string;\n disabled?: boolean;\n autoFocus?: boolean;\n restoreFocus?: boolean;\n children: React.ReactNode;\n}\n\nexport interface FocusLockRef {\n /**\n * Focuses the first element in the component.\n */\n focusFirst(): void;\n}\n\nfunction FocusLock(\n { className, disabled, autoFocus, restoreFocus, children }: FocusLockProps,\n ref: React.Ref<FocusLockRef>\n) {\n const restoreFocusTargetRef = useRef<HTMLOrSVGElement | null>(null);\n const containerRef = useRef<HTMLDivElement | null>(null);\n\n const focusFirst = () => {\n if (containerRef.current) {\n getFirstFocusable(containerRef.current)?.focus();\n }\n };\n\n const focusLast = () => {\n if (containerRef.current) {\n getLastFocusable(containerRef.current)?.focus();\n }\n };\n\n // Captures focus when `autoFocus` is set, and the component is mounted or\n // `disabled` changes from true to false.\n useEffect(() => {\n const assignRestoreFocusTarget = () => {\n if (document.activeElement && !containerRef.current?.contains(document.activeElement as Node)) {\n restoreFocusTargetRef.current = document.activeElement as unknown as HTMLOrSVGElement;\n }\n };\n if (autoFocus && !disabled) {\n assignRestoreFocusTarget();\n focusFirst();\n }\n }, [autoFocus, disabled]);\n\n // Restore focus if `restoreFocus` is set, and `disabled` changes from false to true.\n const [previouslyDisabled, setPreviouslyDisabled] = useState(!!disabled);\n useEffect(() => {\n if (previouslyDisabled !== !!disabled) {\n setPreviouslyDisabled(!!disabled);\n if (restoreFocus && disabled) {\n restoreFocusTargetRef.current?.focus();\n restoreFocusTargetRef.current = null;\n }\n }\n }, [previouslyDisabled, disabled, restoreFocus]);\n\n // Restore focus if `restoreFocus` is set and the component is unmounted.\n // Using a callback ref for this is safer than using useEffect cleanups.\n const restoreFocusHandler = useCallback(\n (elem: HTMLDivElement | null) => {\n if (elem === null && restoreFocus) {\n restoreFocusTargetRef.current?.focus();\n restoreFocusTargetRef.current = null;\n }\n },\n [restoreFocus]\n );\n\n useImperativeHandle(ref, () => ({ focusFirst }));\n const mergedRef = useMergeRefs(containerRef, restoreFocusHandler);\n\n const isFocusInside = (event: React.FocusEvent) => nodeBelongs(containerRef.current, event.relatedTarget);\n return (\n <>\n <TabTrap disabled={disabled} focusNextCallback={event => (isFocusInside(event) ? focusLast() : focusFirst())} />\n <div className={className} ref={mergedRef}>\n {children}\n </div>\n <TabTrap disabled={disabled} focusNextCallback={event => (isFocusInside(event) ? focusFirst() : focusLast())} />\n </>\n );\n}\n\nexport default React.forwardRef(FocusLock);\n"]}
|
|
@@ -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 (be984ac7)";
|
|
3
|
+
export var GIT_SHA = "be984ac7";
|
|
4
4
|
export var THEME = "open-source-visual-refresh";
|
|
5
5
|
export var SYSTEM = "core";
|
|
6
6
|
export var ALWAYS_VISUAL_REFRESH = true;
|
|
@@ -588,6 +588,8 @@ export const colorIconActionCardDefault: string;
|
|
|
588
588
|
export const colorIconActionCardHover: string;
|
|
589
589
|
export const colorIconActionCardActive: string;
|
|
590
590
|
export const colorIconActionCardDisabled: string;
|
|
591
|
+
export const colorBackgroundSkeleton: string;
|
|
592
|
+
export const colorBackgroundSkeletonWave: string;
|
|
591
593
|
export const fontBoxValueLargeWeight: string;
|
|
592
594
|
export const fontButtonLetterSpacing: string;
|
|
593
595
|
export const fontChartDetailSize: string;
|
|
@@ -714,6 +716,7 @@ export const borderWidthActionCardDefault: string;
|
|
|
714
716
|
export const borderWidthActionCardHover: string;
|
|
715
717
|
export const borderWidthActionCardActive: string;
|
|
716
718
|
export const borderWidthActionCardDisabled: string;
|
|
719
|
+
export const borderRadiusSkeleton: string;
|
|
717
720
|
export const motionDurationExtraFast: string;
|
|
718
721
|
export const motionDurationExtraSlow: string;
|
|
719
722
|
export const motionDurationFast: string;
|
|
@@ -588,6 +588,8 @@ export var colorIconActionCardDefault = "var(--color-icon-action-card-default-an
|
|
|
588
588
|
export var colorIconActionCardHover = "var(--color-icon-action-card-hover-qxq4pp, #002b66)";
|
|
589
589
|
export var colorIconActionCardActive = "var(--color-icon-action-card-active-rhp94s, #002b66)";
|
|
590
590
|
export var colorIconActionCardDisabled = "var(--color-icon-action-card-disabled-wm3kyf, #b4b4bb)";
|
|
591
|
+
export var colorBackgroundSkeleton = "var(--color-background-skeleton-sjxg4n, #ebebf0)";
|
|
592
|
+
export var colorBackgroundSkeletonWave = "var(--color-background-skeleton-wave-1dy97d, #f6f6f9)";
|
|
591
593
|
export var fontBoxValueLargeWeight = "var(--font-box-value-large-weight-wr00sw, 700)";
|
|
592
594
|
export var fontButtonLetterSpacing = "var(--font-button-letter-spacing-ufowe3, 0.005em)";
|
|
593
595
|
export var fontChartDetailSize = "var(--font-chart-detail-size-9qr25q, 12px)";
|
|
@@ -714,6 +716,7 @@ export var borderWidthActionCardDefault = "var(--border-width-action-card-defaul
|
|
|
714
716
|
export var borderWidthActionCardHover = "var(--border-width-action-card-hover-02l6fg, 1px)";
|
|
715
717
|
export var borderWidthActionCardActive = "var(--border-width-action-card-active-pwtgzu, 1px)";
|
|
716
718
|
export var borderWidthActionCardDisabled = "var(--border-width-action-card-disabled-rdvlbc, 1px)";
|
|
719
|
+
export var borderRadiusSkeleton = "var(--border-radius-skeleton-9lkvfi, 8px)";
|
|
717
720
|
export var motionDurationExtraFast = "var(--motion-duration-extra-fast-l4w48j, 45ms)";
|
|
718
721
|
export var motionDurationExtraSlow = "var(--motion-duration-extra-slow-29bqym, 270ms)";
|
|
719
722
|
export var motionDurationFast = "var(--motion-duration-fast-unntf6, 90ms)";
|
|
@@ -2399,6 +2399,14 @@ module.exports.preset = {
|
|
|
2399
2399
|
"light": "{colorNeutral400}",
|
|
2400
2400
|
"dark": "{colorNeutral600}"
|
|
2401
2401
|
},
|
|
2402
|
+
"colorBackgroundSkeleton": {
|
|
2403
|
+
"light": "{colorNeutral250}",
|
|
2404
|
+
"dark": "{colorNeutral750}"
|
|
2405
|
+
},
|
|
2406
|
+
"colorBackgroundSkeletonWave": {
|
|
2407
|
+
"light": "{colorNeutral150}",
|
|
2408
|
+
"dark": "{colorNeutral700}"
|
|
2409
|
+
},
|
|
2402
2410
|
"fontBoxValueLargeWeight": "700",
|
|
2403
2411
|
"fontButtonLetterSpacing": "0.005em",
|
|
2404
2412
|
"fontChartDetailSize": "{fontSizeBodyS}",
|
|
@@ -2525,6 +2533,7 @@ module.exports.preset = {
|
|
|
2525
2533
|
"borderWidthActionCardHover": "{borderWidthCard}",
|
|
2526
2534
|
"borderWidthActionCardActive": "{borderWidthCard}",
|
|
2527
2535
|
"borderWidthActionCardDisabled": "{borderWidthCard}",
|
|
2536
|
+
"borderRadiusSkeleton": "8px",
|
|
2528
2537
|
"motionDurationExtraFast": {
|
|
2529
2538
|
"default": "45ms",
|
|
2530
2539
|
"disabled": "0ms"
|
|
@@ -5033,6 +5042,14 @@ module.exports.preset = {
|
|
|
5033
5042
|
"light": "{colorNeutral600}",
|
|
5034
5043
|
"dark": "{colorNeutral600}"
|
|
5035
5044
|
},
|
|
5045
|
+
"colorBackgroundSkeleton": {
|
|
5046
|
+
"light": "{colorNeutral750}",
|
|
5047
|
+
"dark": "{colorNeutral750}"
|
|
5048
|
+
},
|
|
5049
|
+
"colorBackgroundSkeletonWave": {
|
|
5050
|
+
"light": "{colorNeutral700}",
|
|
5051
|
+
"dark": "{colorNeutral700}"
|
|
5052
|
+
},
|
|
5036
5053
|
"colorPrimary50": "#f0fbff",
|
|
5037
5054
|
"colorPrimary100": "#d1f1ff",
|
|
5038
5055
|
"colorPrimary200": "#b8e7ff",
|
|
@@ -6502,6 +6519,14 @@ module.exports.preset = {
|
|
|
6502
6519
|
"light": "{colorNeutral600}",
|
|
6503
6520
|
"dark": "{colorNeutral600}"
|
|
6504
6521
|
},
|
|
6522
|
+
"colorBackgroundSkeleton": {
|
|
6523
|
+
"light": "{colorNeutral750}",
|
|
6524
|
+
"dark": "{colorNeutral750}"
|
|
6525
|
+
},
|
|
6526
|
+
"colorBackgroundSkeletonWave": {
|
|
6527
|
+
"light": "{colorNeutral700}",
|
|
6528
|
+
"dark": "{colorNeutral700}"
|
|
6529
|
+
},
|
|
6505
6530
|
"colorPrimary50": "#f0fbff",
|
|
6506
6531
|
"colorPrimary100": "#d1f1ff",
|
|
6507
6532
|
"colorPrimary200": "#b8e7ff",
|
|
@@ -7898,6 +7923,14 @@ module.exports.preset = {
|
|
|
7898
7923
|
"colorIconActionCardDisabled": {
|
|
7899
7924
|
"light": "{colorNeutral400}",
|
|
7900
7925
|
"dark": "{colorNeutral600}"
|
|
7926
|
+
},
|
|
7927
|
+
"colorBackgroundSkeleton": {
|
|
7928
|
+
"light": "{colorNeutral250}",
|
|
7929
|
+
"dark": "{colorNeutral750}"
|
|
7930
|
+
},
|
|
7931
|
+
"colorBackgroundSkeletonWave": {
|
|
7932
|
+
"light": "{colorNeutral150}",
|
|
7933
|
+
"dark": "{colorNeutral700}"
|
|
7901
7934
|
}
|
|
7902
7935
|
}
|
|
7903
7936
|
},
|
|
@@ -9180,6 +9213,14 @@ module.exports.preset = {
|
|
|
9180
9213
|
"colorIconActionCardDisabled": {
|
|
9181
9214
|
"light": "{colorNeutral400}",
|
|
9182
9215
|
"dark": "{colorNeutral600}"
|
|
9216
|
+
},
|
|
9217
|
+
"colorBackgroundSkeleton": {
|
|
9218
|
+
"light": "{colorNeutral250}",
|
|
9219
|
+
"dark": "{colorNeutral750}"
|
|
9220
|
+
},
|
|
9221
|
+
"colorBackgroundSkeletonWave": {
|
|
9222
|
+
"light": "{colorNeutral150}",
|
|
9223
|
+
"dark": "{colorNeutral700}"
|
|
9183
9224
|
}
|
|
9184
9225
|
}
|
|
9185
9226
|
},
|
|
@@ -10463,6 +10504,14 @@ module.exports.preset = {
|
|
|
10463
10504
|
"light": "{colorNeutral400}",
|
|
10464
10505
|
"dark": "{colorNeutral600}"
|
|
10465
10506
|
},
|
|
10507
|
+
"colorBackgroundSkeleton": {
|
|
10508
|
+
"light": "{colorNeutral250}",
|
|
10509
|
+
"dark": "{colorNeutral750}"
|
|
10510
|
+
},
|
|
10511
|
+
"colorBackgroundSkeletonWave": {
|
|
10512
|
+
"light": "{colorNeutral150}",
|
|
10513
|
+
"dark": "{colorNeutral700}"
|
|
10514
|
+
},
|
|
10466
10515
|
"fontExpandableHeadingSize": "14px",
|
|
10467
10516
|
"borderDividerSectionWidth": "1px"
|
|
10468
10517
|
}
|
|
@@ -11746,6 +11795,14 @@ module.exports.preset = {
|
|
|
11746
11795
|
"colorIconActionCardDisabled": {
|
|
11747
11796
|
"light": "{colorNeutral600}",
|
|
11748
11797
|
"dark": "{colorNeutral600}"
|
|
11798
|
+
},
|
|
11799
|
+
"colorBackgroundSkeleton": {
|
|
11800
|
+
"light": "{colorNeutral750}",
|
|
11801
|
+
"dark": "{colorNeutral750}"
|
|
11802
|
+
},
|
|
11803
|
+
"colorBackgroundSkeletonWave": {
|
|
11804
|
+
"light": "{colorNeutral700}",
|
|
11805
|
+
"dark": "{colorNeutral700}"
|
|
11749
11806
|
}
|
|
11750
11807
|
}
|
|
11751
11808
|
},
|
|
@@ -12351,6 +12408,8 @@ module.exports.preset = {
|
|
|
12351
12408
|
"colorIconActionCardHover": "color",
|
|
12352
12409
|
"colorIconActionCardActive": "color",
|
|
12353
12410
|
"colorIconActionCardDisabled": "color",
|
|
12411
|
+
"colorBackgroundSkeleton": "color",
|
|
12412
|
+
"colorBackgroundSkeletonWave": "color",
|
|
12354
12413
|
"motionDurationExtraFast": "motion",
|
|
12355
12414
|
"motionDurationExtraSlow": "motion",
|
|
12356
12415
|
"motionDurationFast": "motion",
|
|
@@ -14208,6 +14267,8 @@ module.exports.preset = {
|
|
|
14208
14267
|
"colorIconActionCardHover": "color-icon-action-card-hover",
|
|
14209
14268
|
"colorIconActionCardActive": "color-icon-action-card-active",
|
|
14210
14269
|
"colorIconActionCardDisabled": "color-icon-action-card-disabled",
|
|
14270
|
+
"colorBackgroundSkeleton": "color-background-skeleton",
|
|
14271
|
+
"colorBackgroundSkeletonWave": "color-background-skeleton-wave",
|
|
14211
14272
|
"fontBoxValueLargeWeight": "font-box-value-large-weight",
|
|
14212
14273
|
"fontButtonLetterSpacing": "font-button-letter-spacing",
|
|
14213
14274
|
"fontChartDetailSize": "font-chart-detail-size",
|
|
@@ -14334,6 +14395,7 @@ module.exports.preset = {
|
|
|
14334
14395
|
"borderWidthActionCardHover": "border-width-action-card-hover",
|
|
14335
14396
|
"borderWidthActionCardActive": "border-width-action-card-active",
|
|
14336
14397
|
"borderWidthActionCardDisabled": "border-width-action-card-disabled",
|
|
14398
|
+
"borderRadiusSkeleton": "border-radius-skeleton",
|
|
14337
14399
|
"motionDurationExtraFast": "motion-duration-extra-fast",
|
|
14338
14400
|
"motionDurationExtraSlow": "motion-duration-extra-slow",
|
|
14339
14401
|
"motionDurationFast": "motion-duration-fast",
|
|
@@ -15112,6 +15174,8 @@ module.exports.preset = {
|
|
|
15112
15174
|
"colorIconActionCardHover": "--color-icon-action-card-hover-qxq4pp",
|
|
15113
15175
|
"colorIconActionCardActive": "--color-icon-action-card-active-rhp94s",
|
|
15114
15176
|
"colorIconActionCardDisabled": "--color-icon-action-card-disabled-wm3kyf",
|
|
15177
|
+
"colorBackgroundSkeleton": "--color-background-skeleton-sjxg4n",
|
|
15178
|
+
"colorBackgroundSkeletonWave": "--color-background-skeleton-wave-1dy97d",
|
|
15115
15179
|
"fontBoxValueLargeWeight": "--font-box-value-large-weight-wr00sw",
|
|
15116
15180
|
"fontButtonLetterSpacing": "--font-button-letter-spacing-ufowe3",
|
|
15117
15181
|
"fontChartDetailSize": "--font-chart-detail-size-9qr25q",
|
|
@@ -15238,6 +15302,7 @@ module.exports.preset = {
|
|
|
15238
15302
|
"borderWidthActionCardHover": "--border-width-action-card-hover-02l6fg",
|
|
15239
15303
|
"borderWidthActionCardActive": "--border-width-action-card-active-pwtgzu",
|
|
15240
15304
|
"borderWidthActionCardDisabled": "--border-width-action-card-disabled-rdvlbc",
|
|
15305
|
+
"borderRadiusSkeleton": "--border-radius-skeleton-9lkvfi",
|
|
15241
15306
|
"motionDurationExtraFast": "--motion-duration-extra-fast-l4w48j",
|
|
15242
15307
|
"motionDurationExtraSlow": "--motion-duration-extra-slow-29bqym",
|
|
15243
15308
|
"motionDurationFast": "--motion-duration-fast-unntf6",
|
|
@@ -2399,6 +2399,14 @@ export var preset = {
|
|
|
2399
2399
|
"light": "{colorNeutral400}",
|
|
2400
2400
|
"dark": "{colorNeutral600}"
|
|
2401
2401
|
},
|
|
2402
|
+
"colorBackgroundSkeleton": {
|
|
2403
|
+
"light": "{colorNeutral250}",
|
|
2404
|
+
"dark": "{colorNeutral750}"
|
|
2405
|
+
},
|
|
2406
|
+
"colorBackgroundSkeletonWave": {
|
|
2407
|
+
"light": "{colorNeutral150}",
|
|
2408
|
+
"dark": "{colorNeutral700}"
|
|
2409
|
+
},
|
|
2402
2410
|
"fontBoxValueLargeWeight": "700",
|
|
2403
2411
|
"fontButtonLetterSpacing": "0.005em",
|
|
2404
2412
|
"fontChartDetailSize": "{fontSizeBodyS}",
|
|
@@ -2525,6 +2533,7 @@ export var preset = {
|
|
|
2525
2533
|
"borderWidthActionCardHover": "{borderWidthCard}",
|
|
2526
2534
|
"borderWidthActionCardActive": "{borderWidthCard}",
|
|
2527
2535
|
"borderWidthActionCardDisabled": "{borderWidthCard}",
|
|
2536
|
+
"borderRadiusSkeleton": "8px",
|
|
2528
2537
|
"motionDurationExtraFast": {
|
|
2529
2538
|
"default": "45ms",
|
|
2530
2539
|
"disabled": "0ms"
|
|
@@ -5033,6 +5042,14 @@ export var preset = {
|
|
|
5033
5042
|
"light": "{colorNeutral600}",
|
|
5034
5043
|
"dark": "{colorNeutral600}"
|
|
5035
5044
|
},
|
|
5045
|
+
"colorBackgroundSkeleton": {
|
|
5046
|
+
"light": "{colorNeutral750}",
|
|
5047
|
+
"dark": "{colorNeutral750}"
|
|
5048
|
+
},
|
|
5049
|
+
"colorBackgroundSkeletonWave": {
|
|
5050
|
+
"light": "{colorNeutral700}",
|
|
5051
|
+
"dark": "{colorNeutral700}"
|
|
5052
|
+
},
|
|
5036
5053
|
"colorPrimary50": "#f0fbff",
|
|
5037
5054
|
"colorPrimary100": "#d1f1ff",
|
|
5038
5055
|
"colorPrimary200": "#b8e7ff",
|
|
@@ -6502,6 +6519,14 @@ export var preset = {
|
|
|
6502
6519
|
"light": "{colorNeutral600}",
|
|
6503
6520
|
"dark": "{colorNeutral600}"
|
|
6504
6521
|
},
|
|
6522
|
+
"colorBackgroundSkeleton": {
|
|
6523
|
+
"light": "{colorNeutral750}",
|
|
6524
|
+
"dark": "{colorNeutral750}"
|
|
6525
|
+
},
|
|
6526
|
+
"colorBackgroundSkeletonWave": {
|
|
6527
|
+
"light": "{colorNeutral700}",
|
|
6528
|
+
"dark": "{colorNeutral700}"
|
|
6529
|
+
},
|
|
6505
6530
|
"colorPrimary50": "#f0fbff",
|
|
6506
6531
|
"colorPrimary100": "#d1f1ff",
|
|
6507
6532
|
"colorPrimary200": "#b8e7ff",
|
|
@@ -7898,6 +7923,14 @@ export var preset = {
|
|
|
7898
7923
|
"colorIconActionCardDisabled": {
|
|
7899
7924
|
"light": "{colorNeutral400}",
|
|
7900
7925
|
"dark": "{colorNeutral600}"
|
|
7926
|
+
},
|
|
7927
|
+
"colorBackgroundSkeleton": {
|
|
7928
|
+
"light": "{colorNeutral250}",
|
|
7929
|
+
"dark": "{colorNeutral750}"
|
|
7930
|
+
},
|
|
7931
|
+
"colorBackgroundSkeletonWave": {
|
|
7932
|
+
"light": "{colorNeutral150}",
|
|
7933
|
+
"dark": "{colorNeutral700}"
|
|
7901
7934
|
}
|
|
7902
7935
|
}
|
|
7903
7936
|
},
|
|
@@ -9180,6 +9213,14 @@ export var preset = {
|
|
|
9180
9213
|
"colorIconActionCardDisabled": {
|
|
9181
9214
|
"light": "{colorNeutral400}",
|
|
9182
9215
|
"dark": "{colorNeutral600}"
|
|
9216
|
+
},
|
|
9217
|
+
"colorBackgroundSkeleton": {
|
|
9218
|
+
"light": "{colorNeutral250}",
|
|
9219
|
+
"dark": "{colorNeutral750}"
|
|
9220
|
+
},
|
|
9221
|
+
"colorBackgroundSkeletonWave": {
|
|
9222
|
+
"light": "{colorNeutral150}",
|
|
9223
|
+
"dark": "{colorNeutral700}"
|
|
9183
9224
|
}
|
|
9184
9225
|
}
|
|
9185
9226
|
},
|
|
@@ -10463,6 +10504,14 @@ export var preset = {
|
|
|
10463
10504
|
"light": "{colorNeutral400}",
|
|
10464
10505
|
"dark": "{colorNeutral600}"
|
|
10465
10506
|
},
|
|
10507
|
+
"colorBackgroundSkeleton": {
|
|
10508
|
+
"light": "{colorNeutral250}",
|
|
10509
|
+
"dark": "{colorNeutral750}"
|
|
10510
|
+
},
|
|
10511
|
+
"colorBackgroundSkeletonWave": {
|
|
10512
|
+
"light": "{colorNeutral150}",
|
|
10513
|
+
"dark": "{colorNeutral700}"
|
|
10514
|
+
},
|
|
10466
10515
|
"fontExpandableHeadingSize": "14px",
|
|
10467
10516
|
"borderDividerSectionWidth": "1px"
|
|
10468
10517
|
}
|
|
@@ -11746,6 +11795,14 @@ export var preset = {
|
|
|
11746
11795
|
"colorIconActionCardDisabled": {
|
|
11747
11796
|
"light": "{colorNeutral600}",
|
|
11748
11797
|
"dark": "{colorNeutral600}"
|
|
11798
|
+
},
|
|
11799
|
+
"colorBackgroundSkeleton": {
|
|
11800
|
+
"light": "{colorNeutral750}",
|
|
11801
|
+
"dark": "{colorNeutral750}"
|
|
11802
|
+
},
|
|
11803
|
+
"colorBackgroundSkeletonWave": {
|
|
11804
|
+
"light": "{colorNeutral700}",
|
|
11805
|
+
"dark": "{colorNeutral700}"
|
|
11749
11806
|
}
|
|
11750
11807
|
}
|
|
11751
11808
|
},
|
|
@@ -12351,6 +12408,8 @@ export var preset = {
|
|
|
12351
12408
|
"colorIconActionCardHover": "color",
|
|
12352
12409
|
"colorIconActionCardActive": "color",
|
|
12353
12410
|
"colorIconActionCardDisabled": "color",
|
|
12411
|
+
"colorBackgroundSkeleton": "color",
|
|
12412
|
+
"colorBackgroundSkeletonWave": "color",
|
|
12354
12413
|
"motionDurationExtraFast": "motion",
|
|
12355
12414
|
"motionDurationExtraSlow": "motion",
|
|
12356
12415
|
"motionDurationFast": "motion",
|
|
@@ -14208,6 +14267,8 @@ export var preset = {
|
|
|
14208
14267
|
"colorIconActionCardHover": "color-icon-action-card-hover",
|
|
14209
14268
|
"colorIconActionCardActive": "color-icon-action-card-active",
|
|
14210
14269
|
"colorIconActionCardDisabled": "color-icon-action-card-disabled",
|
|
14270
|
+
"colorBackgroundSkeleton": "color-background-skeleton",
|
|
14271
|
+
"colorBackgroundSkeletonWave": "color-background-skeleton-wave",
|
|
14211
14272
|
"fontBoxValueLargeWeight": "font-box-value-large-weight",
|
|
14212
14273
|
"fontButtonLetterSpacing": "font-button-letter-spacing",
|
|
14213
14274
|
"fontChartDetailSize": "font-chart-detail-size",
|
|
@@ -14334,6 +14395,7 @@ export var preset = {
|
|
|
14334
14395
|
"borderWidthActionCardHover": "border-width-action-card-hover",
|
|
14335
14396
|
"borderWidthActionCardActive": "border-width-action-card-active",
|
|
14336
14397
|
"borderWidthActionCardDisabled": "border-width-action-card-disabled",
|
|
14398
|
+
"borderRadiusSkeleton": "border-radius-skeleton",
|
|
14337
14399
|
"motionDurationExtraFast": "motion-duration-extra-fast",
|
|
14338
14400
|
"motionDurationExtraSlow": "motion-duration-extra-slow",
|
|
14339
14401
|
"motionDurationFast": "motion-duration-fast",
|
|
@@ -15112,6 +15174,8 @@ export var preset = {
|
|
|
15112
15174
|
"colorIconActionCardHover": "--color-icon-action-card-hover-qxq4pp",
|
|
15113
15175
|
"colorIconActionCardActive": "--color-icon-action-card-active-rhp94s",
|
|
15114
15176
|
"colorIconActionCardDisabled": "--color-icon-action-card-disabled-wm3kyf",
|
|
15177
|
+
"colorBackgroundSkeleton": "--color-background-skeleton-sjxg4n",
|
|
15178
|
+
"colorBackgroundSkeletonWave": "--color-background-skeleton-wave-1dy97d",
|
|
15115
15179
|
"fontBoxValueLargeWeight": "--font-box-value-large-weight-wr00sw",
|
|
15116
15180
|
"fontButtonLetterSpacing": "--font-button-letter-spacing-ufowe3",
|
|
15117
15181
|
"fontChartDetailSize": "--font-chart-detail-size-9qr25q",
|
|
@@ -15238,6 +15302,7 @@ export var preset = {
|
|
|
15238
15302
|
"borderWidthActionCardHover": "--border-width-action-card-hover-02l6fg",
|
|
15239
15303
|
"borderWidthActionCardActive": "--border-width-action-card-active-pwtgzu",
|
|
15240
15304
|
"borderWidthActionCardDisabled": "--border-width-action-card-disabled-rdvlbc",
|
|
15305
|
+
"borderRadiusSkeleton": "--border-radius-skeleton-9lkvfi",
|
|
15241
15306
|
"motionDurationExtraFast": "--motion-duration-extra-fast-l4w48j",
|
|
15242
15307
|
"motionDurationExtraSlow": "--motion-duration-extra-slow-29bqym",
|
|
15243
15308
|
"motionDurationFast": "--motion-duration-fast-unntf6",
|
|
@@ -8,6 +8,11 @@ interface InternalLiveRegionProps extends InternalBaseComponentProps, LiveRegion
|
|
|
8
8
|
* interrupted by other actions (like text entry in text filtering).
|
|
9
9
|
*/
|
|
10
10
|
delay?: number;
|
|
11
|
+
/**
|
|
12
|
+
* By default, the live region will announce the message immediately on mount.
|
|
13
|
+
* This attribute prevents that.
|
|
14
|
+
*/
|
|
15
|
+
preventInitialAnnouncement?: boolean;
|
|
11
16
|
/**
|
|
12
17
|
* Use a list of strings and/or refs to existing elements for building the
|
|
13
18
|
* announcement text. If this property is set, `children` and `message` will
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/live-region/internal.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAiD,MAAM,OAAO,CAAC;AAMtE,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAElF,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAK/C,UAAU,uBAAwB,SAAQ,0BAA0B,EAAE,eAAe;IACnF;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;OAIG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,GAAG,SAAS,CAAC,CAAC;CAC5E;AAED,MAAM,WAAW,qBAAqB;IACpC;;;;;;;OAOG;IACH,UAAU,IAAI,IAAI,CAAC;CACpB;;AAED,
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/live-region/internal.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAiD,MAAM,OAAO,CAAC;AAMtE,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAElF,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAK/C,UAAU,uBAAwB,SAAQ,0BAA0B,EAAE,eAAe;IACnF;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,0BAA0B,CAAC,EAAE,OAAO,CAAC;IAErC;;;;OAIG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,GAAG,SAAS,CAAC,CAAC;CAC5E;AAED,MAAM,WAAW,qBAAqB;IACpC;;;;;;;OAOG;IACH,UAAU,IAAI,IAAI,CAAC;CACpB;;AAED,wBAmFG;AAcH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAU5D"}
|
|
@@ -7,7 +7,7 @@ import { getBaseProps } from '../internal/base-component';
|
|
|
7
7
|
import { LiveRegionController } from './controller';
|
|
8
8
|
import styles from './styles.css.js';
|
|
9
9
|
import testUtilStyles from './test-classes/styles.css.js';
|
|
10
|
-
export default React.forwardRef(function InternalLiveRegion({ assertive = false, hidden = false, tagName: TagName = 'div', delay, sources, children, __internalRootRef, className, ...restProps }, ref) {
|
|
10
|
+
export default React.forwardRef(function InternalLiveRegion({ assertive = false, hidden = false, tagName: TagName = 'div', delay, sources, preventInitialAnnouncement, children, __internalRootRef, className, ...restProps }, ref) {
|
|
11
11
|
const baseProps = getBaseProps(restProps);
|
|
12
12
|
const childrenRef = useRef(null);
|
|
13
13
|
const mergedRef = useMergeRefs(childrenRef, __internalRootRef);
|
|
@@ -41,11 +41,19 @@ export default React.forwardRef(function InternalLiveRegion({ assertive = false,
|
|
|
41
41
|
return extractTextContent(childrenRef.current);
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
|
+
const initialAnnouncementContent = useRef();
|
|
44
45
|
// Call the controller on every render. The controller will deduplicate the
|
|
45
46
|
// message against the previous announcement internally.
|
|
46
47
|
useEffect(() => {
|
|
47
48
|
var _a;
|
|
48
|
-
|
|
49
|
+
const message = getContent();
|
|
50
|
+
if (initialAnnouncementContent.current === undefined) {
|
|
51
|
+
initialAnnouncementContent.current = message;
|
|
52
|
+
}
|
|
53
|
+
if (preventInitialAnnouncement && initialAnnouncementContent.current === message) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
(_a = liveRegionControllerRef.current) === null || _a === void 0 ? void 0 : _a.announce({ message });
|
|
49
57
|
});
|
|
50
58
|
useImperativeHandle(ref, () => ({
|
|
51
59
|
reannounce() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/live-region/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtE,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAE7E,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAGpD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,cAAc,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/live-region/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtE,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAE7E,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,oBAAoB,EAAE,M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useEffect, useImperativeHandle, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { useMergeRefs } from '@cloudscape-design/component-toolkit/internal';\n\nimport { getBaseProps } from '../internal/base-component';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { LiveRegionController } from './controller';\nimport { LiveRegionProps } from './interfaces';\n\nimport styles from './styles.css.js';\nimport testUtilStyles from './test-classes/styles.css.js';\n\ninterface InternalLiveRegionProps extends InternalBaseComponentProps, LiveRegionProps {\n /**\n * The delay between each announcement from this live region. You should\n * leave this set to the default unless this live region is commonly\n * interrupted by other actions (like text entry in text filtering).\n */\n delay?: number;\n\n /**\n * By default, the live region will announce the message immediately on mount.\n * This attribute prevents that.\n */\n preventInitialAnnouncement?: boolean;\n\n /**\n * Use a list of strings and/or refs to existing elements for building the\n * announcement text. If this property is set, `children` and `message` will\n * be ignored.\n */\n sources?: ReadonlyArray<string | React.RefObject<HTMLElement> | undefined>;\n}\n\nexport interface InternalLiveRegionRef {\n /**\n * Force the live region to announce the message, even if it's the same as\n * the previously announced message.\n *\n * This is useful when making status updates after a change (e.g. filtering)\n * where the new message might be the same as the old one, but the announcement\n * also serves to tell screen reader users that the action was performed.\n */\n reannounce(): void;\n}\n\nexport default React.forwardRef(function InternalLiveRegion(\n {\n assertive = false,\n hidden = false,\n tagName: TagName = 'div',\n delay,\n sources,\n preventInitialAnnouncement,\n children,\n __internalRootRef,\n className,\n ...restProps\n }: InternalLiveRegionProps,\n ref: React.Ref<InternalLiveRegionRef>\n) {\n const baseProps = getBaseProps(restProps);\n const childrenRef = useRef<HTMLSpanElement & HTMLDivElement>(null);\n const mergedRef = useMergeRefs(childrenRef, __internalRootRef);\n\n useEffect(() => {\n // We have to do this because `inert` isn't properly supported until\n // React 19 and this seems much more maintainable than version detection.\n // `inert` is better than `hidden` because it also blocks pointer and\n // focus events as well as hiding the contents from screen readers.\n // https://github.com/facebook/react/issues/17157\n if (childrenRef.current) {\n childrenRef.current.inert = hidden;\n }\n }, [hidden]);\n\n // Initialize the live region controller inside an effect. We have to do this\n // because the controller depends on DOM elements, which aren't available on the\n // server.\n const liveRegionControllerRef = useRef<LiveRegionController | undefined>();\n useEffect(() => {\n const liveRegionController = new LiveRegionController(assertive ? 'assertive' : 'polite', delay);\n liveRegionControllerRef.current = liveRegionController;\n return () => {\n liveRegionController.destroy();\n liveRegionControllerRef.current = undefined;\n };\n }, [assertive, delay]);\n\n const getContent = () => {\n if (sources) {\n return getSourceContent(sources);\n }\n if (childrenRef.current) {\n return extractTextContent(childrenRef.current);\n }\n };\n\n const initialAnnouncementContent = useRef<string | undefined>();\n\n // Call the controller on every render. The controller will deduplicate the\n // message against the previous announcement internally.\n useEffect(() => {\n const message = getContent();\n if (initialAnnouncementContent.current === undefined) {\n initialAnnouncementContent.current = message;\n }\n if (preventInitialAnnouncement && initialAnnouncementContent.current === message) {\n return;\n }\n liveRegionControllerRef.current?.announce({ message });\n });\n\n useImperativeHandle(ref, () => ({\n reannounce() {\n liveRegionControllerRef.current?.announce({ message: getContent(), forceReannounce: true });\n },\n }));\n\n return (\n <TagName\n ref={mergedRef}\n {...baseProps}\n className={clsx(styles.root, testUtilStyles.root, className)}\n hidden={hidden}\n >\n {children}\n </TagName>\n );\n});\n\nconst processNode = (childNode: Node): string => {\n if (childNode.nodeType === Node.TEXT_NODE) {\n return childNode.textContent || '';\n }\n\n if (childNode.nodeType === Node.ELEMENT_NODE) {\n return extractTextContent(childNode as HTMLElement);\n }\n\n return '';\n};\n\nexport function extractTextContent(node: HTMLElement): string {\n // We use the text content of the node as the announcement text.\n // This only extracts text content from the node including all its children which is enough for now.\n // To make it more powerful, it is possible to create a more sophisticated extractor with respect to\n // ARIA properties to ignore aria-hidden nodes and read ARIA labels from the live content.\n if (!node || !node?.childNodes?.length) {\n return '';\n }\n\n return Array.from(node.childNodes, processNode).join(' ').replace(/\\s+/g, ' ').trim();\n}\n\nfunction getSourceContent(source: ReadonlyArray<string | React.RefObject<HTMLElement> | undefined>): string {\n return source\n .map(item => {\n if (!item || typeof item === 'string') {\n return item;\n }\n if (item.current) {\n return extractTextContent(item.current);\n }\n })\n .filter(Boolean)\n .join(' ');\n}\n"]}
|
|
@@ -102,6 +102,7 @@
|
|
|
102
102
|
"./segmented-control": "./segmented-control/index.js",
|
|
103
103
|
"./select": "./select/index.js",
|
|
104
104
|
"./side-navigation": "./side-navigation/index.js",
|
|
105
|
+
"./skeleton": "./skeleton/index.js",
|
|
105
106
|
"./slider": "./slider/index.js",
|
|
106
107
|
"./space-between": "./space-between/index.js",
|
|
107
108
|
"./spinner": "./spinner/index.js",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/skeleton/index.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAG7C,OAAO,EAAE,aAAa,EAAE,CAAC;AAEzB,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAC/B,OAAmB,EACnB,OAAiB,EACjB,WAAmB,EACnB,MAAM,EACN,KAAK,EACL,GAAG,SAAS,EACb,EAAE,aAAa,eAqBf"}
|