@cloudscape-design/components-themeable 3.0.352 → 3.0.354
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/internal/manifest.json +1 -1
- package/lib/internal/scss/internal/components/cartesian-chart/styles.scss +38 -3
- package/lib/internal/scss/internal/components/chart-wrapper/styles.scss +17 -0
- package/lib/internal/scss/mixed-line-bar-chart/styles.scss +0 -1
- package/lib/internal/scss/pie-chart/styles.scss +22 -0
- package/lib/internal/template/area-chart/chart-container.d.ts +3 -1
- package/lib/internal/template/area-chart/chart-container.d.ts.map +1 -1
- package/lib/internal/template/area-chart/chart-container.js +3 -2
- package/lib/internal/template/area-chart/chart-container.js.map +1 -1
- package/lib/internal/template/area-chart/internal.d.ts +1 -1
- package/lib/internal/template/area-chart/internal.d.ts.map +1 -1
- package/lib/internal/template/area-chart/internal.js +3 -2
- package/lib/internal/template/area-chart/internal.js.map +1 -1
- package/lib/internal/template/area-chart/model/index.d.ts +1 -0
- package/lib/internal/template/area-chart/model/index.d.ts.map +1 -1
- package/lib/internal/template/area-chart/model/index.js.map +1 -1
- package/lib/internal/template/area-chart/model/use-chart-model.d.ts +2 -1
- package/lib/internal/template/area-chart/model/use-chart-model.d.ts.map +1 -1
- package/lib/internal/template/area-chart/model/use-chart-model.js +8 -2
- package/lib/internal/template/area-chart/model/use-chart-model.js.map +1 -1
- package/lib/internal/template/autosuggest/internal.js +4 -4
- package/lib/internal/template/autosuggest/internal.js.map +1 -1
- package/lib/internal/template/button-dropdown/tooltip.js +1 -1
- package/lib/internal/template/button-dropdown/tooltip.js.map +1 -1
- package/lib/internal/template/cards/index.d.ts.map +1 -1
- package/lib/internal/template/cards/index.js +8 -6
- package/lib/internal/template/cards/index.js.map +1 -1
- package/lib/internal/template/code-editor/index.js +1 -1
- package/lib/internal/template/code-editor/index.js.map +1 -1
- package/lib/internal/template/flashbar/common.js +2 -2
- package/lib/internal/template/flashbar/common.js.map +1 -1
- package/lib/internal/template/internal/analytics/components/analytics-funnel.d.ts +1 -1
- package/lib/internal/template/internal/analytics/components/analytics-funnel.d.ts.map +1 -1
- package/lib/internal/template/internal/analytics/components/analytics-funnel.js +24 -5
- package/lib/internal/template/internal/analytics/components/analytics-funnel.js.map +1 -1
- package/lib/internal/template/internal/analytics/context/analytics-context.d.ts +1 -0
- package/lib/internal/template/internal/analytics/context/analytics-context.d.ts.map +1 -1
- package/lib/internal/template/internal/analytics/context/analytics-context.js +1 -0
- package/lib/internal/template/internal/analytics/context/analytics-context.js.map +1 -1
- package/lib/internal/template/internal/analytics/index.d.ts.map +1 -1
- package/lib/internal/template/internal/analytics/index.js +1 -0
- package/lib/internal/template/internal/analytics/index.js.map +1 -1
- package/lib/internal/template/internal/analytics/interfaces.d.ts +13 -2
- package/lib/internal/template/internal/analytics/interfaces.d.ts.map +1 -1
- package/lib/internal/template/internal/analytics/interfaces.js.map +1 -1
- package/lib/internal/template/internal/components/autosuggest-input/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/autosuggest-input/index.js +10 -9
- package/lib/internal/template/internal/components/autosuggest-input/index.js.map +1 -1
- package/lib/internal/template/internal/components/cartesian-chart/chart-container.d.ts +2 -0
- package/lib/internal/template/internal/components/cartesian-chart/chart-container.d.ts.map +1 -1
- package/lib/internal/template/internal/components/cartesian-chart/chart-container.js +16 -3
- package/lib/internal/template/internal/components/cartesian-chart/chart-container.js.map +1 -1
- package/lib/internal/template/internal/components/cartesian-chart/interfaces.d.ts +5 -0
- package/lib/internal/template/internal/components/cartesian-chart/interfaces.d.ts.map +1 -1
- package/lib/internal/template/internal/components/cartesian-chart/interfaces.js.map +1 -1
- package/lib/internal/template/internal/components/cartesian-chart/styles.css.js +27 -23
- package/lib/internal/template/internal/components/cartesian-chart/styles.scoped.css +54 -27
- package/lib/internal/template/internal/components/cartesian-chart/styles.selectors.js +27 -23
- package/lib/internal/template/internal/components/chart-plot/index.d.ts +2 -2
- package/lib/internal/template/internal/components/chart-plot/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/chart-plot/index.js +3 -1
- package/lib/internal/template/internal/components/chart-plot/index.js.map +1 -1
- package/lib/internal/template/internal/components/chart-wrapper/index.d.ts +1 -0
- package/lib/internal/template/internal/components/chart-wrapper/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/chart-wrapper/index.js +21 -6
- package/lib/internal/template/internal/components/chart-wrapper/index.js.map +1 -1
- package/lib/internal/template/internal/components/chart-wrapper/styles.css.js +9 -6
- package/lib/internal/template/internal/components/chart-wrapper/styles.scoped.css +20 -6
- package/lib/internal/template/internal/components/chart-wrapper/styles.selectors.js +9 -6
- package/lib/internal/template/internal/components/transition/index.js +1 -1
- package/lib/internal/template/internal/components/transition/index.js.map +1 -1
- package/lib/internal/template/internal/environment.js +1 -1
- package/lib/internal/template/internal/environment.json +6 -0
- package/lib/internal/template/internal/hooks/use-portal-mode-classes/index.d.ts.map +1 -1
- package/lib/internal/template/internal/hooks/use-portal-mode-classes/index.js +2 -1
- package/lib/internal/template/internal/hooks/use-portal-mode-classes/index.js.map +1 -1
- package/lib/internal/template/internal/hooks/use-visual-mode/index.d.ts +0 -4
- package/lib/internal/template/internal/hooks/use-visual-mode/index.d.ts.map +1 -1
- package/lib/internal/template/internal/hooks/use-visual-mode/index.js +0 -30
- package/lib/internal/template/internal/hooks/use-visual-mode/index.js.map +1 -1
- package/lib/internal/template/mixed-line-bar-chart/chart-container.d.ts +2 -1
- package/lib/internal/template/mixed-line-bar-chart/chart-container.d.ts.map +1 -1
- package/lib/internal/template/mixed-line-bar-chart/chart-container.js +8 -2
- package/lib/internal/template/mixed-line-bar-chart/chart-container.js.map +1 -1
- package/lib/internal/template/mixed-line-bar-chart/internal.d.ts +1 -1
- package/lib/internal/template/mixed-line-bar-chart/internal.d.ts.map +1 -1
- package/lib/internal/template/mixed-line-bar-chart/internal.js +3 -3
- package/lib/internal/template/mixed-line-bar-chart/internal.js.map +1 -1
- package/lib/internal/template/pie-chart/index.d.ts +1 -1
- package/lib/internal/template/pie-chart/index.d.ts.map +1 -1
- package/lib/internal/template/pie-chart/index.js +10 -3
- package/lib/internal/template/pie-chart/index.js.map +1 -1
- package/lib/internal/template/pie-chart/interfaces.d.ts +5 -0
- package/lib/internal/template/pie-chart/interfaces.d.ts.map +1 -1
- package/lib/internal/template/pie-chart/interfaces.js.map +1 -1
- package/lib/internal/template/pie-chart/labels.d.ts +3 -2
- package/lib/internal/template/pie-chart/labels.d.ts.map +1 -1
- package/lib/internal/template/pie-chart/labels.js +4 -4
- package/lib/internal/template/pie-chart/labels.js.map +1 -1
- package/lib/internal/template/pie-chart/pie-chart.d.ts +2 -1
- package/lib/internal/template/pie-chart/pie-chart.d.ts.map +1 -1
- package/lib/internal/template/pie-chart/pie-chart.js +18 -14
- package/lib/internal/template/pie-chart/pie-chart.js.map +1 -1
- package/lib/internal/template/pie-chart/segments.d.ts +3 -2
- package/lib/internal/template/pie-chart/segments.d.ts.map +1 -1
- package/lib/internal/template/pie-chart/segments.js +2 -6
- package/lib/internal/template/pie-chart/segments.js.map +1 -1
- package/lib/internal/template/pie-chart/styles.css.js +27 -23
- package/lib/internal/template/pie-chart/styles.scoped.css +58 -38
- package/lib/internal/template/pie-chart/styles.selectors.js +27 -23
- package/lib/internal/template/pie-chart/utils.d.ts +12 -2
- package/lib/internal/template/pie-chart/utils.d.ts.map +1 -1
- package/lib/internal/template/pie-chart/utils.js +37 -9
- package/lib/internal/template/pie-chart/utils.js.map +1 -1
- package/lib/internal/template/popover/internal.d.ts.map +1 -1
- package/lib/internal/template/popover/internal.js +9 -3
- package/lib/internal/template/popover/internal.js.map +1 -1
- package/lib/internal/template/tabs/smooth-scroll.js +1 -1
- package/lib/internal/template/tabs/smooth-scroll.js.map +1 -1
- package/package.json +2 -9
- package/NOTICE +0 -2
- package/lib/internal/template/internal/motion.d.ts +0 -2
- package/lib/internal/template/internal/motion.d.ts.map +0 -1
- package/lib/internal/template/internal/motion.js +0 -9
- package/lib/internal/template/internal/motion.js.map +0 -1
|
@@ -6,101 +6,101 @@
|
|
|
6
6
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
7
7
|
SPDX-License-Identifier: Apache-2.0
|
|
8
8
|
*/
|
|
9
|
-
.
|
|
10
|
-
.awsui_vertical-
|
|
9
|
+
.awsui_axis_f0fot_sqf57_9:not(#\9),
|
|
10
|
+
.awsui_vertical-marker_f0fot_sqf57_10:not(#\9) {
|
|
11
11
|
stroke: var(--color-charts-line-axis-4u4941, #d5dbdb);
|
|
12
12
|
stroke-width: 1px;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
.awsui_axis--
|
|
15
|
+
.awsui_axis--emphasized_f0fot_sqf57_15:not(#\9) {
|
|
16
16
|
stroke-width: 2px;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
.awsui_axis-
|
|
19
|
+
.awsui_axis-label_f0fot_sqf57_19:not(#\9) {
|
|
20
20
|
font-weight: bold;
|
|
21
21
|
fill: var(--color-text-body-default-4colr5, #16191f);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
.awsui_axis-label--
|
|
25
|
-
.awsui_axis-label--
|
|
24
|
+
.awsui_axis-label--x_f0fot_sqf57_24:not(#\9),
|
|
25
|
+
.awsui_axis-label--y_f0fot_sqf57_25:not(#\9) {
|
|
26
26
|
/* used in test-utils */
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
.
|
|
29
|
+
.awsui_grid_f0fot_sqf57_29:not(#\9) {
|
|
30
30
|
stroke: var(--color-charts-line-grid-0r3q3h, #d5dbdb);
|
|
31
31
|
stroke-width: 1px;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
.
|
|
34
|
+
.awsui_ticks__line_f0fot_sqf57_34:not(#\9) {
|
|
35
35
|
stroke: var(--color-charts-line-tick-dhjpwa, #d5dbdb);
|
|
36
36
|
stroke-width: 1px;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
.
|
|
39
|
+
.awsui_ticks__text_f0fot_sqf57_39:not(#\9) {
|
|
40
40
|
font-size: var(--font-chart-detail-size-32v9jd, 14px);
|
|
41
41
|
fill: var(--color-text-body-secondary-vrqm14, #545b64);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
.awsui_ticks--
|
|
45
|
-
.awsui_ticks--
|
|
44
|
+
.awsui_ticks--y_f0fot_sqf57_44:not(#\9),
|
|
45
|
+
.awsui_ticks--x_f0fot_sqf57_45:not(#\9) {
|
|
46
46
|
/* used in test-utils */
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
.awsui_ticks--
|
|
49
|
+
.awsui_ticks--bottom_f0fot_sqf57_49 > .awsui_ticks__text_f0fot_sqf57_39:not(#\9) {
|
|
50
50
|
text-anchor: middle;
|
|
51
51
|
dominant-baseline: hanging;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
.awsui_labels-
|
|
54
|
+
.awsui_labels-left_f0fot_sqf57_54 > .awsui_ticks_f0fot_sqf57_34 > .awsui_ticks__text_f0fot_sqf57_39:not(#\9) {
|
|
55
55
|
text-anchor: end;
|
|
56
56
|
dominant-baseline: central;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
.awsui_labels-
|
|
59
|
+
.awsui_labels-left_f0fot_sqf57_54:not(#\9) {
|
|
60
60
|
position: relative;
|
|
61
61
|
margin-right: 12px;
|
|
62
62
|
}
|
|
63
|
-
.awsui_labels-
|
|
63
|
+
.awsui_labels-left_f0fot_sqf57_54 > .awsui_axis-label_f0fot_sqf57_19:not(#\9) {
|
|
64
64
|
position: absolute;
|
|
65
65
|
visibility: visible;
|
|
66
66
|
white-space: nowrap;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
.awsui_labels-
|
|
69
|
+
.awsui_labels-left__label_f0fot_sqf57_69:not(#\9) {
|
|
70
70
|
position: absolute;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
.awsui_labels-left--
|
|
73
|
+
.awsui_labels-left--hidden_f0fot_sqf57_73:not(#\9) {
|
|
74
74
|
visibility: hidden;
|
|
75
75
|
}
|
|
76
|
-
.awsui_labels-left--
|
|
76
|
+
.awsui_labels-left--hidden_f0fot_sqf57_73 > .awsui_labels-left__label_f0fot_sqf57_69:not(#\9) {
|
|
77
77
|
position: relative;
|
|
78
78
|
white-space: nowrap;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
.awsui_labels-
|
|
81
|
+
.awsui_labels-bottom_f0fot_sqf57_81:not(#\9) {
|
|
82
82
|
position: relative;
|
|
83
83
|
display: block;
|
|
84
84
|
width: 100%;
|
|
85
85
|
overflow: visible;
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
.awsui_vertical-
|
|
88
|
+
.awsui_vertical-marker_f0fot_sqf57_10:not(#\9) {
|
|
89
89
|
pointer-events: none;
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
.awsui_vertical-marker-
|
|
92
|
+
.awsui_vertical-marker-circle_f0fot_sqf57_92:not(#\9) {
|
|
93
93
|
fill: var(--color-background-container-content-xlzim4, #ffffff);
|
|
94
94
|
pointer-events: none;
|
|
95
95
|
stroke-width: var(--border-line-chart-width-m20n2t, 2px);
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
.awsui_vertical-marker-circle-
|
|
98
|
+
.awsui_vertical-marker-circle-active_f0fot_sqf57_98:not(#\9) {
|
|
99
99
|
cursor: pointer;
|
|
100
100
|
stroke-width: var(--border-line-chart-width-m20n2t, 2px);
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
.awsui_focus-
|
|
103
|
+
.awsui_focus-outline_f0fot_sqf57_103:not(#\9) {
|
|
104
104
|
outline: none;
|
|
105
105
|
pointer-events: none;
|
|
106
106
|
fill: none;
|
|
@@ -108,18 +108,45 @@
|
|
|
108
108
|
stroke-width: 2px;
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
-
.awsui_chart-
|
|
111
|
+
.awsui_chart-container_f0fot_sqf57_111:not(#\9) {
|
|
112
112
|
display: flex;
|
|
113
113
|
width: 100%;
|
|
114
114
|
flex-direction: column;
|
|
115
115
|
}
|
|
116
|
+
.awsui_chart-container_f0fot_sqf57_111.awsui_fit-height_f0fot_sqf57_116:not(#\9) {
|
|
117
|
+
height: 100%;
|
|
118
|
+
min-height: inherit;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.awsui_chart-container-outer_f0fot_sqf57_121:not(#\9) {
|
|
122
|
+
display: flex;
|
|
123
|
+
}
|
|
124
|
+
.awsui_chart-container-outer_f0fot_sqf57_121.awsui_fit-height_f0fot_sqf57_116:not(#\9) {
|
|
125
|
+
flex: 1;
|
|
126
|
+
}
|
|
116
127
|
|
|
117
|
-
.awsui_chart-
|
|
128
|
+
.awsui_chart-container-inner_f0fot_sqf57_128:not(#\9) {
|
|
129
|
+
position: relative;
|
|
118
130
|
display: flex;
|
|
119
131
|
flex-direction: column;
|
|
120
132
|
width: 100%;
|
|
121
133
|
}
|
|
122
134
|
|
|
123
|
-
.awsui_chart-
|
|
124
|
-
display:
|
|
135
|
+
.awsui_chart-container-plot-wrapper_f0fot_sqf57_135.awsui_fit-height_f0fot_sqf57_116:not(#\9) {
|
|
136
|
+
display: block;
|
|
137
|
+
position: relative;
|
|
138
|
+
flex: 1;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.awsui_chart-container-plot_f0fot_sqf57_135.awsui_fit-height_f0fot_sqf57_116:not(#\9) {
|
|
142
|
+
display: block;
|
|
143
|
+
position: absolute;
|
|
144
|
+
top: 0;
|
|
145
|
+
right: 0;
|
|
146
|
+
bottom: 0;
|
|
147
|
+
left: 0;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.awsui_chart-container-bottom-labels_f0fot_sqf57_150.awsui_fit-height_f0fot_sqf57_116:not(#\9) {
|
|
151
|
+
display: block;
|
|
125
152
|
}
|
|
@@ -2,28 +2,32 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"axis": "
|
|
6
|
-
"vertical-marker": "awsui_vertical-
|
|
7
|
-
"axis--emphasized": "awsui_axis--
|
|
8
|
-
"axis-label": "awsui_axis-
|
|
9
|
-
"axis-label--x": "awsui_axis-label--
|
|
10
|
-
"axis-label--y": "awsui_axis-label--
|
|
11
|
-
"grid": "
|
|
12
|
-
"ticks__line": "
|
|
13
|
-
"ticks__text": "
|
|
14
|
-
"ticks--y": "awsui_ticks--
|
|
15
|
-
"ticks--x": "awsui_ticks--
|
|
16
|
-
"ticks--bottom": "awsui_ticks--
|
|
17
|
-
"labels-left": "awsui_labels-
|
|
18
|
-
"ticks": "
|
|
19
|
-
"labels-left__label": "awsui_labels-
|
|
20
|
-
"labels-left--hidden": "awsui_labels-left--
|
|
21
|
-
"labels-bottom": "awsui_labels-
|
|
22
|
-
"vertical-marker-circle": "awsui_vertical-marker-
|
|
23
|
-
"vertical-marker-circle-active": "awsui_vertical-marker-circle-
|
|
24
|
-
"focus-outline": "awsui_focus-
|
|
25
|
-
"chart-container": "awsui_chart-
|
|
26
|
-
"
|
|
27
|
-
"chart-
|
|
5
|
+
"axis": "awsui_axis_f0fot_sqf57_9",
|
|
6
|
+
"vertical-marker": "awsui_vertical-marker_f0fot_sqf57_10",
|
|
7
|
+
"axis--emphasized": "awsui_axis--emphasized_f0fot_sqf57_15",
|
|
8
|
+
"axis-label": "awsui_axis-label_f0fot_sqf57_19",
|
|
9
|
+
"axis-label--x": "awsui_axis-label--x_f0fot_sqf57_24",
|
|
10
|
+
"axis-label--y": "awsui_axis-label--y_f0fot_sqf57_25",
|
|
11
|
+
"grid": "awsui_grid_f0fot_sqf57_29",
|
|
12
|
+
"ticks__line": "awsui_ticks__line_f0fot_sqf57_34",
|
|
13
|
+
"ticks__text": "awsui_ticks__text_f0fot_sqf57_39",
|
|
14
|
+
"ticks--y": "awsui_ticks--y_f0fot_sqf57_44",
|
|
15
|
+
"ticks--x": "awsui_ticks--x_f0fot_sqf57_45",
|
|
16
|
+
"ticks--bottom": "awsui_ticks--bottom_f0fot_sqf57_49",
|
|
17
|
+
"labels-left": "awsui_labels-left_f0fot_sqf57_54",
|
|
18
|
+
"ticks": "awsui_ticks_f0fot_sqf57_34",
|
|
19
|
+
"labels-left__label": "awsui_labels-left__label_f0fot_sqf57_69",
|
|
20
|
+
"labels-left--hidden": "awsui_labels-left--hidden_f0fot_sqf57_73",
|
|
21
|
+
"labels-bottom": "awsui_labels-bottom_f0fot_sqf57_81",
|
|
22
|
+
"vertical-marker-circle": "awsui_vertical-marker-circle_f0fot_sqf57_92",
|
|
23
|
+
"vertical-marker-circle-active": "awsui_vertical-marker-circle-active_f0fot_sqf57_98",
|
|
24
|
+
"focus-outline": "awsui_focus-outline_f0fot_sqf57_103",
|
|
25
|
+
"chart-container": "awsui_chart-container_f0fot_sqf57_111",
|
|
26
|
+
"fit-height": "awsui_fit-height_f0fot_sqf57_116",
|
|
27
|
+
"chart-container-outer": "awsui_chart-container-outer_f0fot_sqf57_121",
|
|
28
|
+
"chart-container-inner": "awsui_chart-container-inner_f0fot_sqf57_128",
|
|
29
|
+
"chart-container-plot-wrapper": "awsui_chart-container-plot-wrapper_f0fot_sqf57_135",
|
|
30
|
+
"chart-container-plot": "awsui_chart-container-plot_f0fot_sqf57_135",
|
|
31
|
+
"chart-container-bottom-labels": "awsui_chart-container-bottom-labels_f0fot_sqf57_150"
|
|
28
32
|
};
|
|
29
33
|
|
|
@@ -6,8 +6,8 @@ export interface ChartPlotRef {
|
|
|
6
6
|
focusApplication(): void;
|
|
7
7
|
}
|
|
8
8
|
export interface ChartPlotProps {
|
|
9
|
-
width: number;
|
|
10
|
-
height: number;
|
|
9
|
+
width: number | string;
|
|
10
|
+
height: number | string;
|
|
11
11
|
transform?: string;
|
|
12
12
|
offsetTop?: number;
|
|
13
13
|
offsetBottom?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["internal/components/chart-plot/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAUjF,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAMvC,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,aAAa,CAAC;IACnB,SAAS,IAAI,IAAI,CAAC;IAClB,gBAAgB,IAAI,IAAI,CAAC;CAC1B;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["internal/components/chart-plot/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAUjF,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAMvC,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,aAAa,CAAC;IACnB,SAAS,IAAI,IAAI,CAAC;IAClB,gBAAgB,IAAI,IAAI,CAAC;CAC1B;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,gBAAgB,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;IACpD,gBAAgB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IAChD,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACjC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,KAAK,IAAI,CAAC;IAC/D,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,KAAK,IAAI,CAAC;IAC/D,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,KAAK,IAAI,CAAC;IAC9D,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,OAAO,EAAE,OAAO,GAAG,UAAU,KAAK,IAAI,CAAC;IACxF,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IACxD,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAC9D,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED;;;;;;;;;EASE;;AACF,wBAAqC"}
|
|
@@ -89,7 +89,9 @@ function ChartPlot(_a, ref) {
|
|
|
89
89
|
}
|
|
90
90
|
: {};
|
|
91
91
|
return (React.createElement(React.Fragment, null,
|
|
92
|
-
React.createElement("svg", Object.assign({}, restProps, { focusable: plotFocusable, tabIndex: plotTabIndex, role: "application", "aria-hidden": "false" }, plotAria, { ref: svgRef,
|
|
92
|
+
React.createElement("svg", Object.assign({}, restProps, { focusable: plotFocusable, tabIndex: plotTabIndex, role: "application", "aria-hidden": "false" }, plotAria, { ref: svgRef, style: {
|
|
93
|
+
width,
|
|
94
|
+
height,
|
|
93
95
|
marginTop: offsetTop,
|
|
94
96
|
marginBottom: offsetBottom,
|
|
95
97
|
marginLeft: offsetLeft,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["internal/components/chart-plot/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjF,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,UAAU,MAAM,sBAAsB,CAAC;AAC9C,OAAO,qBAAyC,MAAM,0BAA0B,CAAC;AACjF,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAE3C,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,MAAM,yBAAyB,GAAG,CAAC,CAAC;AACpC,MAAM,4BAA4B,GAAG,CAAC,CAAC;AAqCvC;;;;;;;;;EASE;AACF,eAAe,UAAU,CAAC,SAAS,CAAC,CAAC;AAErC,SAAS,SAAS,CAChB,EA0BiB,EACjB,GAA4B;QA3B5B,EACE,KAAK,EACL,MAAM,EACN,SAAS,EACT,SAAS,EACT,YAAY,EACZ,UAAU,EACV,WAAW,EACX,SAAS,EACT,cAAc,EACd,mBAAmB,EACnB,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,SAAS,EACT,QAAQ,EACR,WAAW,EACX,SAAS,EACT,OAAO,EACP,MAAM,EACN,WAAW,GAAG,yBAAyB,EACvC,wBAAwB,GAAG,4BAA4B,OAExC,EADZ,SAAS,cAzBd,oXA0BC,CADa;IAId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,EAAE,oBAAoB,GAC/B;gBAGD,eAAe,IAAI,aAAa,IAAI,CACnC,6CAAkB,MAAM,EAAC,EAAE,EAAE,qBAAqB,IAC/C,eAAe,CACX,CACR;gBAEA,QAAQ;gBAET,oBAAC,YAAY,IACX,UAAU,EAAE,gBAAgB,EAC5B,UAAU,EAAE,oBAAoB,IAAI,gBAAgB,EACpD,MAAM,EAAE,wBAAwB,GAChC,CACA,CACA;QAEN,oBAAC,UAAU,QAAE,cAAc,CAAc,CACxC,CACJ,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { forwardRef, useImperativeHandle, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport styles from './styles.css.js';\nimport { useUniqueId } from '../../hooks/use-unique-id';\n\nimport { KeyCode } from '../../keycode';\nimport LiveRegion from '../live-region/index';\nimport ApplicationController, { ApplicationRef } from './application-controller';\nimport FocusOutline from './focus-outline';\nimport { Offset } from '../interfaces';\nimport { useInternalI18n } from '../../i18n/context.js';\n\nconst DEFAULT_PLOT_FOCUS_OFFSET = 3;\nconst DEFAULT_ELEMENT_FOCUS_OFFSET = 3;\n\nexport interface ChartPlotRef {\n svg: SVGSVGElement;\n focusPlot(): void;\n focusApplication(): void;\n}\n\nexport interface ChartPlotProps {\n width: number;\n height: number;\n transform?: string;\n offsetTop?: number;\n offsetBottom?: number;\n offsetLeft?: number;\n offsetRight?: number;\n focusOffset?: number;\n ariaLabel?: string;\n ariaLabelledby?: string;\n ariaDescription?: string;\n ariaDescribedby?: string;\n ariaRoleDescription?: string;\n activeElementKey?: null | string | number | boolean;\n activeElementRef?: React.RefObject<SVGGElement>;\n activeElementFocusOffset?: Offset;\n ariaLiveRegion?: React.ReactNode;\n isClickable?: boolean;\n isPrecise?: boolean;\n onMouseDown?: (event: React.MouseEvent<SVGSVGElement>) => void;\n onMouseMove?: (event: React.MouseEvent<SVGSVGElement>) => void;\n onMouseOut?: (event: React.MouseEvent<SVGSVGElement>) => void;\n onFocus?: (event: React.FocusEvent<SVGGElement>, trigger: 'mouse' | 'keyboard') => void;\n onBlur?: (event: React.FocusEvent<SVGGElement>) => void;\n onKeyDown?: (event: React.KeyboardEvent<SVGGElement>) => void;\n children: React.ReactNode;\n}\n\n/**\n An extension for the SVG to be used for charts. It includes a controller element to\n handle the focus and keyboard interactions in a way that is supported by screen readers.\n\n The application mimics the aria-activedescendant behavior which is unsupported by Safari. The\n activeElementRef is the pointer to the secondary-focus element and activeElementKey denotes when\n the focus transition was made.\n\n Alternatively, ariaLiveRegion can be used to make announcements.\n*/\nexport default forwardRef(ChartPlot);\n\nfunction ChartPlot(\n {\n width,\n height,\n transform,\n offsetTop,\n offsetBottom,\n offsetLeft,\n offsetRight,\n ariaLabel,\n ariaLabelledby,\n ariaRoleDescription,\n ariaDescription,\n ariaDescribedby,\n activeElementKey,\n activeElementRef,\n ariaLiveRegion,\n isClickable,\n isPrecise,\n children,\n onMouseDown,\n onKeyDown,\n onFocus,\n onBlur,\n focusOffset = DEFAULT_PLOT_FOCUS_OFFSET,\n activeElementFocusOffset = DEFAULT_ELEMENT_FOCUS_OFFSET,\n ...restProps\n }: ChartPlotProps,\n ref: React.Ref<ChartPlotRef>\n) {\n const i18n = useInternalI18n('[charts]');\n const svgRef = useRef<SVGSVGElement>(null);\n const applicationRef = useRef<ApplicationRef>(null);\n const plotClickedRef = useRef(false);\n const [isPlotFocused, setPlotFocused] = useState(false);\n const [isApplicationFocused, setApplicationFocused] = useState(false);\n\n const internalDescriptionId = useUniqueId('awsui-chart-plot__description');\n const ariaDescriptionId = [ariaDescription && internalDescriptionId, ariaDescribedby].filter(Boolean).join(' ');\n\n useImperativeHandle(ref, () => ({\n svg: svgRef.current!,\n focusPlot: () => svgRef.current!.focus(),\n focusApplication: () => applicationRef.current!.focus(),\n }));\n\n const onPlotMouseDown = (event: React.MouseEvent<SVGSVGElement, MouseEvent>) => {\n onMouseDown && onMouseDown(event);\n // Record the click was made for the application focus handler.\n plotClickedRef.current = true;\n };\n const onPlotFocus = (event: React.FocusEvent<SVGSVGElement>) => {\n if (event.target === svgRef.current && !plotClickedRef.current) {\n setPlotFocused(true);\n }\n // The click should focus the underling application bypassing the svg.\n else if (plotClickedRef.current) {\n applicationRef.current!.focus();\n }\n };\n const onPlotBlur = (event: React.FocusEvent<SVGSVGElement>) => {\n if (event.target === svgRef.current) {\n setPlotFocused(false);\n }\n };\n // Once one of the expected keys is pressed the focus is delegated to the application controller.\n const onPlotKeyDown = (event: React.KeyboardEvent) => {\n if (isPlotFocused) {\n // Delegate the focus to the application if one of the expected keys was pressed.\n const codes = [KeyCode.space, KeyCode.enter, KeyCode.up, KeyCode.left, KeyCode.right, KeyCode.down];\n if (codes.indexOf(event.keyCode) !== -1) {\n applicationRef.current!.focus();\n }\n }\n };\n\n const onApplicationFocus = (event: React.FocusEvent<SVGGElement>) => {\n onFocus && onFocus(event, plotClickedRef.current ? 'mouse' : 'keyboard');\n // \"Release\" the click reference to not affect the next call of this handler.\n plotClickedRef.current = false;\n setApplicationFocused(true);\n };\n const onApplicationBlur = (event: React.FocusEvent<SVGGElement>) => {\n onBlur && onBlur(event);\n setApplicationFocused(false);\n };\n const onApplicationKeyDown = onKeyDown;\n\n const plotFocusable = !isApplicationFocused;\n const plotTabIndex = plotFocusable ? 0 : -1;\n const plotAria = !isApplicationFocused\n ? {\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n 'aria-describedby': ariaDescriptionId,\n 'aria-roledescription': i18n('i18nStrings.chartAriaRoleDescription', ariaRoleDescription),\n }\n : {};\n\n return (\n <>\n <svg\n {...restProps}\n focusable={plotFocusable}\n tabIndex={plotTabIndex}\n role=\"application\"\n aria-hidden=\"false\"\n {...plotAria}\n ref={svgRef}\n width={width}\n height={height}\n style={{\n marginTop: offsetTop,\n marginBottom: offsetBottom,\n marginLeft: offsetLeft,\n marginRight: offsetRight,\n }}\n className={clsx(styles.root, {\n [styles.clickable]: isClickable,\n [styles.precise]: isPrecise,\n })}\n onMouseDown={onPlotMouseDown}\n onFocus={onPlotFocus}\n onBlur={onPlotBlur}\n onKeyDown={onPlotKeyDown}\n >\n <FocusOutline elementRef={svgRef} elementKey={isPlotFocused} offset={focusOffset} />\n\n <g transform={transform}>\n <ApplicationController\n activeElementKey={activeElementKey || null}\n activeElementRef={activeElementRef}\n ref={applicationRef}\n onFocus={onApplicationFocus}\n onBlur={onApplicationBlur}\n onKeyDown={onApplicationKeyDown}\n />\n\n {/* Only show description when plot is focusable to avoid repetition in Safari and Firefox */}\n {ariaDescription && plotFocusable && (\n <desc aria-hidden=\"true\" id={internalDescriptionId}>\n {ariaDescription}\n </desc>\n )}\n\n {children}\n\n <FocusOutline\n elementRef={activeElementRef}\n elementKey={isApplicationFocused && activeElementKey}\n offset={activeElementFocusOffset}\n />\n </g>\n </svg>\n\n <LiveRegion>{ariaLiveRegion}</LiveRegion>\n </>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["internal/components/chart-plot/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjF,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,UAAU,MAAM,sBAAsB,CAAC;AAC9C,OAAO,qBAAyC,MAAM,0BAA0B,CAAC;AACjF,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAE3C,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,MAAM,yBAAyB,GAAG,CAAC,CAAC;AACpC,MAAM,4BAA4B,GAAG,C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,CAAC,OAAO,CAAC,EAAE,SAAS;aAC5B,CAAC,EACF,WAAW,EAAE,eAAe,EAC5B,OAAO,EAAE,WAAW,EACpB,MAAM,EAAE,UAAU,EAClB,SAAS,EAAE,aAAa;YAExB,oBAAC,YAAY,IAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,EAAE,WAAW,GAAI;YAEpF,2BAAG,SAAS,EAAE,SAAS;gBACrB,oBAAC,qBAAqB,IACpB,gBAAgB,EAAE,gBAAgB,IAAI,IAAI,EAC1C,gBAAgB,EAAE,gBAAgB,EAClC,GAAG,EAAE,cAAc,EACnB,OAAO,EAAE,kBAAkB,EAC3B,MAAM,EAAE,iBAAiB,EACzB,SAAS,EAAE,oBAAoB,GAC/B;gBAGD,eAAe,IAAI,aAAa,IAAI,CACnC,6CAAkB,MAAM,EAAC,EAAE,EAAE,qBAAqB,IAC/C,eAAe,CACX,CACR;gBAEA,QAAQ;gBAET,oBAAC,YAAY,IACX,UAAU,EAAE,gBAAgB,EAC5B,UAAU,EAAE,oBAAoB,IAAI,gBAAgB,EACpD,MAAM,EAAE,wBAAwB,GAChC,CACA,CACA;QAEN,oBAAC,UAAU,QAAE,cAAc,CAAc,CACxC,CACJ,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { forwardRef, useImperativeHandle, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport styles from './styles.css.js';\nimport { useUniqueId } from '../../hooks/use-unique-id';\n\nimport { KeyCode } from '../../keycode';\nimport LiveRegion from '../live-region/index';\nimport ApplicationController, { ApplicationRef } from './application-controller';\nimport FocusOutline from './focus-outline';\nimport { Offset } from '../interfaces';\nimport { useInternalI18n } from '../../i18n/context.js';\n\nconst DEFAULT_PLOT_FOCUS_OFFSET = 3;\nconst DEFAULT_ELEMENT_FOCUS_OFFSET = 3;\n\nexport interface ChartPlotRef {\n svg: SVGSVGElement;\n focusPlot(): void;\n focusApplication(): void;\n}\n\nexport interface ChartPlotProps {\n width: number | string;\n height: number | string;\n transform?: string;\n offsetTop?: number;\n offsetBottom?: number;\n offsetLeft?: number;\n offsetRight?: number;\n focusOffset?: number;\n ariaLabel?: string;\n ariaLabelledby?: string;\n ariaDescription?: string;\n ariaDescribedby?: string;\n ariaRoleDescription?: string;\n activeElementKey?: null | string | number | boolean;\n activeElementRef?: React.RefObject<SVGGElement>;\n activeElementFocusOffset?: Offset;\n ariaLiveRegion?: React.ReactNode;\n isClickable?: boolean;\n isPrecise?: boolean;\n onMouseDown?: (event: React.MouseEvent<SVGSVGElement>) => void;\n onMouseMove?: (event: React.MouseEvent<SVGSVGElement>) => void;\n onMouseOut?: (event: React.MouseEvent<SVGSVGElement>) => void;\n onFocus?: (event: React.FocusEvent<SVGGElement>, trigger: 'mouse' | 'keyboard') => void;\n onBlur?: (event: React.FocusEvent<SVGGElement>) => void;\n onKeyDown?: (event: React.KeyboardEvent<SVGGElement>) => void;\n children: React.ReactNode;\n}\n\n/**\n An extension for the SVG to be used for charts. It includes a controller element to\n handle the focus and keyboard interactions in a way that is supported by screen readers.\n\n The application mimics the aria-activedescendant behavior which is unsupported by Safari. The\n activeElementRef is the pointer to the secondary-focus element and activeElementKey denotes when\n the focus transition was made.\n\n Alternatively, ariaLiveRegion can be used to make announcements.\n*/\nexport default forwardRef(ChartPlot);\n\nfunction ChartPlot(\n {\n width,\n height,\n transform,\n offsetTop,\n offsetBottom,\n offsetLeft,\n offsetRight,\n ariaLabel,\n ariaLabelledby,\n ariaRoleDescription,\n ariaDescription,\n ariaDescribedby,\n activeElementKey,\n activeElementRef,\n ariaLiveRegion,\n isClickable,\n isPrecise,\n children,\n onMouseDown,\n onKeyDown,\n onFocus,\n onBlur,\n focusOffset = DEFAULT_PLOT_FOCUS_OFFSET,\n activeElementFocusOffset = DEFAULT_ELEMENT_FOCUS_OFFSET,\n ...restProps\n }: ChartPlotProps,\n ref: React.Ref<ChartPlotRef>\n) {\n const i18n = useInternalI18n('[charts]');\n const svgRef = useRef<SVGSVGElement>(null);\n const applicationRef = useRef<ApplicationRef>(null);\n const plotClickedRef = useRef(false);\n const [isPlotFocused, setPlotFocused] = useState(false);\n const [isApplicationFocused, setApplicationFocused] = useState(false);\n\n const internalDescriptionId = useUniqueId('awsui-chart-plot__description');\n const ariaDescriptionId = [ariaDescription && internalDescriptionId, ariaDescribedby].filter(Boolean).join(' ');\n\n useImperativeHandle(ref, () => ({\n svg: svgRef.current!,\n focusPlot: () => svgRef.current!.focus(),\n focusApplication: () => applicationRef.current!.focus(),\n }));\n\n const onPlotMouseDown = (event: React.MouseEvent<SVGSVGElement, MouseEvent>) => {\n onMouseDown && onMouseDown(event);\n // Record the click was made for the application focus handler.\n plotClickedRef.current = true;\n };\n const onPlotFocus = (event: React.FocusEvent<SVGSVGElement>) => {\n if (event.target === svgRef.current && !plotClickedRef.current) {\n setPlotFocused(true);\n }\n // The click should focus the underling application bypassing the svg.\n else if (plotClickedRef.current) {\n applicationRef.current!.focus();\n }\n };\n const onPlotBlur = (event: React.FocusEvent<SVGSVGElement>) => {\n if (event.target === svgRef.current) {\n setPlotFocused(false);\n }\n };\n // Once one of the expected keys is pressed the focus is delegated to the application controller.\n const onPlotKeyDown = (event: React.KeyboardEvent) => {\n if (isPlotFocused) {\n // Delegate the focus to the application if one of the expected keys was pressed.\n const codes = [KeyCode.space, KeyCode.enter, KeyCode.up, KeyCode.left, KeyCode.right, KeyCode.down];\n if (codes.indexOf(event.keyCode) !== -1) {\n applicationRef.current!.focus();\n }\n }\n };\n\n const onApplicationFocus = (event: React.FocusEvent<SVGGElement>) => {\n onFocus && onFocus(event, plotClickedRef.current ? 'mouse' : 'keyboard');\n // \"Release\" the click reference to not affect the next call of this handler.\n plotClickedRef.current = false;\n setApplicationFocused(true);\n };\n const onApplicationBlur = (event: React.FocusEvent<SVGGElement>) => {\n onBlur && onBlur(event);\n setApplicationFocused(false);\n };\n const onApplicationKeyDown = onKeyDown;\n\n const plotFocusable = !isApplicationFocused;\n const plotTabIndex = plotFocusable ? 0 : -1;\n const plotAria = !isApplicationFocused\n ? {\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n 'aria-describedby': ariaDescriptionId,\n 'aria-roledescription': i18n('i18nStrings.chartAriaRoleDescription', ariaRoleDescription),\n }\n : {};\n\n return (\n <>\n <svg\n {...restProps}\n focusable={plotFocusable}\n tabIndex={plotTabIndex}\n role=\"application\"\n aria-hidden=\"false\"\n {...plotAria}\n ref={svgRef}\n style={{\n width,\n height,\n marginTop: offsetTop,\n marginBottom: offsetBottom,\n marginLeft: offsetLeft,\n marginRight: offsetRight,\n }}\n className={clsx(styles.root, {\n [styles.clickable]: isClickable,\n [styles.precise]: isPrecise,\n })}\n onMouseDown={onPlotMouseDown}\n onFocus={onPlotFocus}\n onBlur={onPlotBlur}\n onKeyDown={onPlotKeyDown}\n >\n <FocusOutline elementRef={svgRef} elementKey={isPlotFocused} offset={focusOffset} />\n\n <g transform={transform}>\n <ApplicationController\n activeElementKey={activeElementKey || null}\n activeElementRef={activeElementRef}\n ref={applicationRef}\n onFocus={onApplicationFocus}\n onBlur={onApplicationBlur}\n onKeyDown={onApplicationKeyDown}\n />\n\n {/* Only show description when plot is focusable to avoid repetition in Safari and Firefox */}\n {ariaDescription && plotFocusable && (\n <desc aria-hidden=\"true\" id={internalDescriptionId}>\n {ariaDescription}\n </desc>\n )}\n\n {children}\n\n <FocusOutline\n elementRef={activeElementRef}\n elementKey={isApplicationFocused && activeElementKey}\n offset={activeElementFocusOffset}\n />\n </g>\n </svg>\n\n <LiveRegion>{ariaLiveRegion}</LiveRegion>\n </>\n );\n}\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BaseComponentProps } from '../../base-component/index.js';
|
|
3
3
|
interface ChartWrapperProps extends BaseComponentProps {
|
|
4
|
+
fitHeight: boolean;
|
|
4
5
|
defaultFilter: React.ReactNode;
|
|
5
6
|
additionalFilters: React.ReactNode;
|
|
6
7
|
reserveFilterSpace: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["internal/components/chart-wrapper/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAI1C,OAAO,EAAE,kBAAkB,EAAgB,MAAM,+BAA+B,CAAC;AAIjF,UAAU,iBAAkB,SAAQ,kBAAkB;IACpD,aAAa,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B,iBAAiB,EAAE,KAAK,CAAC,SAAS,CAAC;IACnC,kBAAkB,EAAE,OAAO,CAAC;IAC5B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,WAAW,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,MAAM,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,GAAG,IAAI,CAAC;IACvC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["internal/components/chart-wrapper/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAI1C,OAAO,EAAE,kBAAkB,EAAgB,MAAM,+BAA+B,CAAC;AAIjF,UAAU,iBAAkB,SAAQ,kBAAkB;IACpD,SAAS,EAAE,OAAO,CAAC;IACnB,aAAa,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B,iBAAiB,EAAE,KAAK,CAAC,SAAS,CAAC;IACnC,kBAAkB,EAAE,OAAO,CAAC;IAC5B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,WAAW,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,MAAM,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,GAAG,IAAI,CAAC;IACvC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,eAAO,MAAM,YAAY,0FAkFxB,CAAC"}
|
|
@@ -8,19 +8,34 @@ import { getBaseProps } from '../../base-component/index.js';
|
|
|
8
8
|
import InternalBox from '../../../box/internal.js';
|
|
9
9
|
import InternalSpaceBetween from '../../../space-between/internal.js';
|
|
10
10
|
export const ChartWrapper = forwardRef((_a, ref) => {
|
|
11
|
-
var { defaultFilter, additionalFilters, reserveFilterSpace, reserveLegendSpace, chartStatus, chart, legend, onBlur, contentClassName, contentMinHeight } = _a, props = __rest(_a, ["defaultFilter", "additionalFilters", "reserveFilterSpace", "reserveLegendSpace", "chartStatus", "chart", "legend", "onBlur", "contentClassName", "contentMinHeight"]);
|
|
11
|
+
var { defaultFilter, additionalFilters, reserveFilterSpace, reserveLegendSpace, chartStatus, chart, legend, onBlur, contentClassName, contentMinHeight, fitHeight } = _a, props = __rest(_a, ["defaultFilter", "additionalFilters", "reserveFilterSpace", "reserveLegendSpace", "chartStatus", "chart", "legend", "onBlur", "contentClassName", "contentMinHeight", "fitHeight"]);
|
|
12
12
|
const baseProps = getBaseProps(props);
|
|
13
|
+
const filtersNode = (defaultFilter || additionalFilters) && (React.createElement(InternalBox, { className: styles['filter-container'], margin: { bottom: 'l' } },
|
|
14
|
+
React.createElement(InternalSpaceBetween, { size: "l", direction: "horizontal", className: clsx({ [styles['has-default-filter']]: !!defaultFilter }) },
|
|
15
|
+
defaultFilter,
|
|
16
|
+
additionalFilters)));
|
|
17
|
+
const legendNode = legend && React.createElement(InternalBox, { margin: { top: 'm' } }, legend);
|
|
18
|
+
if (fitHeight) {
|
|
19
|
+
return (React.createElement("div", Object.assign({ ref: ref }, baseProps, { className: clsx(baseProps.className, styles.wrapper, styles['wrapper--fit-height']), onBlur: onBlur }),
|
|
20
|
+
React.createElement("div", { className: clsx(styles['inner-wrapper'], styles['inner-wrapper--fit-height']) },
|
|
21
|
+
filtersNode,
|
|
22
|
+
React.createElement("div", { className: clsx(styles.content, contentClassName, {
|
|
23
|
+
[styles['content--reserve-filter']]: reserveFilterSpace,
|
|
24
|
+
[styles['content--reserve-legend']]: reserveLegendSpace,
|
|
25
|
+
[styles['content--fit-height']]: true,
|
|
26
|
+
}) },
|
|
27
|
+
chartStatus,
|
|
28
|
+
chart),
|
|
29
|
+
legendNode)));
|
|
30
|
+
}
|
|
13
31
|
return (React.createElement("div", Object.assign({ ref: ref }, baseProps, { className: clsx(baseProps.className, styles.wrapper), onBlur: onBlur }),
|
|
14
|
-
|
|
15
|
-
React.createElement(InternalSpaceBetween, { size: "l", direction: "horizontal", className: clsx({ [styles['has-default-filter']]: !!defaultFilter }) },
|
|
16
|
-
defaultFilter,
|
|
17
|
-
additionalFilters))),
|
|
32
|
+
filtersNode,
|
|
18
33
|
React.createElement("div", { className: clsx(styles.content, contentClassName, {
|
|
19
34
|
[styles['content--reserve-filter']]: reserveFilterSpace,
|
|
20
35
|
[styles['content--reserve-legend']]: reserveLegendSpace,
|
|
21
36
|
}), style: { minHeight: contentMinHeight } },
|
|
22
37
|
chartStatus,
|
|
23
38
|
chart),
|
|
24
|
-
|
|
39
|
+
legendNode));
|
|
25
40
|
});
|
|
26
41
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["internal/components/chart-wrapper/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;;AAEtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAsB,YAAY,EAAE,MAAM,+BAA+B,CAAC;AACjF,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,OAAO,oBAAoB,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["internal/components/chart-wrapper/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;;AAEtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAsB,YAAY,EAAE,MAAM,+BAA+B,CAAC;AACjF,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,OAAO,oBAAoB,MAAM,oCAAoC,CAAC;AAgBtE,MAAM,CAAC,MAAM,YAAY,GAAG,UAAU,CACpC,CACE,EAaoB,EACpB,GAA8B,EAC9B,EAAE;QAfF,EACE,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,WAAW,EACX,KAAK,EACL,MAAM,EACN,MAAM,EACN,gBAAgB,EAChB,gBAAgB,EAChB,SAAS,OAES,EADf,KAAK,cAZV,mLAaC,CADS;IAIV,MAAM,SAAS,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IAEtC,MAAM,WAAW,GAAG,CAAC,aAAa,IAAI,iBAAiB,CAAC,IAAI,CAC1D,oBAAC,WAAW,IAAC,SAAS,EAAE,MAAM,CAAC,kBAAkB,CAAC,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE;QACzE,oBAAC,oBAAoB,IACnB,IAAI,EAAC,GAAG,EACR,SAAS,EAAC,YAAY,EACtB,SAAS,EAAE,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC,aAAa,EAAE,CAAC;YAEnE,aAAa;YACb,iBAAiB,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C,WAAW;YACX,KAAK,CACF;QAEL,UAAU,CACP,CACP,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { forwardRef } from 'react';\nimport clsx from 'clsx';\n\nimport styles from './styles.css.js';\nimport { BaseComponentProps, getBaseProps } from '../../base-component/index.js';\nimport InternalBox from '../../../box/internal.js';\nimport InternalSpaceBetween from '../../../space-between/internal.js';\n\ninterface ChartWrapperProps extends BaseComponentProps {\n fitHeight: boolean;\n defaultFilter: React.ReactNode;\n additionalFilters: React.ReactNode;\n reserveFilterSpace: boolean;\n reserveLegendSpace: boolean;\n chartStatus: React.ReactNode;\n chart: React.ReactNode;\n legend: React.ReactNode;\n onBlur?(event: React.FocusEvent): void;\n contentClassName?: string;\n contentMinHeight?: number;\n}\n\nexport const ChartWrapper = forwardRef(\n (\n {\n defaultFilter,\n additionalFilters,\n reserveFilterSpace,\n reserveLegendSpace,\n chartStatus,\n chart,\n legend,\n onBlur,\n contentClassName,\n contentMinHeight,\n fitHeight,\n ...props\n }: ChartWrapperProps,\n ref: React.Ref<HTMLDivElement>\n ) => {\n const baseProps = getBaseProps(props);\n\n const filtersNode = (defaultFilter || additionalFilters) && (\n <InternalBox className={styles['filter-container']} margin={{ bottom: 'l' }}>\n <InternalSpaceBetween\n size=\"l\"\n direction=\"horizontal\"\n className={clsx({ [styles['has-default-filter']]: !!defaultFilter })}\n >\n {defaultFilter}\n {additionalFilters}\n </InternalSpaceBetween>\n </InternalBox>\n );\n\n const legendNode = legend && <InternalBox margin={{ top: 'm' }}>{legend}</InternalBox>;\n\n if (fitHeight) {\n return (\n <div\n ref={ref}\n {...baseProps}\n className={clsx(baseProps.className, styles.wrapper, styles['wrapper--fit-height'])}\n onBlur={onBlur}\n >\n <div className={clsx(styles['inner-wrapper'], styles['inner-wrapper--fit-height'])}>\n {filtersNode}\n\n <div\n className={clsx(styles.content, contentClassName, {\n [styles['content--reserve-filter']]: reserveFilterSpace,\n [styles['content--reserve-legend']]: reserveLegendSpace,\n [styles['content--fit-height']]: true,\n })}\n >\n {chartStatus}\n {chart}\n </div>\n\n {legendNode}\n </div>\n </div>\n );\n }\n\n return (\n <div ref={ref} {...baseProps} className={clsx(baseProps.className, styles.wrapper)} onBlur={onBlur}>\n {filtersNode}\n\n <div\n className={clsx(styles.content, contentClassName, {\n [styles['content--reserve-filter']]: reserveFilterSpace,\n [styles['content--reserve-legend']]: reserveLegendSpace,\n })}\n style={{ minHeight: contentMinHeight }}\n >\n {chartStatus}\n {chart}\n </div>\n\n {legendNode}\n </div>\n );\n }\n);\n"]}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"wrapper": "
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"content
|
|
9
|
-
"filter
|
|
4
|
+
"wrapper": "awsui_wrapper_z5mul_beze6_93",
|
|
5
|
+
"wrapper--fit-height": "awsui_wrapper--fit-height_z5mul_beze6_107",
|
|
6
|
+
"inner-wrapper--fit-height": "awsui_inner-wrapper--fit-height_z5mul_beze6_112",
|
|
7
|
+
"has-default-filter": "awsui_has-default-filter_z5mul_beze6_118",
|
|
8
|
+
"content": "awsui_content_z5mul_beze6_122",
|
|
9
|
+
"content--reserve-filter": "awsui_content--reserve-filter_z5mul_beze6_129",
|
|
10
|
+
"content--reserve-legend": "awsui_content--reserve-legend_z5mul_beze6_133",
|
|
11
|
+
"content--fit-height": "awsui_content--fit-height_z5mul_beze6_137",
|
|
12
|
+
"filter-container": "awsui_filter-container_z5mul_beze6_141"
|
|
10
13
|
};
|
|
11
14
|
|
|
@@ -90,7 +90,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
90
90
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
91
91
|
SPDX-License-Identifier: Apache-2.0
|
|
92
92
|
*/
|
|
93
|
-
.
|
|
93
|
+
.awsui_wrapper_z5mul_beze6_93:not(#\9) {
|
|
94
94
|
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
95
95
|
border-collapse: separate;
|
|
96
96
|
border-spacing: 0;
|
|
@@ -130,26 +130,40 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
130
130
|
position: relative;
|
|
131
131
|
display: block;
|
|
132
132
|
}
|
|
133
|
+
.awsui_wrapper--fit-height_z5mul_beze6_107:not(#\9) {
|
|
134
|
+
height: 100%;
|
|
135
|
+
overflow-y: auto;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.awsui_inner-wrapper--fit-height_z5mul_beze6_112:not(#\9) {
|
|
139
|
+
display: flex;
|
|
140
|
+
flex-direction: column;
|
|
141
|
+
height: 100%;
|
|
142
|
+
}
|
|
133
143
|
|
|
134
|
-
.awsui_has-default-
|
|
144
|
+
.awsui_has-default-filter_z5mul_beze6_118 > :not(#\9):first-child {
|
|
135
145
|
flex: 280px 0 1;
|
|
136
146
|
}
|
|
137
147
|
|
|
138
|
-
.
|
|
148
|
+
.awsui_content_z5mul_beze6_122:not(#\9) {
|
|
139
149
|
display: flex;
|
|
140
150
|
position: relative;
|
|
141
151
|
justify-content: center;
|
|
142
152
|
align-items: center;
|
|
143
153
|
}
|
|
144
154
|
|
|
145
|
-
.awsui_content--reserve-
|
|
155
|
+
.awsui_content--reserve-filter_z5mul_beze6_129:not(#\9) {
|
|
146
156
|
margin-top: calc(2 * var(--font-body-m-line-height-43ichb, 22px));
|
|
147
157
|
}
|
|
148
158
|
|
|
149
|
-
.awsui_content--reserve-
|
|
159
|
+
.awsui_content--reserve-legend_z5mul_beze6_133:not(#\9) {
|
|
150
160
|
margin-bottom: calc(2 * var(--font-body-m-line-height-43ichb, 22px));
|
|
151
161
|
}
|
|
152
162
|
|
|
153
|
-
.
|
|
163
|
+
.awsui_content--fit-height_z5mul_beze6_137:not(#\9) {
|
|
164
|
+
flex: 1;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.awsui_filter-container_z5mul_beze6_141:not(#\9) {
|
|
154
168
|
/* used in test-utils */
|
|
155
169
|
}
|
|
@@ -2,11 +2,14 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"wrapper": "
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"content
|
|
10
|
-
"filter
|
|
5
|
+
"wrapper": "awsui_wrapper_z5mul_beze6_93",
|
|
6
|
+
"wrapper--fit-height": "awsui_wrapper--fit-height_z5mul_beze6_107",
|
|
7
|
+
"inner-wrapper--fit-height": "awsui_inner-wrapper--fit-height_z5mul_beze6_112",
|
|
8
|
+
"has-default-filter": "awsui_has-default-filter_z5mul_beze6_118",
|
|
9
|
+
"content": "awsui_content_z5mul_beze6_122",
|
|
10
|
+
"content--reserve-filter": "awsui_content--reserve-filter_z5mul_beze6_129",
|
|
11
|
+
"content--reserve-legend": "awsui_content--reserve-legend_z5mul_beze6_133",
|
|
12
|
+
"content--fit-height": "awsui_content--fit-height_z5mul_beze6_137",
|
|
13
|
+
"filter-container": "awsui_filter-container_z5mul_beze6_141"
|
|
11
14
|
};
|
|
12
15
|
|
|
@@ -4,7 +4,7 @@ import { __rest } from "tslib";
|
|
|
4
4
|
import React, { useState } from 'react';
|
|
5
5
|
import { useCallback, useRef } from 'react';
|
|
6
6
|
import { Transition as ReactTransitionGroupTransition, } from 'react-transition-group';
|
|
7
|
-
import { useReducedMotion } from '
|
|
7
|
+
import { useReducedMotion } from '@cloudscape-design/component-toolkit/internal';
|
|
8
8
|
/**
|
|
9
9
|
* This component is a wrapper around the CSSTransition component.
|
|
10
10
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["internal/components/transition/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAoB,WAAW,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,EACL,UAAU,IAAI,8BAA8B,GAE7C,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["internal/components/transition/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAoB,WAAW,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,EACL,UAAU,IAAI,8BAA8B,GAE7C,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,gBAAgB,EAAE,MAAM,+CAA+C,CAAC;AAejF;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,EAQT;QARS,EACzB,EAAE,EAAE,IAAI,EACR,QAAQ,EACR,IAAI,GAAG,IAAI,EACX,cAAc,GAAG,GAAG,EAAE,CAAC,KAAK,CAAC,EAC7B,QAAQ,GAAG,KAAK,EAChB,qBAAqB,OAEL,EADb,IAAI,cAPkB,iFAQ1B,CADQ;IAEP,MAAM,qBAAqB,GAAG,MAAM,CAAc,IAAI,CAAC,CAAC;IACxD,uFAAuF;IACvF,yFAAyF;IACzF,yHAAyH;IACzH,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,QAAQ,CAAmB,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;IACtG,MAAM,cAAc,GAAG,gBAAgB,CAAC,qBAAqB,CAAC,IAAI,QAAQ,CAAC;IAE3E,MAAM,wBAAwB,GA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AAkB,CAAC,UAAU,CAAC,CAAC;wBAC/B,cAAc,CAAC,UAAU,CAAC,CAAC;oBAC7B,CAAC,EAAE,qBAAqB,aAArB,qBAAqB,uBAArB,qBAAqB,CAAE,QAAQ,CAAC,CAAC;iBACrC;qBAAM;oBACL,kBAAkB,CAAC,UAAU,CAAC,CAAC;oBAC/B,cAAc,CAAC,UAAU,CAAC,CAAC;iBAC5B;aACF;QACH,CAAC,EACD,SAAS,EAAE,WAAW,CAAC,EAAE;YACvB,IAAI,CAAC,WAAW,EAAE;gBAChB,kBAAkB,CAAC,SAAS,CAAC,CAAC;gBAC9B,cAAc,CAAC,SAAS,CAAC,CAAC;aAC3B;QACH,CAAC,EACD,MAAM,EAAE,GAAG,EAAE;YACX,kBAAkB,CAAC,MAAM,CAAC,CAAC;YAC3B,cAAc,CAAC,MAAM,CAAC,CAAC;QACzB,CAAC,EACD,SAAS,EAAE,GAAG,EAAE;YACd,kBAAkB,CAAC,SAAS,CAAC,CAAC;YAC9B,cAAc,CAAC,SAAS,CAAC,CAAC;QAC5B,CAAC,EACD,QAAQ,EAAE,GAAG,EAAE;YACb,kBAAkB,CAAC,QAAQ,CAAC,CAAC;YAC7B,cAAc,CAAC,QAAQ,CAAC,CAAC;QAC3B,CAAC,IACG,IAAI,GAEP,GAAG,EAAE,CAAC,QAAQ,CAAC,eAAe,EAAE,qBAAqB,CAAC,CACxB,CAClC,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useState } from 'react';\nimport { MutableRefObject, useCallback, useRef } from 'react';\nimport {\n Transition as ReactTransitionGroupTransition,\n TransitionStatus as ReactTransitionGroupTransitionStatus,\n} from 'react-transition-group';\nimport { useReducedMotion } from '@cloudscape-design/component-toolkit/internal';\n\nexport type TransitionStatus = ReactTransitionGroupTransitionStatus | 'enter' | 'exit';\n\nexport interface TransitionProps {\n in: boolean;\n exit?: boolean;\n\n disabled?: boolean;\n\n children: (state: TransitionStatus, transitioningElementRef: MutableRefObject<any>) => React.ReactNode;\n onStatusChange?: (status: TransitionStatus) => void;\n transitionChangeDelay?: { entering?: number };\n}\n\n/**\n * This component is a wrapper around the CSSTransition component.\n *\n * It provides a second parameter in its rendering function that must be\n * attached to the node that is transitioning.\n */\nexport function Transition({\n in: isIn,\n children,\n exit = true,\n onStatusChange = () => void 0,\n disabled = false,\n transitionChangeDelay,\n ...rest\n}: TransitionProps) {\n const transitionRootElement = useRef<HTMLElement>(null);\n // the initial state of the transition should be either 'exited' or 'entered' depending\n // on the `in` property, this mimicks how internally the Transition component works here:\n // https://github.com/reactjs/react-transition-group/blob/6cbd6aaedaf8e9472007640b429ddb48c6c24158/src/Transition.js#L121\n const [transitionState, setTransitionState] = useState<TransitionStatus>(isIn ? 'entered' : 'exited');\n const motionDisabled = useReducedMotion(transitionRootElement) || disabled;\n\n const addTransitionEndListener = useCallback((done: () => void) => {\n const node = transitionRootElement.current;\n\n if (node === null) {\n return;\n }\n const listener = (e: TransitionEvent | AnimationEvent) => {\n if (e.target === node) {\n node.removeEventListener('transitionend', listener);\n node.removeEventListener('animationend', listener);\n done();\n }\n };\n node.addEventListener('transitionend', listener);\n node.addEventListener('animationend', listener);\n }, []);\n\n return (\n <ReactTransitionGroupTransition\n addEndListener={addTransitionEndListener}\n timeout={motionDisabled ? 0 : undefined}\n in={isIn}\n nodeRef={transitionRootElement}\n exit={exit}\n onEnter={isAppearing => {\n if (!isAppearing) {\n setTransitionState('enter');\n onStatusChange('enter');\n }\n }}\n onEntering={isAppearing => {\n if (!isAppearing) {\n // This line forces the browser to recalculate the layout because we want the starting state in the 'enter' style\n // to be applied before the animation starts.\n void transitionRootElement.current?.offsetHeight;\n\n if (transitionChangeDelay?.entering) {\n setTimeout(() => {\n setTransitionState('entering');\n onStatusChange('entering');\n }, transitionChangeDelay?.entering);\n } else {\n setTransitionState('entering');\n onStatusChange('entering');\n }\n }\n }}\n onEntered={isAppearing => {\n if (!isAppearing) {\n setTransitionState('entered');\n onStatusChange('entered');\n }\n }}\n onExit={() => {\n setTransitionState('exit');\n onStatusChange('exit');\n }}\n onExiting={() => {\n setTransitionState('exiting');\n onStatusChange('exiting');\n }}\n onExited={() => {\n setTransitionState('exited');\n onStatusChange('exited');\n }}\n {...rest}\n >\n {() => children(transitionState, transitionRootElement)}\n </ReactTransitionGroupTransition>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["internal/hooks/use-portal-mode-classes/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["internal/hooks/use-portal-mode-classes/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,UAWrE"}
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import { useVisualContext } from '../../components/visual-context';
|
|
5
|
-
import { useCurrentMode, useDensityMode
|
|
5
|
+
import { useCurrentMode, useDensityMode } from '@cloudscape-design/component-toolkit/internal';
|
|
6
|
+
import { useVisualRefresh } from '../use-visual-mode';
|
|
6
7
|
export function usePortalModeClasses(ref) {
|
|
7
8
|
const colorMode = useCurrentMode(ref);
|
|
8
9
|
const densityMode = useDensityMode(ref);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["internal/hooks/use-portal-mode-classes/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["internal/hooks/use-portal-mode-classes/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,+CAA+C,CAAC;AAC/F,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,MAAM,UAAU,oBAAoB,CAAC,GAAiC;IACpE,MAAM,SAAS,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC;IACtC,MAAM,WAAW,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC;IACxC,MAAM,OAAO,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC;IACtC,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC;IACzC,OAAO,IAAI,CAAC;QACV,yCAAyC,EAAE,SAAS,KAAK,MAAM;QAC/D,+CAA+C,EAAE,WAAW,KAAK,SAAS;QAC1E,sBAAsB,EAAE,aAAa;QACrC,CAAC,iBAAiB,OAAO,EAAE,CAAC,EAAE,OAAO;KACtC,CAAC,CAAC;AACL,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React from 'react';\nimport { useVisualContext } from '../../components/visual-context';\nimport { useCurrentMode, useDensityMode } from '@cloudscape-design/component-toolkit/internal';\nimport { useVisualRefresh } from '../use-visual-mode';\n\nexport function usePortalModeClasses(ref: React.RefObject<HTMLElement>) {\n const colorMode = useCurrentMode(ref);\n const densityMode = useDensityMode(ref);\n const context = useVisualContext(ref);\n const visualRefresh = useVisualRefresh();\n return clsx({\n 'awsui-polaris-dark-mode awsui-dark-mode': colorMode === 'dark',\n 'awsui-polaris-compact-mode awsui-compact-mode': densityMode === 'compact',\n 'awsui-visual-refresh': visualRefresh,\n [`awsui-context-${context}`]: context,\n });\n}\n"]}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export declare function useCurrentMode(elementRef: React.RefObject<HTMLElement>): "dark" | "light";
|
|
3
|
-
export declare function useDensityMode(elementRef: React.RefObject<HTMLElement>): "compact" | "comfortable";
|
|
4
1
|
export declare const useVisualRefresh: () => boolean;
|
|
5
2
|
export declare function clearVisualRefreshState(): void;
|
|
6
3
|
export declare function useVisualRefreshDynamic(): boolean;
|
|
7
|
-
export declare function useReducedMotion(elementRef: React.RefObject<HTMLElement>): boolean;
|
|
8
4
|
//# sourceMappingURL=index.d.ts.map
|