@cloudscape-design/components-themeable 3.0.878 → 3.0.879
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/collection-preferences/content-display/content-display-option.scss +4 -0
- package/lib/internal/scss/internal/components/drag-handle/styles.scss +51 -18
- package/lib/internal/scss/internal/components/panel-resize-handle/styles.scss +3 -42
- package/lib/internal/scss/tabs/tab-header-bar.scss +1 -0
- package/lib/internal/template/app-layout/drawer/resizable-drawer.d.ts.map +1 -1
- package/lib/internal/template/app-layout/drawer/resizable-drawer.js +3 -2
- package/lib/internal/template/app-layout/drawer/resizable-drawer.js.map +1 -1
- package/lib/internal/template/app-layout/utils/use-focus-control.d.ts +2 -1
- package/lib/internal/template/app-layout/utils/use-focus-control.d.ts.map +1 -1
- package/lib/internal/template/app-layout/utils/use-focus-control.js +2 -0
- package/lib/internal/template/app-layout/utils/use-focus-control.js.map +1 -1
- package/lib/internal/template/app-layout/utils/use-resize.d.ts.map +1 -1
- package/lib/internal/template/app-layout/utils/use-resize.js +3 -2
- package/lib/internal/template/app-layout/utils/use-resize.js.map +1 -1
- package/lib/internal/template/app-layout/utils/use-split-panel-focus-control.d.ts +2 -1
- package/lib/internal/template/app-layout/utils/use-split-panel-focus-control.d.ts.map +1 -1
- package/lib/internal/template/app-layout/utils/use-split-panel-focus-control.js +1 -0
- package/lib/internal/template/app-layout/utils/use-split-panel-focus-control.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-drawer.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-drawer.js +3 -2
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-drawer.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/local-drawer.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/local-drawer.js +3 -2
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/local-drawer.js.map +1 -1
- package/lib/internal/template/attribute-editor/interfaces.d.ts +7 -0
- package/lib/internal/template/attribute-editor/interfaces.d.ts.map +1 -1
- package/lib/internal/template/attribute-editor/interfaces.js.map +1 -1
- package/lib/internal/template/attribute-editor/internal.d.ts.map +1 -1
- package/lib/internal/template/attribute-editor/internal.js +2 -2
- package/lib/internal/template/attribute-editor/internal.js.map +1 -1
- package/lib/internal/template/collection-preferences/content-display/content-display-option.d.ts.map +1 -1
- package/lib/internal/template/collection-preferences/content-display/content-display-option.js +2 -1
- package/lib/internal/template/collection-preferences/content-display/content-display-option.js.map +1 -1
- package/lib/internal/template/collection-preferences/content-display/styles.css.js +11 -10
- package/lib/internal/template/collection-preferences/content-display/styles.scoped.css +14 -10
- package/lib/internal/template/collection-preferences/content-display/styles.selectors.js +11 -10
- package/lib/internal/template/collection-preferences/index.d.ts.map +1 -1
- package/lib/internal/template/collection-preferences/index.js +1 -1
- package/lib/internal/template/collection-preferences/index.js.map +1 -1
- package/lib/internal/template/collection-preferences/styles.css.js +38 -37
- package/lib/internal/template/collection-preferences/styles.scoped.css +42 -38
- package/lib/internal/template/collection-preferences/styles.selectors.js +38 -37
- package/lib/internal/template/internal/components/drag-handle/index.d.ts +4 -8
- package/lib/internal/template/internal/components/drag-handle/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/drag-handle/index.js +23 -5
- package/lib/internal/template/internal/components/drag-handle/index.js.map +1 -1
- package/lib/internal/template/internal/components/drag-handle/interfaces.d.ts +25 -0
- package/lib/internal/template/internal/components/drag-handle/interfaces.d.ts.map +1 -0
- package/lib/internal/template/internal/components/drag-handle/interfaces.js +4 -0
- package/lib/internal/template/internal/components/drag-handle/interfaces.js.map +1 -0
- package/lib/internal/template/internal/components/drag-handle/resize-icon.d.ts +7 -0
- package/lib/internal/template/internal/components/drag-handle/resize-icon.d.ts.map +1 -0
- package/lib/internal/template/internal/components/{panel-resize-handle/icon.js → drag-handle/resize-icon.js} +5 -3
- package/lib/internal/template/internal/components/drag-handle/resize-icon.js.map +1 -0
- package/lib/internal/template/internal/components/drag-handle/styles.css.js +12 -3
- package/lib/internal/template/internal/components/drag-handle/styles.scoped.css +50 -20
- package/lib/internal/template/internal/components/drag-handle/styles.selectors.js +12 -3
- package/lib/internal/template/internal/components/options-list/index.js +1 -1
- package/lib/internal/template/internal/components/options-list/index.js.map +1 -1
- package/lib/internal/template/internal/components/panel-resize-handle/index.d.ts +4 -2
- package/lib/internal/template/internal/components/panel-resize-handle/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/panel-resize-handle/index.js +8 -5
- package/lib/internal/template/internal/components/panel-resize-handle/index.js.map +1 -1
- package/lib/internal/template/internal/components/panel-resize-handle/styles.css.js +2 -5
- package/lib/internal/template/internal/components/panel-resize-handle/styles.scoped.css +3 -191
- package/lib/internal/template/internal/components/panel-resize-handle/styles.selectors.js +2 -5
- package/lib/internal/template/internal/components/portal/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/portal/index.js.map +1 -1
- package/lib/internal/template/internal/environment.js +1 -1
- package/lib/internal/template/internal/environment.json +1 -1
- package/lib/internal/template/internal/events/index.d.ts +1 -1
- package/lib/internal/template/internal/events/index.d.ts.map +1 -1
- package/lib/internal/template/internal/events/index.js.map +1 -1
- package/lib/internal/template/popover/internal.js +5 -4
- package/lib/internal/template/popover/internal.js.map +1 -1
- package/lib/internal/template/prompt-input/internal.d.ts.map +1 -1
- package/lib/internal/template/prompt-input/internal.js +1 -3
- package/lib/internal/template/prompt-input/internal.js.map +1 -1
- package/lib/internal/template/split-panel/implementation.d.ts.map +1 -1
- package/lib/internal/template/split-panel/implementation.js +7 -6
- package/lib/internal/template/split-panel/implementation.js.map +1 -1
- package/lib/internal/template/tabs/styles.css.js +28 -28
- package/lib/internal/template/tabs/styles.scoped.css +50 -49
- package/lib/internal/template/tabs/styles.selectors.js +28 -28
- package/package.json +1 -1
- package/lib/internal/template/internal/components/panel-resize-handle/icon.d.ts +0 -5
- package/lib/internal/template/internal/components/panel-resize-handle/icon.d.ts.map +0 -1
- package/lib/internal/template/internal/components/panel-resize-handle/icon.js.map +0 -1
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
interface ResizeHandleProps {
|
|
3
|
-
className?: string;
|
|
4
3
|
ariaLabel: string | undefined;
|
|
5
4
|
position: 'side' | 'bottom';
|
|
6
5
|
ariaValuenow: number;
|
|
7
6
|
onKeyDown: (event: React.KeyboardEvent<HTMLElement>) => void;
|
|
8
7
|
onPointerDown: (event: React.PointerEvent<HTMLElement>) => void;
|
|
8
|
+
className?: string;
|
|
9
9
|
}
|
|
10
|
-
declare const _default: React.ForwardRefExoticComponent<ResizeHandleProps & React.RefAttributes<
|
|
10
|
+
declare const _default: React.ForwardRefExoticComponent<ResizeHandleProps & React.RefAttributes<{
|
|
11
|
+
focus: () => void;
|
|
12
|
+
}>>;
|
|
11
13
|
export default _default;
|
|
12
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/panel-resize-handle/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/panel-resize-handle/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,UAAU,iBAAiB;IACzB,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAC7D,aAAa,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAChE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;;WAIyB,MAAM,IAAI;;AAFpC,wBAsBG"}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import
|
|
5
|
-
import ResizeHandleIcon from './icon';
|
|
4
|
+
import DragHandle from '../drag-handle';
|
|
6
5
|
import styles from './styles.css.js';
|
|
7
|
-
export default React.forwardRef(function PanelResizeHandle({
|
|
8
|
-
return (React.createElement("div", {
|
|
9
|
-
React.createElement(
|
|
6
|
+
export default React.forwardRef(function PanelResizeHandle({ ariaLabel, ariaValuenow, position, onKeyDown, onPointerDown, className }, ref) {
|
|
7
|
+
return (React.createElement("div", { className: styles[`handle-wrapper-${position}`] },
|
|
8
|
+
React.createElement(DragHandle, { variant: position === 'bottom' ? 'resize-vertical' : 'resize-horizontal', size: "small", ref: ref, ariaLabel: ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : '', ariaValue: {
|
|
9
|
+
valueMin: 0,
|
|
10
|
+
valueMax: 100,
|
|
11
|
+
valueNow: ariaValuenow,
|
|
12
|
+
}, onPointerDown: onPointerDown, onKeyDown: onKeyDown, className: className })));
|
|
10
13
|
});
|
|
11
14
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/components/panel-resize-handle/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/components/panel-resize-handle/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,UAAU,MAAM,gBAAgB,CAAC;AAExC,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAWrC,eAAe,KAAK,CAAC,UAAU,CAAC,SAAS,iBAAiB,CACxD,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,aAAa,EAAE,SAAS,EAAqB,EAC7F,GAAqC;IAErC,OAAO,CACL,6BAAK,SAAS,EAAE,MAAM,CAAC,kBAAkB,QAAQ,EAAE,CAAC;QAClD,oBAAC,UAAU,IACT,OAAO,EAAE,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,mBAAmB,EACxE,IAAI,EAAC,OAAO,EACZ,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,EAAE,EAC1B,SAAS,EAAE;gBACT,QAAQ,EAAE,CAAC;gBACX,QAAQ,EAAE,GAAG;gBACb,QAAQ,EAAE,YAAY;aACvB,EACD,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,SAAS,GACpB,CACE,CACP,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React from 'react';\n\nimport DragHandle from '../drag-handle';\n\nimport styles from './styles.css.js';\n\ninterface ResizeHandleProps {\n ariaLabel: string | undefined;\n position: 'side' | 'bottom';\n ariaValuenow: number;\n onKeyDown: (event: React.KeyboardEvent<HTMLElement>) => void;\n onPointerDown: (event: React.PointerEvent<HTMLElement>) => void;\n className?: string;\n}\n\nexport default React.forwardRef(function PanelResizeHandle(\n { ariaLabel, ariaValuenow, position, onKeyDown, onPointerDown, className }: ResizeHandleProps,\n ref: React.Ref<{ focus: () => void }>\n) {\n return (\n <div className={styles[`handle-wrapper-${position}`]}>\n <DragHandle\n variant={position === 'bottom' ? 'resize-vertical' : 'resize-horizontal'}\n size=\"small\"\n ref={ref}\n ariaLabel={ariaLabel ?? ''}\n ariaValue={{\n valueMin: 0,\n valueMax: 100,\n valueNow: ariaValuenow,\n }}\n onPointerDown={onPointerDown}\n onKeyDown={onKeyDown}\n className={className}\n />\n </div>\n );\n});\n"]}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"slider-icon": "awsui_slider-icon_cqzlk_vw9m6_187",
|
|
7
|
-
"slider-icon-bottom": "awsui_slider-icon-bottom_cqzlk_vw9m6_193",
|
|
8
|
-
"slider-icon-side": "awsui_slider-icon-side_cqzlk_vw9m6_197"
|
|
4
|
+
"handle-wrapper-side": "awsui_handle-wrapper-side_cqzlk_1qkms_5",
|
|
5
|
+
"handle-wrapper-bottom": "awsui_handle-wrapper-bottom_cqzlk_1qkms_9"
|
|
9
6
|
};
|
|
10
7
|
|
|
@@ -2,198 +2,10 @@
|
|
|
2
2
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
|
-
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
7
|
-
SPDX-License-Identifier: Apache-2.0
|
|
8
|
-
*/
|
|
9
|
-
/*
|
|
10
|
-
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
11
|
-
SPDX-License-Identifier: Apache-2.0
|
|
12
|
-
*/
|
|
13
|
-
/*
|
|
14
|
-
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
15
|
-
SPDX-License-Identifier: Apache-2.0
|
|
16
|
-
*/
|
|
17
|
-
/*
|
|
18
|
-
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
19
|
-
SPDX-License-Identifier: Apache-2.0
|
|
20
|
-
*/
|
|
21
|
-
/*
|
|
22
|
-
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
23
|
-
SPDX-License-Identifier: Apache-2.0
|
|
24
|
-
*/
|
|
25
|
-
/*
|
|
26
|
-
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
27
|
-
SPDX-License-Identifier: Apache-2.0
|
|
28
|
-
*/
|
|
29
|
-
/*
|
|
30
|
-
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
31
|
-
SPDX-License-Identifier: Apache-2.0
|
|
32
|
-
*/
|
|
33
|
-
/*
|
|
34
|
-
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
35
|
-
SPDX-License-Identifier: Apache-2.0
|
|
36
|
-
*/
|
|
37
|
-
/*
|
|
38
|
-
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
39
|
-
SPDX-License-Identifier: Apache-2.0
|
|
40
|
-
*/
|
|
41
|
-
/*
|
|
42
|
-
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
43
|
-
SPDX-License-Identifier: Apache-2.0
|
|
44
|
-
*/
|
|
45
|
-
/*
|
|
46
|
-
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
47
|
-
SPDX-License-Identifier: Apache-2.0
|
|
48
|
-
*/
|
|
49
|
-
/*
|
|
50
|
-
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
51
|
-
SPDX-License-Identifier: Apache-2.0
|
|
52
|
-
*/
|
|
53
|
-
/*
|
|
54
|
-
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
55
|
-
SPDX-License-Identifier: Apache-2.0
|
|
56
|
-
*/
|
|
57
|
-
/*
|
|
58
|
-
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
59
|
-
SPDX-License-Identifier: Apache-2.0
|
|
60
|
-
*/
|
|
61
|
-
/*
|
|
62
|
-
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
63
|
-
SPDX-License-Identifier: Apache-2.0
|
|
64
|
-
*/
|
|
65
|
-
/*
|
|
66
|
-
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
67
|
-
SPDX-License-Identifier: Apache-2.0
|
|
68
|
-
*/
|
|
69
|
-
/*
|
|
70
|
-
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
71
|
-
SPDX-License-Identifier: Apache-2.0
|
|
72
|
-
*/
|
|
73
|
-
/*
|
|
74
|
-
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
75
|
-
SPDX-License-Identifier: Apache-2.0
|
|
76
|
-
*/
|
|
77
|
-
/*
|
|
78
|
-
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
79
|
-
SPDX-License-Identifier: Apache-2.0
|
|
80
|
-
*/
|
|
81
|
-
/*
|
|
82
|
-
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
83
|
-
SPDX-License-Identifier: Apache-2.0
|
|
84
|
-
*/
|
|
85
|
-
/*
|
|
86
|
-
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
87
|
-
SPDX-License-Identifier: Apache-2.0
|
|
88
|
-
*/
|
|
89
|
-
/*
|
|
90
|
-
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
91
|
-
SPDX-License-Identifier: Apache-2.0
|
|
92
|
-
*/
|
|
93
|
-
/*
|
|
94
|
-
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
95
|
-
SPDX-License-Identifier: Apache-2.0
|
|
96
|
-
*/
|
|
97
|
-
/*
|
|
98
|
-
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
99
|
-
SPDX-License-Identifier: Apache-2.0
|
|
100
|
-
*/
|
|
101
|
-
/*
|
|
102
|
-
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
103
|
-
SPDX-License-Identifier: Apache-2.0
|
|
104
|
-
*/
|
|
105
|
-
/*
|
|
106
|
-
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
107
|
-
SPDX-License-Identifier: Apache-2.0
|
|
108
|
-
*/
|
|
109
|
-
/*
|
|
110
|
-
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
111
|
-
SPDX-License-Identifier: Apache-2.0
|
|
112
|
-
*/
|
|
113
|
-
/* stylelint-disable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
|
|
114
|
-
/* stylelint-enable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
|
|
115
|
-
/*
|
|
116
|
-
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
117
|
-
SPDX-License-Identifier: Apache-2.0
|
|
118
|
-
*/
|
|
119
|
-
/*
|
|
120
|
-
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
121
|
-
SPDX-License-Identifier: Apache-2.0
|
|
122
|
-
*/
|
|
123
|
-
/*
|
|
124
|
-
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
125
|
-
SPDX-License-Identifier: Apache-2.0
|
|
126
|
-
*/
|
|
127
|
-
/*
|
|
128
|
-
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
129
|
-
SPDX-License-Identifier: Apache-2.0
|
|
130
|
-
*/
|
|
131
|
-
/*
|
|
132
|
-
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
133
|
-
SPDX-License-Identifier: Apache-2.0
|
|
134
|
-
*/
|
|
135
|
-
/*
|
|
136
|
-
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
137
|
-
SPDX-License-Identifier: Apache-2.0
|
|
138
|
-
*/
|
|
139
|
-
/*
|
|
140
|
-
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
141
|
-
SPDX-License-Identifier: Apache-2.0
|
|
142
|
-
*/
|
|
143
|
-
/* Style used for links in slots/components that are text heavy, to help links stand out among
|
|
144
|
-
surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F73#description */
|
|
145
|
-
.awsui_slider_cqzlk_vw9m6_145:not(#\9) {
|
|
146
|
-
padding-block: 0;
|
|
147
|
-
padding-inline: 0;
|
|
148
|
-
cursor: ns-resize;
|
|
149
|
-
margin-block-start: 2px;
|
|
150
|
-
margin-block-end: 0;
|
|
151
|
-
margin-inline: 0;
|
|
152
|
-
block-size: 16px;
|
|
153
|
-
touch-action: none;
|
|
154
|
-
}
|
|
155
|
-
.awsui_slider_cqzlk_vw9m6_145:not(#\9):focus {
|
|
156
|
-
outline: none;
|
|
157
|
-
}
|
|
158
|
-
body[data-awsui-focus-visible=true] .awsui_slider_cqzlk_vw9m6_145:not(#\9):focus {
|
|
159
|
-
position: relative;
|
|
160
|
-
}
|
|
161
|
-
body[data-awsui-focus-visible=true] .awsui_slider_cqzlk_vw9m6_145:not(#\9):focus {
|
|
162
|
-
outline: 2px dotted transparent;
|
|
163
|
-
outline-offset: calc(0px - 1px);
|
|
164
|
-
}
|
|
165
|
-
body[data-awsui-focus-visible=true] .awsui_slider_cqzlk_vw9m6_145:not(#\9):focus::before {
|
|
166
|
-
content: " ";
|
|
167
|
-
display: block;
|
|
168
|
-
position: absolute;
|
|
169
|
-
inset-inline-start: calc(-1 * 0px);
|
|
170
|
-
inset-block-start: calc(-1 * 0px);
|
|
171
|
-
inline-size: calc(100% + 0px + 0px);
|
|
172
|
-
block-size: calc(100% + 0px + 0px);
|
|
173
|
-
border-start-start-radius: var(--border-radius-control-default-focus-ring-vy2hlh, 2px);
|
|
174
|
-
border-start-end-radius: var(--border-radius-control-default-focus-ring-vy2hlh, 2px);
|
|
175
|
-
border-end-start-radius: var(--border-radius-control-default-focus-ring-vy2hlh, 2px);
|
|
176
|
-
border-end-end-radius: var(--border-radius-control-default-focus-ring-vy2hlh, 2px);
|
|
177
|
-
box-shadow: 0 0 0 2px var(--color-border-item-focused-q68bgg, #0073bb);
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
.awsui_slider-side_cqzlk_vw9m6_180:not(#\9) {
|
|
181
|
-
cursor: ew-resize;
|
|
182
|
-
margin-block: 0;
|
|
5
|
+
.awsui_handle-wrapper-side_cqzlk_1qkms_5:not(#\9) {
|
|
183
6
|
margin-inline-start: 2px;
|
|
184
|
-
margin-inline-end: 0;
|
|
185
7
|
}
|
|
186
8
|
|
|
187
|
-
.
|
|
188
|
-
|
|
189
|
-
}
|
|
190
|
-
.awsui_slider-icon_cqzlk_vw9m6_187:not(#\9):hover {
|
|
191
|
-
stroke: var(--color-text-interactive-hover-kxltdh, #16191f);
|
|
192
|
-
}
|
|
193
|
-
.awsui_slider-icon-bottom_cqzlk_vw9m6_193:not(#\9) {
|
|
194
|
-
margin-block: auto;
|
|
195
|
-
margin-inline: auto;
|
|
196
|
-
}
|
|
197
|
-
.awsui_slider-icon-side_cqzlk_vw9m6_197:not(#\9) {
|
|
198
|
-
transform: rotate(90deg);
|
|
9
|
+
.awsui_handle-wrapper-bottom_cqzlk_1qkms_9:not(#\9) {
|
|
10
|
+
margin-block-start: 2px;
|
|
199
11
|
}
|
|
@@ -2,10 +2,7 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"slider-icon": "awsui_slider-icon_cqzlk_vw9m6_187",
|
|
8
|
-
"slider-icon-bottom": "awsui_slider-icon-bottom_cqzlk_vw9m6_193",
|
|
9
|
-
"slider-icon-side": "awsui_slider-icon-side_cqzlk_vw9m6_197"
|
|
5
|
+
"handle-wrapper-side": "awsui_handle-wrapper-side_cqzlk_1qkms_5",
|
|
6
|
+
"handle-wrapper-bottom": "awsui_handle-wrapper-bottom_cqzlk_1qkms_9"
|
|
10
7
|
};
|
|
11
8
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/portal/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAOzD,MAAM,WAAW,WAAW;IAC1B,SAAS,CAAC,EAAE,IAAI,GAAG,OAAO,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,OAAO,CAAC,WAAW,CAAC,CAAC;IAC1C,eAAe,CAAC,EAAE,CAAC,SAAS,EAAE,WAAW,KAAK,IAAI,CAAC;IACnD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AA+BD;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,eAAe,EAAE,QAAQ,EAAE,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/portal/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAOzD,MAAM,WAAW,WAAW;IAC1B,SAAS,CAAC,EAAE,IAAI,GAAG,OAAO,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,OAAO,CAAC,WAAW,CAAC,CAAC;IAC1C,eAAe,CAAC,EAAE,CAAC,SAAS,EAAE,WAAW,KAAK,IAAI,CAAC;IACnD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AA+BD;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,eAAe,EAAE,QAAQ,EAAE,EAAE,WAAW,4BAuBjG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/components/portal/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAc,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,EAAE,QAAQ,EAAE,M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AAO,UAAU,MAAM,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,eAAe,EAAE,QAAQ,EAAe;IAChG,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,QAAQ,CAAiB,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,IAAI,CAAC,CAAC;IAE1F,eAAe,CAAC,GAAG,EAAE;QACnB,IAAI,SAAS,EAAE;YACb,kBAAkB,CAAC,SAAS,CAAC,CAAC;YAC9B,OAAO;SACR;QACD,IAAI,aAAa,EAAE;YACjB,IAAI,YAAY,IAAI,CAAC,eAAe,EAAE;gBACpC,QAAQ,CAAC,QAAQ,EAAE,+DAA+D,CAAC,CAAC;aACrF;YACD,IAAI,CAAC,YAAY,IAAI,eAAe,EAAE;gBACpC,QAAQ,CAAC,QAAQ,EAAE,+DAA+D,CAAC,CAAC;aACrF;SACF;QACD,IAAI,YAAY,IAAI,eAAe,EAAE;YACnC,OAAO,oBAAoB,CAAC,YAAY,EAAE,eAAe,EAAE,kBAAkB,CAAC,CAAC;SAChF;QACD,OAAO,sBAAsB,CAAC,kBAAkB,CAAC,CAAC;IACpD,CAAC,EAAE,CAAC,SAAS,EAAE,YAAY,EAAE,eAAe,CAAC,CAAC,CAAC;IAE/C,OAAO,eAAe,IAAI,YAAY,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAC;AACpE,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useLayoutEffect, useState } from 'react';\nimport { createPortal } from 'react-dom';\n\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nimport { isDevelopment } from '../../is-development';\n\nexport interface PortalProps {\n container?: null | Element;\n getContainer?: () => Promise<HTMLElement>;\n removeContainer?: (container: HTMLElement) => void;\n children: React.ReactNode;\n}\n\nfunction manageDefaultContainer(setState: React.Dispatch<React.SetStateAction<Element | null>>) {\n const newContainer = document.createElement('div');\n document.body.appendChild(newContainer);\n setState(newContainer);\n return () => {\n document.body.removeChild(newContainer);\n };\n}\n\nfunction manageAsyncContainer(\n getContainer: () => Promise<HTMLElement>,\n removeContainer: (container: HTMLElement) => void,\n setState: React.Dispatch<React.SetStateAction<Element | null>>\n) {\n let newContainer: HTMLElement;\n getContainer().then(\n container => {\n newContainer = container;\n setState(container);\n },\n error => {\n console.warn('[AwsUi] [portal]: failed to load portal root', error);\n }\n );\n return () => {\n removeContainer(newContainer);\n };\n}\n\n/**\n * A safe react portal component that renders to a provided node.\n * If a node isn't provided, it creates one under document.body.\n */\nexport default function Portal({ container, getContainer, removeContainer, children }: PortalProps) {\n const [activeContainer, setActiveContainer] = useState<Element | null>(container ?? null);\n\n useLayoutEffect(() => {\n if (container) {\n setActiveContainer(container);\n return;\n }\n if (isDevelopment) {\n if (getContainer && !removeContainer) {\n warnOnce('portal', '`removeContainer` is required when `getContainer` is provided');\n }\n if (!getContainer && removeContainer) {\n warnOnce('portal', '`getContainer` is required when `removeContainer` is provided');\n }\n }\n if (getContainer && removeContainer) {\n return manageAsyncContainer(getContainer, removeContainer, setActiveContainer);\n }\n return manageDefaultContainer(setActiveContainer);\n }, [container, getContainer, removeContainer]);\n\n return activeContainer && createPortal(children, activeContainer);\n}\n"]}
|
|
@@ -26,7 +26,7 @@ export interface BaseNavigationDetail {
|
|
|
26
26
|
export declare function createCustomEvent<T>({ cancelable, detail }: CustomEventInit<T>): CustomEvent<T>;
|
|
27
27
|
export declare function fireNonCancelableEvent<T = null>(handler: NonCancelableEventHandler<T> | undefined, detail?: T): void;
|
|
28
28
|
export declare function fireCancelableEvent<T>(handler: CancelableEventHandler<T> | undefined, detail: T, sourceEvent?: React.SyntheticEvent | Event): boolean;
|
|
29
|
-
export declare function fireKeyboardEvent(handler: CancelableEventHandler<BaseKeyDetail
|
|
29
|
+
export declare function fireKeyboardEvent(handler: CancelableEventHandler<BaseKeyDetail> | undefined, reactEvent: React.KeyboardEvent): boolean;
|
|
30
30
|
export declare function hasModifierKeys(event: React.MouseEvent | React.KeyboardEvent): boolean;
|
|
31
31
|
export declare function isPlainLeftClick(event: React.MouseEvent | React.KeyboardEvent): boolean;
|
|
32
32
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/internal/events/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,MAAM,yBAAyB,CAAC,MAAM,GAAG,EAAE,IAAI,CAAC,KAAK,EAAE,wBAAwB,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;AAEvG,MAAM,MAAM,sBAAsB,CAAC,MAAM,GAAG,EAAE,IAAI,CAAC,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;AAEvF,MAAM,MAAM,wBAAwB,CAAC,UAAU,IAAI,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE,gBAAgB,CAAC,CAAC;AAmBnG,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,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CACxB,OAAO,EACP;QACE,OAAO,EAAE,UAAU,CAAC,OAAO;QAC3B,GAAG,EAAE,UAAU,CAAC,GAAG;QACnB,OAAO,EAAE,UAAU,CAAC,OAAO;QAC3B,QAAQ,EAAE,UAAU,CAAC,QAAQ;QAC7B,MAAM,EAAE,UAAU,CAAC,MAAM;QACzB,OAAO,EAAE,UAAU,CAAC,OAAO;QAC3B,WAAW,EAAE,UAAU,CAAC,WAAW,CAAC,WAAW;KAChD,EACD,UAAU,CACX,CAAC;AACJ,CAAC;AAED,MAAM,YAAY,GAAG,CAAC,CAAyC,EAAyB,EAAE;IACxF,OAAQ,CAAsB,CAAC,MAAM,KAAK,SAAS,CAAC;AACtD,CAAC,CAAC;AAEF,MAAM,UAAU,eAAe,CAAC,KAA6C;IAC3E,OAAO,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC;AAC1E,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,KAA6C;IAC5E,OAAO,KAAK,IAAI,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;AAC1F,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\n// This is a part of our public types API. We cannot change this in the current major version\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport type NonCancelableEventHandler<Detail = {}> = (event: NonCancelableCustomEvent<Detail>) => void;\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport type CancelableEventHandler<Detail = {}> = (event: CustomEvent<Detail>) => void;\n\nexport type NonCancelableCustomEvent<DetailType> = Omit<CustomEvent<DetailType>, 'preventDefault'>;\n\nclass CustomEventStub<T> {\n defaultPrevented = false;\n cancelBubble = false;\n constructor(\n public cancelable: boolean = false,\n public detail: T | null = null\n ) {}\n\n preventDefault() {\n this.defaultPrevented = true;\n }\n\n stopPropagation() {\n this.cancelBubble = true;\n }\n}\n\nexport interface BaseKeyDetail {\n keyCode: number;\n key: string;\n ctrlKey: boolean;\n shiftKey: boolean;\n altKey: boolean;\n metaKey: boolean;\n isComposing: boolean;\n}\n\nexport interface ClickDetail {\n button: number;\n ctrlKey: boolean;\n shiftKey: boolean;\n altKey: boolean;\n metaKey: boolean;\n}\n\nexport interface BaseNavigationDetail {\n href: string | undefined;\n external?: boolean;\n target?: string;\n}\n\nexport function createCustomEvent<T>({ cancelable, detail }: CustomEventInit<T>): CustomEvent<T> {\n return new CustomEventStub(cancelable, detail) as CustomEvent;\n}\n\nexport function fireNonCancelableEvent<T = null>(handler: NonCancelableEventHandler<T> | undefined, detail?: T) {\n if (!handler) {\n return;\n }\n const event = createCustomEvent({ cancelable: false, detail });\n handler(event);\n}\n\nexport function fireCancelableEvent<T>(\n handler: CancelableEventHandler<T> | undefined,\n detail: T,\n sourceEvent?: React.SyntheticEvent | Event\n) {\n if (!handler) {\n return false;\n }\n const event = createCustomEvent({ cancelable: true, detail });\n handler(event);\n if (event.defaultPrevented && sourceEvent) {\n sourceEvent.preventDefault();\n }\n if (event.cancelBubble && sourceEvent) {\n sourceEvent.stopPropagation();\n }\n return event.defaultPrevented;\n}\n\nexport function fireKeyboardEvent(\n handler: CancelableEventHandler<BaseKeyDetail> | undefined,\n reactEvent: React.KeyboardEvent\n) {\n return fireCancelableEvent(\n handler,\n {\n keyCode: reactEvent.keyCode,\n key: reactEvent.key,\n ctrlKey: reactEvent.ctrlKey,\n shiftKey: reactEvent.shiftKey,\n altKey: reactEvent.altKey,\n metaKey: reactEvent.metaKey,\n isComposing: reactEvent.nativeEvent.isComposing,\n },\n reactEvent\n );\n}\n\nconst isMouseEvent = (e: React.MouseEvent | React.KeyboardEvent): e is React.MouseEvent => {\n return (e as React.MouseEvent).button !== undefined;\n};\n\nexport function hasModifierKeys(event: React.MouseEvent | React.KeyboardEvent) {\n return event.ctrlKey || event.altKey || event.shiftKey || event.metaKey;\n}\n\nexport function isPlainLeftClick(event: React.MouseEvent | React.KeyboardEvent) {\n return event && (!isMouseEvent(event) || event.button === 0) && !hasModifierKeys(event);\n}\n"]}
|
|
@@ -90,9 +90,10 @@ function InternalPopover(_a, ref) {
|
|
|
90
90
|
};
|
|
91
91
|
const { tabIndex: triggerTabIndex } = useSingleTabStopNavigation(triggerRef);
|
|
92
92
|
const referrerId = useUniqueId();
|
|
93
|
-
const popoverContent = (React.createElement("div", { "aria-live": dismissButton ? undefined : 'polite', "aria-atomic": dismissButton ? undefined : true, className: clsx(popoverClasses, !renderWithPortal && styles['popover-inline-content']), "data-awsui-referrer-id": referrerId },
|
|
94
|
-
React.createElement(
|
|
95
|
-
React.createElement(
|
|
93
|
+
const popoverContent = (React.createElement("div", { "aria-live": dismissButton ? undefined : 'polite', "aria-atomic": dismissButton ? undefined : true, className: clsx(popoverClasses, !renderWithPortal && styles['popover-inline-content']), "data-awsui-referrer-id": referrerId },
|
|
94
|
+
React.createElement(PopoverContainer, { size: size, fixedWidth: fixedWidth, position: position, trackRef: triggerRef, arrow: position => React.createElement(Arrow, { position: position }), renderWithPortal: renderWithPortal, zIndex: renderWithPortal ? 7000 : undefined },
|
|
95
|
+
React.createElement(LinkDefaultVariantContext.Provider, { value: { defaultVariant: 'primary' } },
|
|
96
|
+
React.createElement(PopoverBody, { dismissButton: dismissButton, dismissAriaLabel: dismissAriaLabel, header: header, onDismiss: onDismiss, overflowVisible: "both", closeAnalyticsAction: __closeAnalyticsAction }, content)))));
|
|
96
97
|
const mergedRef = useMergeRefs(popoverRef, __internalRootRef);
|
|
97
98
|
return (React.createElement("span", Object.assign({}, baseProps, { className: clsx(styles.root, baseProps.className, triggerType === 'filtering-token' && styles['root-filtering-token'], isInline && styles['no-wrap']), ref: mergedRef, onMouseDown: () => {
|
|
98
99
|
// Indicate there was a click inside popover recently, including nested portals.
|
|
@@ -101,6 +102,6 @@ function InternalPopover(_a, ref) {
|
|
|
101
102
|
});
|
|
102
103
|
} }),
|
|
103
104
|
triggerType === 'text' ? (React.createElement("button", Object.assign({}, triggerProps, { className: clsx(triggerProps.className, wrapTriggerText === false && styles['overflow-ellipsis']), tabIndex: triggerTabIndex, type: "button", "aria-haspopup": "dialog", id: referrerId, "aria-label": triggerAriaLabel }), children)) : (React.createElement("span", Object.assign({}, triggerProps, { id: referrerId }), children)),
|
|
104
|
-
React.createElement(ResetContextsForModal, null, renderWithPortal ? React.createElement(Portal, null, popoverContent) : popoverContent)));
|
|
105
|
+
visible && (React.createElement(ResetContextsForModal, null, renderWithPortal ? React.createElement(Portal, null, popoverContent) : popoverContent))));
|
|
105
106
|
}
|
|
106
107
|
//# sourceMappingURL=internal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/popover/internal.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;AAC7F,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAC5E,OAAO,MAAM,MAAM,+BAA+B,CAAC;AACnD,OAAO,EAAE,yBAAyB,EAAE,MAAM,kDAAkD,CAAC;AAC7F,OAAO,qBAAqB,MAAM,8CAA8C,CAAC;AACjF,OAAO,EAAE,0BAA0B,EAAE,MAAM,wDAAwD,CAAC;AACpG,OAAO,EAAE,sBAAsB,EAA6B,MAAM,0BAA0B,CAAC;AAE7F,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,oBA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C,EACjG,QAAQ,EAAE,eAAe,EACzB,IAAI,EAAC,QAAQ,mBACC,QAAQ,EACtB,EAAE,EAAE,UAAU,gBACF,gBAAgB,KAE3B,QAAQ,CACF,CACV,CAAC,CAAC,CAAC,CACF,8CAAU,YAAY,IAAE,EAAE,EAAE,UAAU,KACnC,QAAQ,CACJ,CACR;QACD,oBAAC,qBAAqB,QACnB,gBAAgB,CAAC,CAAC,CAAC,oBAAC,MAAM,QAAE,cAAc,CAAU,CAAC,CAAC,CAAC,cAAc,CAChD,CACnB,CACR,CAAC;AACJ,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';\nimport clsx from 'clsx';\n\nimport { useInternalI18n } from '../i18n/context';\nimport { getBaseProps } from '../internal/base-component';\nimport { getFirstFocusable } from '../internal/components/focus-lock/utils';\nimport Portal from '../internal/components/portal';\nimport { LinkDefaultVariantContext } from '../internal/context/link-default-variant-context';\nimport ResetContextsForModal from '../internal/context/reset-contexts-for-modal';\nimport { useSingleTabStopNavigation } from '../internal/context/single-tab-stop-navigation-context';\nimport { fireNonCancelableEvent, NonCancelableEventHandler } from '../internal/events/index';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { usePortalModeClasses } from '../internal/hooks/use-portal-mode-classes';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { KeyCode } from '../internal/keycode';\nimport Arrow from './arrow';\nimport PopoverBody from './body';\nimport PopoverContainer from './container';\nimport { PopoverProps } from './interfaces';\n\nimport styles from './styles.css.js';\n\nexport interface InternalPopoverProps extends Omit<PopoverProps, 'triggerType' | 'size'>, InternalBaseComponentProps {\n __onOpen?: NonCancelableEventHandler<null>;\n triggerType?: PopoverProps.TriggerType | 'filtering-token';\n size: PopoverProps.Size | 'content';\n __closeAnalyticsAction?: string;\n isInline?: boolean;\n}\n\nexport interface InternalPopoverRef {\n dismissPopover: () => void;\n focus: HTMLElement['focus'];\n}\n\nexport default React.forwardRef(InternalPopover);\n\nfunction InternalPopover(\n {\n position = 'right',\n size = 'medium',\n fixedWidth = false,\n triggerType = 'text',\n dismissButton = true,\n\n children,\n header,\n content,\n triggerAriaLabel,\n\n wrapTriggerText = true,\n isInline = false,\n renderWithPortal = false,\n\n __onOpen,\n __internalRootRef = null,\n __closeAnalyticsAction,\n\n ...restProps\n }: InternalPopoverProps,\n ref: React.Ref<InternalPopoverRef>\n) {\n const baseProps = getBaseProps(restProps);\n const triggerRef = useRef<HTMLElement | null>(null);\n const popoverRef = useRef<HTMLDivElement | null>(null);\n const clickFrameId = useRef<number | null>(null);\n\n const i18n = useInternalI18n('popover');\n const dismissAriaLabel = i18n('dismissAriaLabel', restProps.dismissAriaLabel);\n\n const [visible, setVisible] = useState(false);\n\n const focusTrigger = useCallback(() => {\n if (triggerType === 'text') {\n triggerRef.current?.focus();\n } else {\n triggerRef.current && getFirstFocusable(triggerRef.current)?.focus();\n }\n }, [triggerType]);\n\n const onTriggerClick = useCallback(() => {\n fireNonCancelableEvent(__onOpen);\n setVisible(true);\n }, [__onOpen]);\n\n const onDismiss = useCallback(() => {\n setVisible(false);\n focusTrigger();\n }, [focusTrigger]);\n\n const onTriggerKeyDown = useCallback(\n (event: React.KeyboardEvent) => {\n const isEscapeKey = event.keyCode === KeyCode.escape;\n const isTabKey = event.keyCode === KeyCode.tab;\n if (isEscapeKey && visible) {\n event.stopPropagation();\n }\n if (isTabKey || isEscapeKey) {\n setVisible(false);\n }\n },\n [visible]\n );\n\n useImperativeHandle(ref, () => ({\n dismissPopover: onDismiss,\n focus: () => {\n setVisible(false);\n focusTrigger();\n },\n }));\n\n useEffect(() => {\n if (!triggerRef.current) {\n return;\n }\n const document = triggerRef.current.ownerDocument;\n\n const onDocumentClick = () => {\n // Dismiss popover unless there was a click inside within the last animation frame.\n if (clickFrameId.current === null) {\n setVisible(false);\n }\n };\n\n document.addEventListener('mousedown', onDocumentClick);\n\n return () => {\n document.removeEventListener('mousedown', onDocumentClick);\n };\n }, []);\n\n const popoverClasses = usePortalModeClasses(triggerRef);\n\n const triggerProps = {\n // https://github.com/microsoft/TypeScript/issues/36659\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref: triggerRef as any,\n onClick: onTriggerClick,\n onKeyDown: onTriggerKeyDown,\n className: clsx(styles.trigger, styles[`trigger-type-${triggerType}`]),\n };\n const { tabIndex: triggerTabIndex } = useSingleTabStopNavigation(triggerRef);\n\n const referrerId = useUniqueId();\n\n const popoverContent = (\n <div\n aria-live={dismissButton ? undefined : 'polite'}\n aria-atomic={dismissButton ? undefined : true}\n className={clsx(popoverClasses, !renderWithPortal && styles['popover-inline-content'])}\n data-awsui-referrer-id={referrerId}\n >\n {visible && (\n <PopoverContainer\n size={size}\n fixedWidth={fixedWidth}\n position={position}\n trackRef={triggerRef}\n arrow={position => <Arrow position={position} />}\n renderWithPortal={renderWithPortal}\n zIndex={renderWithPortal ? 7000 : undefined}\n >\n <LinkDefaultVariantContext.Provider value={{ defaultVariant: 'primary' }}>\n <PopoverBody\n dismissButton={dismissButton}\n dismissAriaLabel={dismissAriaLabel}\n header={header}\n onDismiss={onDismiss}\n overflowVisible=\"both\"\n closeAnalyticsAction={__closeAnalyticsAction}\n >\n {content}\n </PopoverBody>\n </LinkDefaultVariantContext.Provider>\n </PopoverContainer>\n )}\n </div>\n );\n\n const mergedRef = useMergeRefs(popoverRef, __internalRootRef);\n\n return (\n <span\n {...baseProps}\n className={clsx(\n styles.root,\n baseProps.className,\n triggerType === 'filtering-token' && styles['root-filtering-token'],\n isInline && styles['no-wrap']\n )}\n ref={mergedRef}\n onMouseDown={() => {\n // Indicate there was a click inside popover recently, including nested portals.\n clickFrameId.current = requestAnimationFrame(() => {\n clickFrameId.current = null;\n });\n }}\n >\n {triggerType === 'text' ? (\n <button\n {...triggerProps}\n className={clsx(triggerProps.className, wrapTriggerText === false && styles['overflow-ellipsis'])}\n tabIndex={triggerTabIndex}\n type=\"button\"\n aria-haspopup=\"dialog\"\n id={referrerId}\n aria-label={triggerAriaLabel}\n >\n {children}\n </button>\n ) : (\n <span {...triggerProps} id={referrerId}>\n {children}\n </span>\n )}\n <ResetContextsForModal>\n {renderWithPortal ? <Portal>{popoverContent}</Portal> : popoverContent}\n </ResetContextsForModal>\n </span>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/popover/internal.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;AAC7F,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAC5E,OAAO,MAAM,MAAM,+BAA+B,CAAC;AACnD,OAAO,EAAE,yBAAyB,EAAE,MAAM,kDAAkD,CAAC;AAC7F,OAAO,qBAAqB,MAAM,8CAA8C,CAAC;AACjF,OAAO,EAAE,0BAA0B,EAAE,MAAM,wDAAwD,CAAC;AACpG,OAAO,EAAE,sBAAsB,EAA6B,MAAM,0BAA0B,CAAC;AAE7F,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,WAAW,MAAM,QAAQ,CAAC;AACjC,OAAO,gBAAgB,M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B,gBAAgB,CAAC,CAAC,CAAC,oBAAC,MAAM,QAAE,cAAc,CAAU,CAAC,CAAC,CAAC,cAAc,CAChD,CACzB,CACI,CACR,CAAC;AACJ,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';\nimport clsx from 'clsx';\n\nimport { useInternalI18n } from '../i18n/context';\nimport { getBaseProps } from '../internal/base-component';\nimport { getFirstFocusable } from '../internal/components/focus-lock/utils';\nimport Portal from '../internal/components/portal';\nimport { LinkDefaultVariantContext } from '../internal/context/link-default-variant-context';\nimport ResetContextsForModal from '../internal/context/reset-contexts-for-modal';\nimport { useSingleTabStopNavigation } from '../internal/context/single-tab-stop-navigation-context';\nimport { fireNonCancelableEvent, NonCancelableEventHandler } from '../internal/events/index';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { usePortalModeClasses } from '../internal/hooks/use-portal-mode-classes';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { KeyCode } from '../internal/keycode';\nimport Arrow from './arrow';\nimport PopoverBody from './body';\nimport PopoverContainer from './container';\nimport { PopoverProps } from './interfaces';\n\nimport styles from './styles.css.js';\n\nexport interface InternalPopoverProps extends Omit<PopoverProps, 'triggerType' | 'size'>, InternalBaseComponentProps {\n __onOpen?: NonCancelableEventHandler<null>;\n triggerType?: PopoverProps.TriggerType | 'filtering-token';\n size: PopoverProps.Size | 'content';\n __closeAnalyticsAction?: string;\n isInline?: boolean;\n}\n\nexport interface InternalPopoverRef {\n dismissPopover: () => void;\n focus: HTMLElement['focus'];\n}\n\nexport default React.forwardRef(InternalPopover);\n\nfunction InternalPopover(\n {\n position = 'right',\n size = 'medium',\n fixedWidth = false,\n triggerType = 'text',\n dismissButton = true,\n\n children,\n header,\n content,\n triggerAriaLabel,\n\n wrapTriggerText = true,\n isInline = false,\n renderWithPortal = false,\n\n __onOpen,\n __internalRootRef = null,\n __closeAnalyticsAction,\n\n ...restProps\n }: InternalPopoverProps,\n ref: React.Ref<InternalPopoverRef>\n) {\n const baseProps = getBaseProps(restProps);\n const triggerRef = useRef<HTMLElement | null>(null);\n const popoverRef = useRef<HTMLDivElement | null>(null);\n const clickFrameId = useRef<number | null>(null);\n\n const i18n = useInternalI18n('popover');\n const dismissAriaLabel = i18n('dismissAriaLabel', restProps.dismissAriaLabel);\n\n const [visible, setVisible] = useState(false);\n\n const focusTrigger = useCallback(() => {\n if (triggerType === 'text') {\n triggerRef.current?.focus();\n } else {\n triggerRef.current && getFirstFocusable(triggerRef.current)?.focus();\n }\n }, [triggerType]);\n\n const onTriggerClick = useCallback(() => {\n fireNonCancelableEvent(__onOpen);\n setVisible(true);\n }, [__onOpen]);\n\n const onDismiss = useCallback(() => {\n setVisible(false);\n focusTrigger();\n }, [focusTrigger]);\n\n const onTriggerKeyDown = useCallback(\n (event: React.KeyboardEvent) => {\n const isEscapeKey = event.keyCode === KeyCode.escape;\n const isTabKey = event.keyCode === KeyCode.tab;\n if (isEscapeKey && visible) {\n event.stopPropagation();\n }\n if (isTabKey || isEscapeKey) {\n setVisible(false);\n }\n },\n [visible]\n );\n\n useImperativeHandle(ref, () => ({\n dismissPopover: onDismiss,\n focus: () => {\n setVisible(false);\n focusTrigger();\n },\n }));\n\n useEffect(() => {\n if (!triggerRef.current) {\n return;\n }\n const document = triggerRef.current.ownerDocument;\n\n const onDocumentClick = () => {\n // Dismiss popover unless there was a click inside within the last animation frame.\n if (clickFrameId.current === null) {\n setVisible(false);\n }\n };\n\n document.addEventListener('mousedown', onDocumentClick);\n\n return () => {\n document.removeEventListener('mousedown', onDocumentClick);\n };\n }, []);\n\n const popoverClasses = usePortalModeClasses(triggerRef);\n\n const triggerProps = {\n // https://github.com/microsoft/TypeScript/issues/36659\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref: triggerRef as any,\n onClick: onTriggerClick,\n onKeyDown: onTriggerKeyDown,\n className: clsx(styles.trigger, styles[`trigger-type-${triggerType}`]),\n };\n const { tabIndex: triggerTabIndex } = useSingleTabStopNavigation(triggerRef);\n\n const referrerId = useUniqueId();\n\n const popoverContent = (\n <div\n aria-live={dismissButton ? undefined : 'polite'}\n aria-atomic={dismissButton ? undefined : true}\n className={clsx(popoverClasses, !renderWithPortal && styles['popover-inline-content'])}\n data-awsui-referrer-id={referrerId}\n >\n <PopoverContainer\n size={size}\n fixedWidth={fixedWidth}\n position={position}\n trackRef={triggerRef}\n arrow={position => <Arrow position={position} />}\n renderWithPortal={renderWithPortal}\n zIndex={renderWithPortal ? 7000 : undefined}\n >\n <LinkDefaultVariantContext.Provider value={{ defaultVariant: 'primary' }}>\n <PopoverBody\n dismissButton={dismissButton}\n dismissAriaLabel={dismissAriaLabel}\n header={header}\n onDismiss={onDismiss}\n overflowVisible=\"both\"\n closeAnalyticsAction={__closeAnalyticsAction}\n >\n {content}\n </PopoverBody>\n </LinkDefaultVariantContext.Provider>\n </PopoverContainer>\n </div>\n );\n\n const mergedRef = useMergeRefs(popoverRef, __internalRootRef);\n\n return (\n <span\n {...baseProps}\n className={clsx(\n styles.root,\n baseProps.className,\n triggerType === 'filtering-token' && styles['root-filtering-token'],\n isInline && styles['no-wrap']\n )}\n ref={mergedRef}\n onMouseDown={() => {\n // Indicate there was a click inside popover recently, including nested portals.\n clickFrameId.current = requestAnimationFrame(() => {\n clickFrameId.current = null;\n });\n }}\n >\n {triggerType === 'text' ? (\n <button\n {...triggerProps}\n className={clsx(triggerProps.className, wrapTriggerText === false && styles['overflow-ellipsis'])}\n tabIndex={triggerTabIndex}\n type=\"button\"\n aria-haspopup=\"dialog\"\n id={referrerId}\n aria-label={triggerAriaLabel}\n >\n {children}\n </button>\n ) : (\n <span {...triggerProps} id={referrerId}>\n {children}\n </span>\n )}\n {visible && (\n <ResetContextsForModal>\n {renderWithPortal ? <Portal>{popoverContent}</Portal> : popoverContent}\n </ResetContextsForModal>\n )}\n </span>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/prompt-input/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmE,MAAM,OAAO,CAAC;AAWxF,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAElF,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAKhD,UAAU,wBAAyB,SAAQ,gBAAgB,EAAE,0BAA0B;CAAG;AAE1F,QAAA,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/prompt-input/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmE,MAAM,OAAO,CAAC;AAWxF,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAElF,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAKhD,UAAU,wBAAyB,SAAQ,gBAAgB,EAAE,0BAA0B;CAAG;AAE1F,QAAA,MAAM,mBAAmB,uGAsMxB,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -33,9 +33,7 @@ const InternalPromptInput = React.forwardRef((_a, ref) => {
|
|
|
33
33
|
},
|
|
34
34
|
}), [textareaRef]);
|
|
35
35
|
const handleKeyDown = (event) => {
|
|
36
|
-
|
|
37
|
-
fireKeyboardEvent(onKeyDown, event);
|
|
38
|
-
}
|
|
36
|
+
fireKeyboardEvent(onKeyDown, event);
|
|
39
37
|
if (event.key === 'Enter' && !event.shiftKey) {
|
|
40
38
|
if ('form' in event.target && event.target.form !== null && !event.isDefaultPrevented()) {
|
|
41
39
|
event.target.form.requestSubmit();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/prompt-input/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO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AAC,EAAE,OAAO;gBACzB,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,OAAO;aAC1B,CAAC,IAED,gBAAgB,CACb,CACP;QACD,6BAAK,SAAS,EAAE,MAAM,CAAC,kBAAkB,CAAC;YACxC,gDAAU,GAAG,EAAE,WAAW,EAAE,EAAE,EAAE,SAAS,IAAM,UAAU,EAAI;YAC5D,eAAe,IAAI,CAAC,gBAAgB,IAAI,MAAM,CAC3C;QACL,gBAAgB,IAAI,CACnB,6BACE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,EAAE,cAAc,CAAC,mBAAmB,CAAC,EAAE;gBAChF,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,EAAE,CAAC,+BAA+B;gBAC3D,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,OAAO;gBACzB,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,OAAO;aAC1B,CAAC;YAED,gBAAgB;YAChB,eAAe,IAAI,MAAM,CACtB,CACP,CACG,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,mBAAmB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { Ref, useCallback, useEffect, useImperativeHandle, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { useDensityMode } from '@cloudscape-design/component-toolkit/internal';\n\nimport InternalButton from '../button/internal';\nimport { convertAutoComplete } from '../input/utils';\nimport { getBaseProps } from '../internal/base-component';\nimport { useFormFieldContext } from '../internal/context/form-field-context';\nimport { fireKeyboardEvent, fireNonCancelableEvent } from '../internal/events';\nimport * as tokens from '../internal/generated/styles/tokens';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { PromptInputProps } from './interfaces';\n\nimport styles from './styles.css.js';\nimport testutilStyles from './test-classes/styles.css.js';\n\ninterface InternalPromptInputProps extends PromptInputProps, InternalBaseComponentProps {}\n\nconst InternalPromptInput = React.forwardRef(\n (\n {\n value,\n actionButtonAriaLabel,\n actionButtonIconName,\n actionButtonIconUrl,\n actionButtonIconSvg,\n actionButtonIconAlt,\n ariaLabel,\n autoComplete,\n autoFocus,\n disableActionButton,\n disableBrowserAutocorrect,\n disabled,\n maxRows = 3,\n minRows,\n name,\n onAction,\n onBlur,\n onChange,\n onFocus,\n onKeyDown,\n onKeyUp,\n placeholder,\n readOnly,\n spellcheck,\n secondaryActions,\n secondaryContent,\n disableSecondaryActionsPaddings,\n disableSecondaryContentPaddings,\n __internalRootRef = null,\n ...rest\n }: InternalPromptInputProps,\n ref: Ref<PromptInputProps.Ref>\n ) => {\n const { ariaLabelledby, ariaDescribedby, controlId, invalid, warning } = useFormFieldContext(rest);\n\n const baseProps = getBaseProps(rest);\n\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n\n const isRefresh = useVisualRefresh();\n const isCompactMode = useDensityMode(textareaRef) === 'compact';\n\n const PADDING = isRefresh ? tokens.spaceXxs : tokens.spaceXxxs;\n const LINE_HEIGHT = tokens.lineHeightBodyM;\n\n useImperativeHandle(\n ref,\n () => ({\n focus(...args: Parameters<HTMLElement['focus']>) {\n textareaRef.current?.focus(...args);\n },\n select() {\n textareaRef.current?.select();\n },\n }),\n [textareaRef]\n );\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLTextAreaElement>) => {\n if (onKeyDown) {\n fireKeyboardEvent(onKeyDown, event);\n }\n\n if (event.key === 'Enter' && !event.shiftKey) {\n if ('form' in event.target && event.target.form !== null && !event.isDefaultPrevented()) {\n (event.target.form as HTMLFormElement).requestSubmit();\n }\n\n event.preventDefault();\n fireNonCancelableEvent(onAction, { value });\n }\n };\n\n const handleChange = (event: React.ChangeEvent<HTMLTextAreaElement>) => {\n fireNonCancelableEvent(onChange, { value: event.target.value });\n adjustTextareaHeight();\n };\n\n const hasActionButton = actionButtonIconName || actionButtonIconSvg || actionButtonIconUrl;\n\n const adjustTextareaHeight = useCallback(() => {\n if (textareaRef.current) {\n textareaRef.current.style.height = 'auto';\n const maxRowsHeight = `calc(${maxRows <= 0 ? 3 : maxRows} * (${LINE_HEIGHT} + ${PADDING} / 2) + ${PADDING})`;\n const scrollHeight = `calc(${textareaRef.current.scrollHeight}px)`;\n const minTextareaHeight = `calc(${LINE_HEIGHT} + ${tokens.spaceScaledXxs} * 2)`; // the min height of Textarea with 1 row\n textareaRef.current.style.height = `min(max(${scrollHeight}, ${minTextareaHeight}), ${maxRowsHeight})`;\n }\n }, [maxRows, LINE_HEIGHT, PADDING]);\n\n useEffect(() => {\n const handleResize = () => {\n adjustTextareaHeight();\n };\n\n window.addEventListener('resize', handleResize);\n\n return () => {\n window.removeEventListener('resize', handleResize);\n };\n }, [adjustTextareaHeight]);\n\n useEffect(() => {\n adjustTextareaHeight();\n }, [value, adjustTextareaHeight, maxRows, isCompactMode]);\n\n const attributes: React.TextareaHTMLAttributes<HTMLTextAreaElement> = {\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n 'aria-describedby': ariaDescribedby,\n 'aria-invalid': invalid ? 'true' : undefined,\n name,\n placeholder,\n autoFocus,\n className: clsx(styles.textarea, testutilStyles.textarea, {\n [styles.invalid]: invalid,\n [styles.warning]: warning,\n }),\n autoComplete: convertAutoComplete(autoComplete),\n spellCheck: spellcheck,\n disabled,\n readOnly: readOnly ? true : undefined,\n rows: minRows || 1,\n onKeyDown: handleKeyDown,\n onKeyUp: onKeyUp && (event => fireKeyboardEvent(onKeyUp, event)),\n // We set a default value on the component in order to force it into the controlled mode.\n value: value || '',\n onChange: handleChange,\n onBlur: onBlur && (() => fireNonCancelableEvent(onBlur)),\n onFocus: onFocus && (() => fireNonCancelableEvent(onFocus)),\n };\n\n if (disableBrowserAutocorrect) {\n attributes.autoCorrect = 'off';\n attributes.autoCapitalize = 'off';\n }\n\n const action = (\n <div className={styles.button}>\n <InternalButton\n className={clsx(styles['action-button'], testutilStyles['action-button'])}\n ariaLabel={actionButtonAriaLabel}\n disabled={disabled || readOnly || disableActionButton}\n __focusable={readOnly}\n iconName={actionButtonIconName}\n iconUrl={actionButtonIconUrl}\n iconSvg={actionButtonIconSvg}\n iconAlt={actionButtonIconAlt}\n onClick={() => fireNonCancelableEvent(onAction, { value })}\n variant=\"icon\"\n />\n </div>\n );\n\n return (\n <div\n {...baseProps}\n aria-label={ariaLabel}\n className={clsx(styles.root, testutilStyles.root, baseProps.className, {\n [styles['textarea-readonly']]: readOnly,\n [styles['textarea-invalid']]: invalid,\n [styles['textarea-warning']]: warning && !invalid,\n [styles.disabled]: disabled,\n })}\n ref={__internalRootRef}\n role=\"region\"\n >\n {secondaryContent && (\n <div\n className={clsx(styles['secondary-content'], testutilStyles['secondary-content'], {\n [styles['with-paddings']]: !disableSecondaryContentPaddings,\n [styles.invalid]: invalid,\n [styles.warning]: warning,\n })}\n >\n {secondaryContent}\n </div>\n )}\n <div className={styles['textarea-wrapper']}>\n <textarea ref={textareaRef} id={controlId} {...attributes} />\n {hasActionButton && !secondaryActions && action}\n </div>\n {secondaryActions && (\n <div\n className={clsx(styles['secondary-actions'], testutilStyles['secondary-actions'], {\n [styles['with-paddings']]: !disableSecondaryActionsPaddings,\n [styles.invalid]: invalid,\n [styles.warning]: warning,\n })}\n >\n {secondaryActions}\n {hasActionButton && action}\n </div>\n )}\n </div>\n );\n }\n);\n\nexport default InternalPromptInput;\n"]}
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/prompt-input/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAO,WAAW,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACxF,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,MAAM,+CAA+C,CAAC;AAE/E,OAAO,cAAc,MAAM,oBAAoB,CAAC;AAChD,OAAO,E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AAgB,IAAI,MAAM,CAC3C;QACL,gBAAgB,IAAI,CACnB,6BACE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,EAAE,cAAc,CAAC,mBAAmB,CAAC,EAAE;gBAChF,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,EAAE,CAAC,+BAA+B;gBAC3D,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,OAAO;gBACzB,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,OAAO;aAC1B,CAAC;YAED,gBAAgB;YAChB,eAAe,IAAI,MAAM,CACtB,CACP,CACG,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,mBAAmB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { Ref, useCallback, useEffect, useImperativeHandle, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { useDensityMode } from '@cloudscape-design/component-toolkit/internal';\n\nimport InternalButton from '../button/internal';\nimport { convertAutoComplete } from '../input/utils';\nimport { getBaseProps } from '../internal/base-component';\nimport { useFormFieldContext } from '../internal/context/form-field-context';\nimport { fireKeyboardEvent, fireNonCancelableEvent } from '../internal/events';\nimport * as tokens from '../internal/generated/styles/tokens';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { PromptInputProps } from './interfaces';\n\nimport styles from './styles.css.js';\nimport testutilStyles from './test-classes/styles.css.js';\n\ninterface InternalPromptInputProps extends PromptInputProps, InternalBaseComponentProps {}\n\nconst InternalPromptInput = React.forwardRef(\n (\n {\n value,\n actionButtonAriaLabel,\n actionButtonIconName,\n actionButtonIconUrl,\n actionButtonIconSvg,\n actionButtonIconAlt,\n ariaLabel,\n autoComplete,\n autoFocus,\n disableActionButton,\n disableBrowserAutocorrect,\n disabled,\n maxRows = 3,\n minRows,\n name,\n onAction,\n onBlur,\n onChange,\n onFocus,\n onKeyDown,\n onKeyUp,\n placeholder,\n readOnly,\n spellcheck,\n secondaryActions,\n secondaryContent,\n disableSecondaryActionsPaddings,\n disableSecondaryContentPaddings,\n __internalRootRef = null,\n ...rest\n }: InternalPromptInputProps,\n ref: Ref<PromptInputProps.Ref>\n ) => {\n const { ariaLabelledby, ariaDescribedby, controlId, invalid, warning } = useFormFieldContext(rest);\n\n const baseProps = getBaseProps(rest);\n\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n\n const isRefresh = useVisualRefresh();\n const isCompactMode = useDensityMode(textareaRef) === 'compact';\n\n const PADDING = isRefresh ? tokens.spaceXxs : tokens.spaceXxxs;\n const LINE_HEIGHT = tokens.lineHeightBodyM;\n\n useImperativeHandle(\n ref,\n () => ({\n focus(...args: Parameters<HTMLElement['focus']>) {\n textareaRef.current?.focus(...args);\n },\n select() {\n textareaRef.current?.select();\n },\n }),\n [textareaRef]\n );\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLTextAreaElement>) => {\n fireKeyboardEvent(onKeyDown, event);\n\n if (event.key === 'Enter' && !event.shiftKey) {\n if ('form' in event.target && event.target.form !== null && !event.isDefaultPrevented()) {\n (event.target.form as HTMLFormElement).requestSubmit();\n }\n\n event.preventDefault();\n fireNonCancelableEvent(onAction, { value });\n }\n };\n\n const handleChange = (event: React.ChangeEvent<HTMLTextAreaElement>) => {\n fireNonCancelableEvent(onChange, { value: event.target.value });\n adjustTextareaHeight();\n };\n\n const hasActionButton = actionButtonIconName || actionButtonIconSvg || actionButtonIconUrl;\n\n const adjustTextareaHeight = useCallback(() => {\n if (textareaRef.current) {\n textareaRef.current.style.height = 'auto';\n const maxRowsHeight = `calc(${maxRows <= 0 ? 3 : maxRows} * (${LINE_HEIGHT} + ${PADDING} / 2) + ${PADDING})`;\n const scrollHeight = `calc(${textareaRef.current.scrollHeight}px)`;\n const minTextareaHeight = `calc(${LINE_HEIGHT} + ${tokens.spaceScaledXxs} * 2)`; // the min height of Textarea with 1 row\n textareaRef.current.style.height = `min(max(${scrollHeight}, ${minTextareaHeight}), ${maxRowsHeight})`;\n }\n }, [maxRows, LINE_HEIGHT, PADDING]);\n\n useEffect(() => {\n const handleResize = () => {\n adjustTextareaHeight();\n };\n\n window.addEventListener('resize', handleResize);\n\n return () => {\n window.removeEventListener('resize', handleResize);\n };\n }, [adjustTextareaHeight]);\n\n useEffect(() => {\n adjustTextareaHeight();\n }, [value, adjustTextareaHeight, maxRows, isCompactMode]);\n\n const attributes: React.TextareaHTMLAttributes<HTMLTextAreaElement> = {\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n 'aria-describedby': ariaDescribedby,\n 'aria-invalid': invalid ? 'true' : undefined,\n name,\n placeholder,\n autoFocus,\n className: clsx(styles.textarea, testutilStyles.textarea, {\n [styles.invalid]: invalid,\n [styles.warning]: warning,\n }),\n autoComplete: convertAutoComplete(autoComplete),\n spellCheck: spellcheck,\n disabled,\n readOnly: readOnly ? true : undefined,\n rows: minRows || 1,\n onKeyDown: handleKeyDown,\n onKeyUp: onKeyUp && (event => fireKeyboardEvent(onKeyUp, event)),\n // We set a default value on the component in order to force it into the controlled mode.\n value: value || '',\n onChange: handleChange,\n onBlur: onBlur && (() => fireNonCancelableEvent(onBlur)),\n onFocus: onFocus && (() => fireNonCancelableEvent(onFocus)),\n };\n\n if (disableBrowserAutocorrect) {\n attributes.autoCorrect = 'off';\n attributes.autoCapitalize = 'off';\n }\n\n const action = (\n <div className={styles.button}>\n <InternalButton\n className={clsx(styles['action-button'], testutilStyles['action-button'])}\n ariaLabel={actionButtonAriaLabel}\n disabled={disabled || readOnly || disableActionButton}\n __focusable={readOnly}\n iconName={actionButtonIconName}\n iconUrl={actionButtonIconUrl}\n iconSvg={actionButtonIconSvg}\n iconAlt={actionButtonIconAlt}\n onClick={() => fireNonCancelableEvent(onAction, { value })}\n variant=\"icon\"\n />\n </div>\n );\n\n return (\n <div\n {...baseProps}\n aria-label={ariaLabel}\n className={clsx(styles.root, testutilStyles.root, baseProps.className, {\n [styles['textarea-readonly']]: readOnly,\n [styles['textarea-invalid']]: invalid,\n [styles['textarea-warning']]: warning && !invalid,\n [styles.disabled]: disabled,\n })}\n ref={__internalRootRef}\n role=\"region\"\n >\n {secondaryContent && (\n <div\n className={clsx(styles['secondary-content'], testutilStyles['secondary-content'], {\n [styles['with-paddings']]: !disableSecondaryContentPaddings,\n [styles.invalid]: invalid,\n [styles.warning]: warning,\n })}\n >\n {secondaryContent}\n </div>\n )}\n <div className={styles['textarea-wrapper']}>\n <textarea ref={textareaRef} id={controlId} {...attributes} />\n {hasActionButton && !secondaryActions && action}\n </div>\n {secondaryActions && (\n <div\n className={clsx(styles['secondary-actions'], testutilStyles['secondary-actions'], {\n [styles['with-paddings']]: !disableSecondaryActionsPaddings,\n [styles.invalid]: invalid,\n [styles.warning]: warning,\n })}\n >\n {secondaryActions}\n {hasActionButton && action}\n </div>\n )}\n </div>\n );\n }\n);\n\nexport default InternalPromptInput;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"implementation.d.ts","sourceRoot":"","sources":["../../../src/split-panel/implementation.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAKlF,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGjD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAO/C,MAAM,MAAM,6BAA6B,GAAG,YAAY,CAAC,eAAe,EAAE,uBAAuB,GAAG,eAAe,CAAC,GAClH,0BAA0B,CAAC;AAE7B,wBAAgB,wBAAwB,CAAC,EACvC,iBAAiB,EACjB,MAAM,EACN,QAAQ,EACR,qBAAqB,EACrB,aAAa,EACb,WAAgB,EAChB,GAAG,SAAS,EACb,EAAE,6BAA6B,
|
|
1
|
+
{"version":3,"file":"implementation.d.ts","sourceRoot":"","sources":["../../../src/split-panel/implementation.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAKlF,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGjD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAO/C,MAAM,MAAM,6BAA6B,GAAG,YAAY,CAAC,eAAe,EAAE,uBAAuB,GAAG,eAAe,CAAC,GAClH,0BAA0B,CAAC;AAE7B,wBAAgB,wBAAwB,CAAC,EACvC,iBAAiB,EACjB,MAAM,EACN,QAAQ,EACR,qBAAqB,EACrB,aAAa,EACb,WAAgB,EAChB,GAAG,SAAS,EACb,EAAE,6BAA6B,eA4N/B;AAED,eAAO,MAAM,0BAA0B,2FAAsD,CAAC"}
|
|
@@ -39,7 +39,7 @@ export function SplitPanelImplementation(_a) {
|
|
|
39
39
|
const sizeControlProps = {
|
|
40
40
|
position,
|
|
41
41
|
panelRef: splitPanelRefObject,
|
|
42
|
-
handleRef: refs.
|
|
42
|
+
handleRef: refs.handle,
|
|
43
43
|
onResize,
|
|
44
44
|
};
|
|
45
45
|
const onSliderPointerDown = usePointerEvents(sizeControlProps);
|
|
@@ -56,11 +56,12 @@ export function SplitPanelImplementation(_a) {
|
|
|
56
56
|
React.createElement(InternalButton, { className: testUtilStyles['preferences-button'], iconName: "settings", variant: "icon", onClick: () => setPreferencesOpen(true), formAction: "none", ariaLabel: i18nStrings.preferencesTitle, ref: refs.preferences }),
|
|
57
57
|
React.createElement("span", { className: styles.divider }))),
|
|
58
58
|
isOpen ? (React.createElement(InternalButton, { className: testUtilStyles['close-button'], iconName: isRefresh && closeBehavior === 'collapse' ? (position === 'side' ? 'angle-right' : 'angle-down') : 'close', variant: "icon", onClick: onToggle, formAction: "none", ariaLabel: i18nStrings.closeButtonAriaLabel, ariaExpanded: isOpen })) : position === 'side' ? null : (React.createElement(InternalButton, { className: testUtilStyles['open-button'], iconName: "angle-up", variant: "icon", formAction: "none", ariaLabel: i18nStrings.openButtonAriaLabel, ref: refs.toggle, ariaExpanded: isOpen })))));
|
|
59
|
-
const resizeHandle = (React.createElement(
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
59
|
+
const resizeHandle = (React.createElement("div", { ref: refs.handle },
|
|
60
|
+
React.createElement(PanelResizeHandle, { ref: refs.slider, className: testUtilStyles.slider, ariaLabel: i18nStrings.resizeHandleAriaLabel,
|
|
61
|
+
// Allows us to use the logical left/right keys to move the slider left/right,
|
|
62
|
+
// but match aria keyboard behavior of using left/right to decrease/increase
|
|
63
|
+
// the slider value.
|
|
64
|
+
ariaValuenow: position === 'bottom' ? relativeSize : 100 - relativeSize, position: position, onKeyDown: onKeyDown, onPointerDown: onSliderPointerDown })));
|
|
64
65
|
/*
|
|
65
66
|
This effect forces the browser to recalculate the layout
|
|
66
67
|
whenever the split panel might have moved.
|