@cloudscape-design/components 3.0.629 → 3.0.631
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/breadcrumb-group/implementation.d.ts +8 -0
- package/breadcrumb-group/implementation.d.ts.map +1 -0
- package/breadcrumb-group/implementation.js +71 -0
- package/breadcrumb-group/implementation.js.map +1 -0
- package/breadcrumb-group/index.js +1 -1
- package/breadcrumb-group/index.js.map +1 -1
- package/breadcrumb-group/internal.d.ts +1 -11
- package/breadcrumb-group/internal.d.ts.map +1 -1
- package/breadcrumb-group/internal.js +2 -70
- package/breadcrumb-group/internal.js.map +1 -1
- package/breadcrumb-group/item/item.js +1 -1
- package/breadcrumb-group/item/item.js.map +1 -1
- package/breadcrumb-group/utils.d.ts +7 -0
- package/breadcrumb-group/utils.d.ts.map +1 -0
- package/breadcrumb-group/utils.js +6 -0
- package/breadcrumb-group/utils.js.map +1 -0
- package/drawer/implementation.d.ts +7 -0
- package/drawer/implementation.d.ts.map +1 -0
- package/drawer/implementation.js +24 -0
- package/drawer/implementation.js.map +1 -0
- package/drawer/index.d.ts +1 -1
- package/drawer/index.d.ts.map +1 -1
- package/drawer/index.js +4 -18
- package/drawer/index.js.map +1 -1
- package/drawer/internal.d.ts +2 -0
- package/drawer/internal.d.ts.map +1 -0
- package/drawer/internal.js +5 -0
- package/drawer/internal.js.map +1 -0
- package/header/styles.css.js +35 -35
- package/header/styles.scoped.css +51 -59
- package/header/styles.selectors.js +35 -35
- package/help-panel/implementation.d.ts +7 -0
- package/help-panel/implementation.d.ts.map +1 -0
- package/help-panel/implementation.js +27 -0
- package/help-panel/implementation.js.map +1 -0
- package/help-panel/index.d.ts +1 -1
- package/help-panel/index.d.ts.map +1 -1
- package/help-panel/index.js +4 -21
- package/help-panel/index.js.map +1 -1
- package/help-panel/internal.d.ts +2 -0
- package/help-panel/internal.d.ts.map +1 -0
- package/help-panel/internal.js +5 -0
- package/help-panel/internal.js.map +1 -0
- package/input/internal.d.ts.map +1 -1
- package/input/internal.js +1 -1
- package/input/internal.js.map +1 -1
- package/internal/base-component/styles.scoped.css +5 -0
- package/internal/environment.js +1 -1
- package/internal/environment.json +1 -1
- package/internal/generated/styles/tokens.d.ts +1 -0
- package/internal/generated/styles/tokens.js +1 -0
- package/internal/generated/theming/index.cjs +31 -0
- package/internal/generated/theming/index.js +31 -0
- package/internal/manifest.json +1 -1
- package/internal/widgets/index.d.ts +4 -0
- package/internal/widgets/index.d.ts.map +1 -0
- package/internal/widgets/index.js +28 -0
- package/internal/widgets/index.js.map +1 -0
- package/package.json +1 -1
- package/s3-resource-selector/s3-modal/index.js +2 -2
- package/s3-resource-selector/s3-modal/index.js.map +1 -1
- package/side-navigation/implementation.d.ts +7 -0
- package/side-navigation/implementation.d.ts.map +1 -0
- package/side-navigation/implementation.js +36 -0
- package/side-navigation/implementation.js.map +1 -0
- package/side-navigation/index.d.ts +1 -1
- package/side-navigation/index.d.ts.map +1 -1
- package/side-navigation/index.js +5 -29
- package/side-navigation/index.js.map +1 -1
- package/side-navigation/internal.d.ts +1 -17
- package/side-navigation/internal.d.ts.map +1 -1
- package/side-navigation/internal.js +2 -182
- package/side-navigation/internal.js.map +1 -1
- package/side-navigation/parts.d.ts +18 -0
- package/side-navigation/parts.d.ts.map +1 -0
- package/side-navigation/parts.js +185 -0
- package/side-navigation/parts.js.map +1 -0
- package/slider/internal.d.ts.map +1 -1
- package/slider/internal.js +6 -2
- package/slider/internal.js.map +1 -1
- package/slider/styles.css.js +25 -23
- package/slider/styles.scoped.css +95 -52
- package/slider/styles.selectors.js +25 -23
- package/slider/tick-marks.d.ts +1 -0
- package/slider/tick-marks.d.ts.map +1 -1
- package/slider/tick-marks.js +4 -1
- package/slider/tick-marks.js.map +1 -1
- package/split-panel/implementation.d.ts +1 -0
- package/split-panel/implementation.d.ts.map +1 -1
- package/split-panel/implementation.js +2 -0
- package/split-panel/implementation.js.map +1 -1
- package/split-panel/styles.css.js +57 -57
- package/split-panel/styles.scoped.css +78 -77
- package/split-panel/styles.selectors.js +57 -57
- package/split-panel/widget.d.ts +1 -5
- package/split-panel/widget.d.ts.map +1 -1
- package/split-panel/widget.js +1 -13
- package/split-panel/widget.js.map +1 -1
|
@@ -220,6 +220,7 @@
|
|
|
220
220
|
--color-background-slider-track-3m68rn:#7d8998;
|
|
221
221
|
--color-background-slider-handle-ring-31445h:#ffffff;
|
|
222
222
|
--color-background-slider-error-pressed-g7oqnt:#7c2718;
|
|
223
|
+
--color-background-slider-warning-pressed-9xuhwf:#8d6605;
|
|
223
224
|
--color-background-status-error-pbprvn:#fff7f7;
|
|
224
225
|
--color-background-status-info-mvnbre:#f2f8fd;
|
|
225
226
|
--color-background-status-success-jp14wa:#f2fcf3;
|
|
@@ -825,6 +826,7 @@
|
|
|
825
826
|
--color-background-slider-track-3m68rn:#5f6b7a;
|
|
826
827
|
--color-background-slider-handle-ring-31445h:#0f1b2a;
|
|
827
828
|
--color-background-slider-error-pressed-g7oqnt:#eb6f6f;
|
|
829
|
+
--color-background-slider-warning-pressed-9xuhwf:#e0ca57;
|
|
828
830
|
--color-background-status-error-pbprvn:#1a0000;
|
|
829
831
|
--color-background-status-info-mvnbre:#00142b;
|
|
830
832
|
--color-background-status-success-jp14wa:#001a02;
|
|
@@ -1117,6 +1119,7 @@
|
|
|
1117
1119
|
--color-background-slider-track-3m68rn:#5f6b7a;
|
|
1118
1120
|
--color-background-slider-handle-ring-31445h:#0f1b2a;
|
|
1119
1121
|
--color-background-slider-error-pressed-g7oqnt:#eb6f6f;
|
|
1122
|
+
--color-background-slider-warning-pressed-9xuhwf:#e0ca57;
|
|
1120
1123
|
--color-background-status-error-pbprvn:#1a0000;
|
|
1121
1124
|
--color-background-status-info-mvnbre:#00142b;
|
|
1122
1125
|
--color-background-status-success-jp14wa:#001a02;
|
|
@@ -1311,6 +1314,7 @@
|
|
|
1311
1314
|
--color-background-slider-track-3m68rn:#5f6b7a;
|
|
1312
1315
|
--color-background-slider-handle-ring-31445h:#0f1b2a;
|
|
1313
1316
|
--color-background-slider-error-pressed-g7oqnt:#eb6f6f;
|
|
1317
|
+
--color-background-slider-warning-pressed-9xuhwf:#e0ca57;
|
|
1314
1318
|
--color-background-status-error-pbprvn:#1a0000;
|
|
1315
1319
|
--color-background-status-info-mvnbre:#00142b;
|
|
1316
1320
|
--color-background-status-success-jp14wa:#001a02;
|
|
@@ -1603,6 +1607,7 @@
|
|
|
1603
1607
|
--color-background-slider-track-3m68rn:#5f6b7a;
|
|
1604
1608
|
--color-background-slider-handle-ring-31445h:#0f1b2a;
|
|
1605
1609
|
--color-background-slider-error-pressed-g7oqnt:#eb6f6f;
|
|
1610
|
+
--color-background-slider-warning-pressed-9xuhwf:#e0ca57;
|
|
1606
1611
|
--color-background-status-error-pbprvn:#1a0000;
|
|
1607
1612
|
--color-background-status-info-mvnbre:#00142b;
|
|
1608
1613
|
--color-background-status-success-jp14wa:#001a02;
|
package/internal/environment.js
CHANGED
|
@@ -281,6 +281,7 @@ export const colorBackgroundSliderHandleActive: string;
|
|
|
281
281
|
export const colorBackgroundSliderTrack: string;
|
|
282
282
|
export const colorBackgroundSliderHandleRing: string;
|
|
283
283
|
export const colorBackgroundSliderErrorPressed: string;
|
|
284
|
+
export const colorBackgroundSliderWarningPressed: string;
|
|
284
285
|
export const colorBackgroundStatusError: string;
|
|
285
286
|
export const colorBackgroundStatusInfo: string;
|
|
286
287
|
export const colorBackgroundStatusSuccess: string;
|
|
@@ -281,6 +281,7 @@ export var colorBackgroundSliderHandleActive = "var(--color-background-slider-ha
|
|
|
281
281
|
export var colorBackgroundSliderTrack = "var(--color-background-slider-track-3m68rn, #7d8998)";
|
|
282
282
|
export var colorBackgroundSliderHandleRing = "var(--color-background-slider-handle-ring-31445h, #ffffff)";
|
|
283
283
|
export var colorBackgroundSliderErrorPressed = "var(--color-background-slider-error-pressed-g7oqnt, #7c2718)";
|
|
284
|
+
export var colorBackgroundSliderWarningPressed = "var(--color-background-slider-warning-pressed-9xuhwf, #8d6605)";
|
|
284
285
|
export var colorBackgroundStatusError = "var(--color-background-status-error-pbprvn, #fff7f7)";
|
|
285
286
|
export var colorBackgroundStatusInfo = "var(--color-background-status-info-mvnbre, #f2f8fd)";
|
|
286
287
|
export var colorBackgroundStatusSuccess = "var(--color-background-status-success-jp14wa, #f2fcf3)";
|
|
@@ -1009,6 +1009,10 @@ module.exports.preset = {
|
|
|
1009
1009
|
"light": "{colorRed700}",
|
|
1010
1010
|
"dark": "{colorRed500}"
|
|
1011
1011
|
},
|
|
1012
|
+
"colorBackgroundSliderWarningPressed": {
|
|
1013
|
+
"light": "{colorYellow800}",
|
|
1014
|
+
"dark": "{colorYellow700}"
|
|
1015
|
+
},
|
|
1012
1016
|
"colorBackgroundStatusError": {
|
|
1013
1017
|
"light": "{colorRed100}",
|
|
1014
1018
|
"dark": "{colorRed900}"
|
|
@@ -3115,6 +3119,10 @@ module.exports.preset = {
|
|
|
3115
3119
|
"light": "{colorRed500}",
|
|
3116
3120
|
"dark": "{colorRed500}"
|
|
3117
3121
|
},
|
|
3122
|
+
"colorBackgroundSliderWarningPressed": {
|
|
3123
|
+
"light": "{colorYellow700}",
|
|
3124
|
+
"dark": "{colorYellow700}"
|
|
3125
|
+
},
|
|
3118
3126
|
"colorBackgroundStatusError": {
|
|
3119
3127
|
"light": "{colorRed900}",
|
|
3120
3128
|
"dark": "{colorRed900}"
|
|
@@ -4161,6 +4169,10 @@ module.exports.preset = {
|
|
|
4161
4169
|
"light": "{colorRed500}",
|
|
4162
4170
|
"dark": "{colorRed500}"
|
|
4163
4171
|
},
|
|
4172
|
+
"colorBackgroundSliderWarningPressed": {
|
|
4173
|
+
"light": "{colorYellow700}",
|
|
4174
|
+
"dark": "{colorYellow700}"
|
|
4175
|
+
},
|
|
4164
4176
|
"colorBackgroundStatusError": {
|
|
4165
4177
|
"light": "{colorRed900}",
|
|
4166
4178
|
"dark": "{colorRed900}"
|
|
@@ -5139,6 +5151,10 @@ module.exports.preset = {
|
|
|
5139
5151
|
"light": "{colorRed700}",
|
|
5140
5152
|
"dark": "{colorRed500}"
|
|
5141
5153
|
},
|
|
5154
|
+
"colorBackgroundSliderWarningPressed": {
|
|
5155
|
+
"light": "{colorYellow800}",
|
|
5156
|
+
"dark": "{colorYellow700}"
|
|
5157
|
+
},
|
|
5142
5158
|
"colorBackgroundStatusError": {
|
|
5143
5159
|
"light": "{colorRed100}",
|
|
5144
5160
|
"dark": "{colorRed900}"
|
|
@@ -6117,6 +6133,10 @@ module.exports.preset = {
|
|
|
6117
6133
|
"light": "{colorRed700}",
|
|
6118
6134
|
"dark": "{colorRed500}"
|
|
6119
6135
|
},
|
|
6136
|
+
"colorBackgroundSliderWarningPressed": {
|
|
6137
|
+
"light": "{colorYellow800}",
|
|
6138
|
+
"dark": "{colorYellow700}"
|
|
6139
|
+
},
|
|
6120
6140
|
"colorBackgroundStatusError": {
|
|
6121
6141
|
"light": "{colorRed100}",
|
|
6122
6142
|
"dark": "{colorRed900}"
|
|
@@ -7095,6 +7115,10 @@ module.exports.preset = {
|
|
|
7095
7115
|
"light": "{colorRed700}",
|
|
7096
7116
|
"dark": "{colorRed500}"
|
|
7097
7117
|
},
|
|
7118
|
+
"colorBackgroundSliderWarningPressed": {
|
|
7119
|
+
"light": "{colorYellow800}",
|
|
7120
|
+
"dark": "{colorYellow700}"
|
|
7121
|
+
},
|
|
7098
7122
|
"colorBackgroundStatusError": {
|
|
7099
7123
|
"light": "{colorRed100}",
|
|
7100
7124
|
"dark": "{colorRed900}"
|
|
@@ -8075,6 +8099,10 @@ module.exports.preset = {
|
|
|
8075
8099
|
"light": "{colorRed500}",
|
|
8076
8100
|
"dark": "{colorRed500}"
|
|
8077
8101
|
},
|
|
8102
|
+
"colorBackgroundSliderWarningPressed": {
|
|
8103
|
+
"light": "{colorYellow700}",
|
|
8104
|
+
"dark": "{colorYellow700}"
|
|
8105
|
+
},
|
|
8078
8106
|
"colorBackgroundStatusError": {
|
|
8079
8107
|
"light": "{colorRed900}",
|
|
8080
8108
|
"dark": "{colorRed900}"
|
|
@@ -8980,6 +9008,7 @@ module.exports.preset = {
|
|
|
8980
9008
|
"colorBackgroundSliderTrack": "color",
|
|
8981
9009
|
"colorBackgroundSliderHandleRing": "color",
|
|
8982
9010
|
"colorBackgroundSliderErrorPressed": "color",
|
|
9011
|
+
"colorBackgroundSliderWarningPressed": "color",
|
|
8983
9012
|
"colorBackgroundStatusError": "color",
|
|
8984
9013
|
"colorBackgroundStatusInfo": "color",
|
|
8985
9014
|
"colorBackgroundStatusSuccess": "color",
|
|
@@ -10164,6 +10193,7 @@ module.exports.preset = {
|
|
|
10164
10193
|
"colorBackgroundSliderTrack": "color-background-slider-track",
|
|
10165
10194
|
"colorBackgroundSliderHandleRing": "color-background-slider-handle-ring",
|
|
10166
10195
|
"colorBackgroundSliderErrorPressed": "color-background-slider-error-pressed",
|
|
10196
|
+
"colorBackgroundSliderWarningPressed": "color-background-slider-warning-pressed",
|
|
10167
10197
|
"colorBackgroundStatusError": "color-background-status-error",
|
|
10168
10198
|
"colorBackgroundStatusInfo": "color-background-status-info",
|
|
10169
10199
|
"colorBackgroundStatusSuccess": "color-background-status-success",
|
|
@@ -10864,6 +10894,7 @@ module.exports.preset = {
|
|
|
10864
10894
|
"colorBackgroundSliderTrack": "--color-background-slider-track-3m68rn",
|
|
10865
10895
|
"colorBackgroundSliderHandleRing": "--color-background-slider-handle-ring-31445h",
|
|
10866
10896
|
"colorBackgroundSliderErrorPressed": "--color-background-slider-error-pressed-g7oqnt",
|
|
10897
|
+
"colorBackgroundSliderWarningPressed": "--color-background-slider-warning-pressed-9xuhwf",
|
|
10867
10898
|
"colorBackgroundStatusError": "--color-background-status-error-pbprvn",
|
|
10868
10899
|
"colorBackgroundStatusInfo": "--color-background-status-info-mvnbre",
|
|
10869
10900
|
"colorBackgroundStatusSuccess": "--color-background-status-success-jp14wa",
|
|
@@ -1009,6 +1009,10 @@ export var preset = {
|
|
|
1009
1009
|
"light": "{colorRed700}",
|
|
1010
1010
|
"dark": "{colorRed500}"
|
|
1011
1011
|
},
|
|
1012
|
+
"colorBackgroundSliderWarningPressed": {
|
|
1013
|
+
"light": "{colorYellow800}",
|
|
1014
|
+
"dark": "{colorYellow700}"
|
|
1015
|
+
},
|
|
1012
1016
|
"colorBackgroundStatusError": {
|
|
1013
1017
|
"light": "{colorRed100}",
|
|
1014
1018
|
"dark": "{colorRed900}"
|
|
@@ -3115,6 +3119,10 @@ export var preset = {
|
|
|
3115
3119
|
"light": "{colorRed500}",
|
|
3116
3120
|
"dark": "{colorRed500}"
|
|
3117
3121
|
},
|
|
3122
|
+
"colorBackgroundSliderWarningPressed": {
|
|
3123
|
+
"light": "{colorYellow700}",
|
|
3124
|
+
"dark": "{colorYellow700}"
|
|
3125
|
+
},
|
|
3118
3126
|
"colorBackgroundStatusError": {
|
|
3119
3127
|
"light": "{colorRed900}",
|
|
3120
3128
|
"dark": "{colorRed900}"
|
|
@@ -4161,6 +4169,10 @@ export var preset = {
|
|
|
4161
4169
|
"light": "{colorRed500}",
|
|
4162
4170
|
"dark": "{colorRed500}"
|
|
4163
4171
|
},
|
|
4172
|
+
"colorBackgroundSliderWarningPressed": {
|
|
4173
|
+
"light": "{colorYellow700}",
|
|
4174
|
+
"dark": "{colorYellow700}"
|
|
4175
|
+
},
|
|
4164
4176
|
"colorBackgroundStatusError": {
|
|
4165
4177
|
"light": "{colorRed900}",
|
|
4166
4178
|
"dark": "{colorRed900}"
|
|
@@ -5139,6 +5151,10 @@ export var preset = {
|
|
|
5139
5151
|
"light": "{colorRed700}",
|
|
5140
5152
|
"dark": "{colorRed500}"
|
|
5141
5153
|
},
|
|
5154
|
+
"colorBackgroundSliderWarningPressed": {
|
|
5155
|
+
"light": "{colorYellow800}",
|
|
5156
|
+
"dark": "{colorYellow700}"
|
|
5157
|
+
},
|
|
5142
5158
|
"colorBackgroundStatusError": {
|
|
5143
5159
|
"light": "{colorRed100}",
|
|
5144
5160
|
"dark": "{colorRed900}"
|
|
@@ -6117,6 +6133,10 @@ export var preset = {
|
|
|
6117
6133
|
"light": "{colorRed700}",
|
|
6118
6134
|
"dark": "{colorRed500}"
|
|
6119
6135
|
},
|
|
6136
|
+
"colorBackgroundSliderWarningPressed": {
|
|
6137
|
+
"light": "{colorYellow800}",
|
|
6138
|
+
"dark": "{colorYellow700}"
|
|
6139
|
+
},
|
|
6120
6140
|
"colorBackgroundStatusError": {
|
|
6121
6141
|
"light": "{colorRed100}",
|
|
6122
6142
|
"dark": "{colorRed900}"
|
|
@@ -7095,6 +7115,10 @@ export var preset = {
|
|
|
7095
7115
|
"light": "{colorRed700}",
|
|
7096
7116
|
"dark": "{colorRed500}"
|
|
7097
7117
|
},
|
|
7118
|
+
"colorBackgroundSliderWarningPressed": {
|
|
7119
|
+
"light": "{colorYellow800}",
|
|
7120
|
+
"dark": "{colorYellow700}"
|
|
7121
|
+
},
|
|
7098
7122
|
"colorBackgroundStatusError": {
|
|
7099
7123
|
"light": "{colorRed100}",
|
|
7100
7124
|
"dark": "{colorRed900}"
|
|
@@ -8075,6 +8099,10 @@ export var preset = {
|
|
|
8075
8099
|
"light": "{colorRed500}",
|
|
8076
8100
|
"dark": "{colorRed500}"
|
|
8077
8101
|
},
|
|
8102
|
+
"colorBackgroundSliderWarningPressed": {
|
|
8103
|
+
"light": "{colorYellow700}",
|
|
8104
|
+
"dark": "{colorYellow700}"
|
|
8105
|
+
},
|
|
8078
8106
|
"colorBackgroundStatusError": {
|
|
8079
8107
|
"light": "{colorRed900}",
|
|
8080
8108
|
"dark": "{colorRed900}"
|
|
@@ -8980,6 +9008,7 @@ export var preset = {
|
|
|
8980
9008
|
"colorBackgroundSliderTrack": "color",
|
|
8981
9009
|
"colorBackgroundSliderHandleRing": "color",
|
|
8982
9010
|
"colorBackgroundSliderErrorPressed": "color",
|
|
9011
|
+
"colorBackgroundSliderWarningPressed": "color",
|
|
8983
9012
|
"colorBackgroundStatusError": "color",
|
|
8984
9013
|
"colorBackgroundStatusInfo": "color",
|
|
8985
9014
|
"colorBackgroundStatusSuccess": "color",
|
|
@@ -10164,6 +10193,7 @@ export var preset = {
|
|
|
10164
10193
|
"colorBackgroundSliderTrack": "color-background-slider-track",
|
|
10165
10194
|
"colorBackgroundSliderHandleRing": "color-background-slider-handle-ring",
|
|
10166
10195
|
"colorBackgroundSliderErrorPressed": "color-background-slider-error-pressed",
|
|
10196
|
+
"colorBackgroundSliderWarningPressed": "color-background-slider-warning-pressed",
|
|
10167
10197
|
"colorBackgroundStatusError": "color-background-status-error",
|
|
10168
10198
|
"colorBackgroundStatusInfo": "color-background-status-info",
|
|
10169
10199
|
"colorBackgroundStatusSuccess": "color-background-status-success",
|
|
@@ -10864,6 +10894,7 @@ export var preset = {
|
|
|
10864
10894
|
"colorBackgroundSliderTrack": "--color-background-slider-track-3m68rn",
|
|
10865
10895
|
"colorBackgroundSliderHandleRing": "--color-background-slider-handle-ring-31445h",
|
|
10866
10896
|
"colorBackgroundSliderErrorPressed": "--color-background-slider-error-pressed-g7oqnt",
|
|
10897
|
+
"colorBackgroundSliderWarningPressed": "--color-background-slider-warning-pressed-9xuhwf",
|
|
10867
10898
|
"colorBackgroundStatusError": "--color-background-status-error-pbprvn",
|
|
10868
10899
|
"colorBackgroundStatusInfo": "--color-background-status-info-mvnbre",
|
|
10869
10900
|
"colorBackgroundStatusSuccess": "--color-background-status-success-jp14wa",
|
package/internal/manifest.json
CHANGED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare function createWidgetizedComponent<Props, Component extends React.ComponentType<Props>>(Implementation: Component): (Loader?: Component) => Component;
|
|
3
|
+
export declare function createWidgetizedForwardRef<Props, RefType, Component extends React.ForwardRefExoticComponent<Props & React.RefAttributes<RefType>>>(Implementation: Component): (Loader?: Component) => Component;
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/internal/widgets/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,SAAS,SAAS,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,EAC3F,cAAc,EAAE,SAAS,aAER,SAAS,KAAG,SAAS,CAUvC;AAED,wBAAgB,0BAA0B,CACxC,KAAK,EACL,OAAO,EACP,SAAS,SAAS,KAAK,CAAC,yBAAyB,CAAC,KAAK,GAAG,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,EACvF,cAAc,EAAE,SAAS,aACR,SAAS,KAAG,SAAS,CAUvC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { getGlobalFlag } from '../utils/global-flags';
|
|
5
|
+
import { useVisualRefresh } from '../hooks/use-visual-mode';
|
|
6
|
+
export function createWidgetizedComponent(Implementation) {
|
|
7
|
+
return (Loader) => {
|
|
8
|
+
return (props => {
|
|
9
|
+
const isRefresh = useVisualRefresh();
|
|
10
|
+
if (isRefresh && getGlobalFlag('appLayoutWidget') && Loader) {
|
|
11
|
+
return React.createElement(Loader, Object.assign({}, props));
|
|
12
|
+
}
|
|
13
|
+
return React.createElement(Implementation, Object.assign({}, props));
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export function createWidgetizedForwardRef(Implementation) {
|
|
18
|
+
return (Loader) => {
|
|
19
|
+
return React.forwardRef((props, ref) => {
|
|
20
|
+
const isRefresh = useVisualRefresh();
|
|
21
|
+
if (isRefresh && getGlobalFlag('appLayoutWidget') && Loader) {
|
|
22
|
+
return React.createElement(Loader, Object.assign({ ref: ref }, props));
|
|
23
|
+
}
|
|
24
|
+
return React.createElement(Implementation, Object.assign({ ref: ref }, props));
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/internal/widgets/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,MAAM,UAAU,yBAAyB,CACvC,cAAyB;IAEzB,OAAO,CAAC,MAAkB,EAAa,EAAE;QACvC,OAAO,CAAC,KAAK,CAAC,EAAE;YACd,MAAM,SAAS,GAAG,gBAAgB,EAAE,CAAC;YACrC,IAAI,SAAS,IAAI,aAAa,CAAC,iBAAiB,CAAC,IAAI,MAAM,EAAE;gBAC3D,OAAO,oBAAC,MAAM,oBAAM,KAAa,EAAI,CAAC;aACvC;YAED,OAAO,oBAAC,cAAc,oBAAM,KAAa,EAAI,CAAC;QAChD,CAAC,CAAc,CAAC;IAClB,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,0BAA0B,CAIxC,cAAyB;IACzB,OAAO,CAAC,MAAkB,EAAa,EAAE;QACvC,OAAO,KAAK,CAAC,UAAU,CAAiB,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;YACrD,MAAM,SAAS,GAAG,gBAAgB,EAAE,CAAC;YACrC,IAAI,SAAS,IAAI,aAAa,CAAC,iBAAiB,CAAC,IAAI,MAAM,EAAE;gBAC3D,OAAO,oBAAC,MAAM,kBAAC,GAAG,EAAE,GAAG,IAAO,KAAa,EAAI,CAAC;aACjD;YAED,OAAO,oBAAC,cAAc,kBAAC,GAAG,EAAE,GAAG,IAAO,KAAa,EAAI,CAAC;QAC1D,CAAC,CAAc,CAAC;IAClB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { getGlobalFlag } from '../utils/global-flags';\nimport { useVisualRefresh } from '../hooks/use-visual-mode';\n\nexport function createWidgetizedComponent<Props, Component extends React.ComponentType<Props>>(\n Implementation: Component\n) {\n return (Loader?: Component): Component => {\n return (props => {\n const isRefresh = useVisualRefresh();\n if (isRefresh && getGlobalFlag('appLayoutWidget') && Loader) {\n return <Loader {...(props as any)} />;\n }\n\n return <Implementation {...(props as any)} />;\n }) as Component;\n };\n}\n\nexport function createWidgetizedForwardRef<\n Props,\n RefType,\n Component extends React.ForwardRefExoticComponent<Props & React.RefAttributes<RefType>>,\n>(Implementation: Component) {\n return (Loader?: Component): Component => {\n return React.forwardRef<RefType, Props>((props, ref) => {\n const isRefresh = useVisualRefresh();\n if (isRefresh && getGlobalFlag('appLayoutWidget') && Loader) {\n return <Loader ref={ref} {...(props as any)} />;\n }\n\n return <Implementation ref={ref} {...(props as any)} />;\n }) as Component;\n };\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
import React, { useReducer, useRef } from 'react';
|
|
4
|
-
import
|
|
4
|
+
import { BreadcrumbGroupImplementation } from '../../breadcrumb-group/implementation';
|
|
5
5
|
import { InternalButton } from '../../button/internal';
|
|
6
6
|
import InternalModal from '../../modal/internal';
|
|
7
7
|
import InternalSpaceBetween from '../../space-between/internal';
|
|
@@ -67,7 +67,7 @@ export function S3Modal({ i18nStrings, alert, selectableItemsTypes, fetchBuckets
|
|
|
67
67
|
React.createElement(InternalButton, { variant: "link", formAction: "none", onClick: onDismiss }, i18n('i18nStrings.modalCancelButton', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.modalCancelButton)),
|
|
68
68
|
React.createElement(InternalButton, { variant: "primary", className: styles['submit-button'], disabled: !selectedItem, formAction: "none", onClick: () => onSubmit(createResourceInfo({ currentView, breadcrumbs, selectedItem })) }, i18n('i18nStrings.modalSubmitButton', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.modalSubmitButton))) },
|
|
69
69
|
React.createElement(InternalSpaceBetween, { size: isVisualRefresh ? 'xxs' : 'xs' },
|
|
70
|
-
React.createElement(
|
|
70
|
+
React.createElement(BreadcrumbGroupImplementation, { ariaLabel: i18n('i18nStrings.labelBreadcrumbs', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.labelBreadcrumbs), expandAriaLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.labelExpandBreadcrumbs, onFollow: event => {
|
|
71
71
|
event.preventDefault();
|
|
72
72
|
event.detail.item.meta.onClick();
|
|
73
73
|
}, items: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/s3-resource-selector/s3-modal/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,uBAAuB,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,aAAa,MAAM,sBAAsB,CAAC;AACjD,OAAO,oBAAoB,MAAM,8BAA8B,CAAC;AAEhE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAExE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,C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AAC;yBACzC,CAAC,CAAC;oBACL,CAAC,EACD,QAAQ,EAAE,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,GACzD,CACH,CAAC,CAAC,CAAC,WAAW,KAAK,UAAU,CAAC,CAAC,CAAC,CAC/B,oBAAC,aAAa,IACZ,eAAe,EAAE,eAAe,EAChC,YAAY,EAAE,WAAW,EACzB,SAAS,EAAE,aAAa,EACxB,cAAc,EAAE,sBAAsB,EACtC,cAAc,EAAE,sBAAsB,EACtC,WAAW,EAAE,WAAW,EACxB,eAAe,EAAE,eAAe,EAChC,QAAQ,EAAE,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,GACzD,CACH,CAAC,CAAC,CAAC,CACF,WAAW,CAAC,WAAW,CAAC,CACzB,CACoB,CACT,CACZ,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useReducer, useRef } from 'react';\nimport InternalBreadcrumbGroup from '../../breadcrumb-group/internal';\nimport { InternalButton } from '../../button/internal';\nimport InternalModal from '../../modal/internal';\nimport InternalSpaceBetween from '../../space-between/internal';\nimport { ForwardFocusRef } from '../../internal/hooks/forward-focus';\nimport { useEffectOnUpdate } from '../../internal/hooks/use-effect-on-update';\nimport { useVisualRefresh } from '../../internal/hooks/use-visual-mode';\nimport { S3ResourceSelectorProps } from '../interfaces';\nimport { BucketsTable } from './buckets-table';\nimport { ObjectsTable } from './objects-table';\nimport { VersionsTable } from './versions-table';\nimport styles from './styles.css.js';\nimport { joinObjectPath } from '../utils';\nimport { useInternalI18n } from '../../i18n/context';\n\nexport interface S3ModalProps {\n alert: React.ReactNode;\n selectableItemsTypes: S3ResourceSelectorProps['selectableItemsTypes'];\n fetchBuckets: S3ResourceSelectorProps['fetchBuckets'];\n bucketsVisibleColumns: ReadonlyArray<string>;\n bucketsIsItemDisabled: S3ResourceSelectorProps['bucketsIsItemDisabled'];\n fetchObjects: S3ResourceSelectorProps['fetchObjects'];\n objectsVisibleColumns: ReadonlyArray<string>;\n objectsIsItemDisabled: S3ResourceSelectorProps['objectsIsItemDisabled'];\n fetchVersions: S3ResourceSelectorProps['fetchVersions'];\n versionsVisibleColumns: ReadonlyArray<string>;\n versionsIsItemDisabled: S3ResourceSelectorProps['versionsIsItemDisabled'];\n i18nStrings: S3ResourceSelectorProps.I18nStrings | undefined;\n getModalRoot: S3ResourceSelectorProps['getModalRoot'];\n removeModalRoot: S3ResourceSelectorProps['removeModalRoot'];\n onDismiss: () => void;\n onSubmit: (resource: S3ResourceSelectorProps.Resource) => void;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction assertNever(_value: never) {\n return null;\n}\n\ninterface S3BrowseState {\n selectedItem: string | null;\n currentView: 'buckets' | 'objects' | 'versions';\n breadcrumbs: ReadonlyArray<string>;\n}\n\ntype S3BrowseActions =\n | { type: 'browse-buckets' }\n | { type: 'browse-objects' | 'browse-versions'; breadcrumbs: S3BrowseState['breadcrumbs'] }\n | { type: 'select-item'; item: string };\n\nconst initialBrowseState: S3BrowseState = {\n selectedItem: null,\n currentView: 'buckets',\n breadcrumbs: [],\n};\n\nfunction s3BrowseReducer(state: S3BrowseState, action: S3BrowseActions) {\n switch (action.type) {\n case 'browse-buckets':\n return initialBrowseState;\n case 'browse-objects':\n return {\n selectedItem: null,\n currentView: 'objects' as const,\n breadcrumbs: action.breadcrumbs,\n };\n case 'browse-versions':\n return {\n selectedItem: null,\n currentView: 'versions' as const,\n breadcrumbs: action.breadcrumbs,\n };\n case 'select-item':\n return {\n ...state,\n selectedItem: action.item,\n };\n default:\n assertNever(action);\n }\n return state;\n}\n\nfunction createResourceInfo({ currentView, breadcrumbs, selectedItem }: S3BrowseState) {\n const prefix = 's3://';\n if (currentView === 'versions') {\n return { uri: prefix + joinObjectPath(breadcrumbs), versionId: selectedItem ?? undefined };\n }\n return { uri: prefix + joinObjectPath([...breadcrumbs, selectedItem!]) };\n}\n\nexport function S3Modal({\n i18nStrings,\n alert,\n selectableItemsTypes,\n fetchBuckets,\n bucketsVisibleColumns,\n bucketsIsItemDisabled,\n fetchObjects,\n objectsVisibleColumns,\n objectsIsItemDisabled,\n fetchVersions,\n versionsVisibleColumns,\n versionsIsItemDisabled,\n getModalRoot,\n removeModalRoot,\n onSubmit,\n onDismiss,\n}: S3ModalProps) {\n const [{ currentView, breadcrumbs, selectedItem }, dispatch] = useReducer(s3BrowseReducer, initialBrowseState);\n const forwardFocusRef = useRef<ForwardFocusRef>(null);\n const i18n = useInternalI18n('s3-resource-selector');\n\n const isVisualRefresh = useVisualRefresh();\n\n useEffectOnUpdate(() => {\n forwardFocusRef.current?.focus();\n }, [breadcrumbs]);\n\n return (\n <div>\n <InternalModal\n visible={true}\n size=\"max\"\n getModalRoot={getModalRoot}\n removeModalRoot={removeModalRoot}\n closeAriaLabel={i18nStrings?.labelModalDismiss}\n onDismiss={onDismiss}\n header={i18n('i18nStrings.modalTitle', i18nStrings?.modalTitle)}\n footer={\n <InternalSpaceBetween className={styles['modal-actions']} size=\"xs\" direction=\"horizontal\">\n <InternalButton variant=\"link\" formAction=\"none\" onClick={onDismiss}>\n {i18n('i18nStrings.modalCancelButton', i18nStrings?.modalCancelButton)}\n </InternalButton>\n <InternalButton\n variant=\"primary\"\n className={styles['submit-button']}\n disabled={!selectedItem}\n formAction=\"none\"\n onClick={() => onSubmit(createResourceInfo({ currentView, breadcrumbs, selectedItem }))}\n >\n {i18n('i18nStrings.modalSubmitButton', i18nStrings?.modalSubmitButton)}\n </InternalButton>\n </InternalSpaceBetween>\n }\n >\n <InternalSpaceBetween size={isVisualRefresh ? 'xxs' : 'xs'}>\n <InternalBreadcrumbGroup\n ariaLabel={i18n('i18nStrings.labelBreadcrumbs', i18nStrings?.labelBreadcrumbs)}\n expandAriaLabel={i18nStrings?.labelExpandBreadcrumbs}\n onFollow={event => {\n event.preventDefault();\n event.detail.item.meta.onClick();\n }}\n items={[\n {\n text: i18n('i18nStrings.modalBreadcrumbRootItem', i18nStrings?.modalBreadcrumbRootItem) ?? '',\n href: '',\n meta: { onClick: () => dispatch({ type: 'browse-buckets' }) },\n },\n ...breadcrumbs.map((segment, index) => ({\n text: segment,\n href: '',\n meta: {\n onClick: () =>\n dispatch({\n type: 'browse-objects',\n breadcrumbs: breadcrumbs.slice(0, index + 1),\n }),\n },\n })),\n ]}\n />\n {alert}\n {currentView === 'buckets' ? (\n <BucketsTable\n forwardFocusRef={forwardFocusRef}\n fetchData={fetchBuckets}\n visibleColumns={bucketsVisibleColumns}\n isItemDisabled={bucketsIsItemDisabled}\n selectableItemsTypes={selectableItemsTypes}\n i18nStrings={i18nStrings}\n isVisualRefresh={isVisualRefresh}\n onDrilldown={path =>\n dispatch({\n type: 'browse-objects',\n breadcrumbs: [path],\n })\n }\n onSelect={item => dispatch({ type: 'select-item', item })}\n />\n ) : currentView === 'objects' ? (\n <ObjectsTable\n forwardFocusRef={forwardFocusRef}\n pathSegments={breadcrumbs}\n fetchData={fetchObjects}\n visibleColumns={objectsVisibleColumns}\n isItemDisabled={objectsIsItemDisabled}\n selectableItemsTypes={selectableItemsTypes}\n i18nStrings={i18nStrings}\n isVisualRefresh={isVisualRefresh}\n onDrilldown={item => {\n dispatch({\n type: item.IsFolder ? 'browse-objects' : 'browse-versions',\n breadcrumbs: [...breadcrumbs, item.Key!],\n });\n }}\n onSelect={item => dispatch({ type: 'select-item', item })}\n />\n ) : currentView === 'versions' ? (\n <VersionsTable\n forwardFocusRef={forwardFocusRef}\n pathSegments={breadcrumbs}\n fetchData={fetchVersions}\n visibleColumns={versionsVisibleColumns}\n isItemDisabled={versionsIsItemDisabled}\n i18nStrings={i18nStrings}\n isVisualRefresh={isVisualRefresh}\n onSelect={item => dispatch({ type: 'select-item', item })}\n />\n ) : (\n assertNever(currentView)\n )}\n </InternalSpaceBetween>\n </InternalModal>\n </div>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/s3-resource-selector/s3-modal/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,6BAA6B,EAAE,MAAM,uCAAuC,CAAC;AACtF,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,aAAa,MAAM,sBAAsB,CAAC;AACjD,OAAO,oBAAoB,MAAM,8BAA8B,CAAC;AAEhE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAExE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAqBrD,6DAA6D;AAC7D,SAAS,WAAW,CAAC,MAAa;IAChC,OAAO,IAAI,CAAC;AACd,CAAC;AAaD,MAAM,kBAAkB,GAAkB;IACxC,YAAY,EAAE,IAAI;IAClB,WAAW,EAAE,SAAS;IACtB,WAAW,EAAE,EAAE;CAChB,CAAC;AAEF,SAAS,eAAe,CAAC,KAAoB,EAAE,MAAuB;IACpE,QAAQ,MAAM,CAAC,IAAI,EAAE;QACnB,KAAK,gBAAgB;YACnB,OAAO,kBAAkB,CAAC;QAC5B,KAAK,gBAAgB;YACnB,OAAO;gBACL,YAAY,EAAE,IAAI;gBAClB,WAAW,EAAE,SAAkB;gBAC/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AE,aAAa,EAAE,IAAI,EAAE,CAAC,GACzD,CACH,CAAC,CAAC,CAAC,CACF,WAAW,CAAC,WAAW,CAAC,CACzB,CACoB,CACT,CACZ,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useReducer, useRef } from 'react';\nimport { BreadcrumbGroupImplementation } from '../../breadcrumb-group/implementation';\nimport { InternalButton } from '../../button/internal';\nimport InternalModal from '../../modal/internal';\nimport InternalSpaceBetween from '../../space-between/internal';\nimport { ForwardFocusRef } from '../../internal/hooks/forward-focus';\nimport { useEffectOnUpdate } from '../../internal/hooks/use-effect-on-update';\nimport { useVisualRefresh } from '../../internal/hooks/use-visual-mode';\nimport { S3ResourceSelectorProps } from '../interfaces';\nimport { BucketsTable } from './buckets-table';\nimport { ObjectsTable } from './objects-table';\nimport { VersionsTable } from './versions-table';\nimport styles from './styles.css.js';\nimport { joinObjectPath } from '../utils';\nimport { useInternalI18n } from '../../i18n/context';\n\nexport interface S3ModalProps {\n alert: React.ReactNode;\n selectableItemsTypes: S3ResourceSelectorProps['selectableItemsTypes'];\n fetchBuckets: S3ResourceSelectorProps['fetchBuckets'];\n bucketsVisibleColumns: ReadonlyArray<string>;\n bucketsIsItemDisabled: S3ResourceSelectorProps['bucketsIsItemDisabled'];\n fetchObjects: S3ResourceSelectorProps['fetchObjects'];\n objectsVisibleColumns: ReadonlyArray<string>;\n objectsIsItemDisabled: S3ResourceSelectorProps['objectsIsItemDisabled'];\n fetchVersions: S3ResourceSelectorProps['fetchVersions'];\n versionsVisibleColumns: ReadonlyArray<string>;\n versionsIsItemDisabled: S3ResourceSelectorProps['versionsIsItemDisabled'];\n i18nStrings: S3ResourceSelectorProps.I18nStrings | undefined;\n getModalRoot: S3ResourceSelectorProps['getModalRoot'];\n removeModalRoot: S3ResourceSelectorProps['removeModalRoot'];\n onDismiss: () => void;\n onSubmit: (resource: S3ResourceSelectorProps.Resource) => void;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction assertNever(_value: never) {\n return null;\n}\n\ninterface S3BrowseState {\n selectedItem: string | null;\n currentView: 'buckets' | 'objects' | 'versions';\n breadcrumbs: ReadonlyArray<string>;\n}\n\ntype S3BrowseActions =\n | { type: 'browse-buckets' }\n | { type: 'browse-objects' | 'browse-versions'; breadcrumbs: S3BrowseState['breadcrumbs'] }\n | { type: 'select-item'; item: string };\n\nconst initialBrowseState: S3BrowseState = {\n selectedItem: null,\n currentView: 'buckets',\n breadcrumbs: [],\n};\n\nfunction s3BrowseReducer(state: S3BrowseState, action: S3BrowseActions) {\n switch (action.type) {\n case 'browse-buckets':\n return initialBrowseState;\n case 'browse-objects':\n return {\n selectedItem: null,\n currentView: 'objects' as const,\n breadcrumbs: action.breadcrumbs,\n };\n case 'browse-versions':\n return {\n selectedItem: null,\n currentView: 'versions' as const,\n breadcrumbs: action.breadcrumbs,\n };\n case 'select-item':\n return {\n ...state,\n selectedItem: action.item,\n };\n default:\n assertNever(action);\n }\n return state;\n}\n\nfunction createResourceInfo({ currentView, breadcrumbs, selectedItem }: S3BrowseState) {\n const prefix = 's3://';\n if (currentView === 'versions') {\n return { uri: prefix + joinObjectPath(breadcrumbs), versionId: selectedItem ?? undefined };\n }\n return { uri: prefix + joinObjectPath([...breadcrumbs, selectedItem!]) };\n}\n\nexport function S3Modal({\n i18nStrings,\n alert,\n selectableItemsTypes,\n fetchBuckets,\n bucketsVisibleColumns,\n bucketsIsItemDisabled,\n fetchObjects,\n objectsVisibleColumns,\n objectsIsItemDisabled,\n fetchVersions,\n versionsVisibleColumns,\n versionsIsItemDisabled,\n getModalRoot,\n removeModalRoot,\n onSubmit,\n onDismiss,\n}: S3ModalProps) {\n const [{ currentView, breadcrumbs, selectedItem }, dispatch] = useReducer(s3BrowseReducer, initialBrowseState);\n const forwardFocusRef = useRef<ForwardFocusRef>(null);\n const i18n = useInternalI18n('s3-resource-selector');\n\n const isVisualRefresh = useVisualRefresh();\n\n useEffectOnUpdate(() => {\n forwardFocusRef.current?.focus();\n }, [breadcrumbs]);\n\n return (\n <div>\n <InternalModal\n visible={true}\n size=\"max\"\n getModalRoot={getModalRoot}\n removeModalRoot={removeModalRoot}\n closeAriaLabel={i18nStrings?.labelModalDismiss}\n onDismiss={onDismiss}\n header={i18n('i18nStrings.modalTitle', i18nStrings?.modalTitle)}\n footer={\n <InternalSpaceBetween className={styles['modal-actions']} size=\"xs\" direction=\"horizontal\">\n <InternalButton variant=\"link\" formAction=\"none\" onClick={onDismiss}>\n {i18n('i18nStrings.modalCancelButton', i18nStrings?.modalCancelButton)}\n </InternalButton>\n <InternalButton\n variant=\"primary\"\n className={styles['submit-button']}\n disabled={!selectedItem}\n formAction=\"none\"\n onClick={() => onSubmit(createResourceInfo({ currentView, breadcrumbs, selectedItem }))}\n >\n {i18n('i18nStrings.modalSubmitButton', i18nStrings?.modalSubmitButton)}\n </InternalButton>\n </InternalSpaceBetween>\n }\n >\n <InternalSpaceBetween size={isVisualRefresh ? 'xxs' : 'xs'}>\n <BreadcrumbGroupImplementation\n ariaLabel={i18n('i18nStrings.labelBreadcrumbs', i18nStrings?.labelBreadcrumbs)}\n expandAriaLabel={i18nStrings?.labelExpandBreadcrumbs}\n onFollow={event => {\n event.preventDefault();\n event.detail.item.meta.onClick();\n }}\n items={[\n {\n text: i18n('i18nStrings.modalBreadcrumbRootItem', i18nStrings?.modalBreadcrumbRootItem) ?? '',\n href: '',\n meta: { onClick: () => dispatch({ type: 'browse-buckets' }) },\n },\n ...breadcrumbs.map((segment, index) => ({\n text: segment,\n href: '',\n meta: {\n onClick: () =>\n dispatch({\n type: 'browse-objects',\n breadcrumbs: breadcrumbs.slice(0, index + 1),\n }),\n },\n })),\n ]}\n />\n {alert}\n {currentView === 'buckets' ? (\n <BucketsTable\n forwardFocusRef={forwardFocusRef}\n fetchData={fetchBuckets}\n visibleColumns={bucketsVisibleColumns}\n isItemDisabled={bucketsIsItemDisabled}\n selectableItemsTypes={selectableItemsTypes}\n i18nStrings={i18nStrings}\n isVisualRefresh={isVisualRefresh}\n onDrilldown={path =>\n dispatch({\n type: 'browse-objects',\n breadcrumbs: [path],\n })\n }\n onSelect={item => dispatch({ type: 'select-item', item })}\n />\n ) : currentView === 'objects' ? (\n <ObjectsTable\n forwardFocusRef={forwardFocusRef}\n pathSegments={breadcrumbs}\n fetchData={fetchObjects}\n visibleColumns={objectsVisibleColumns}\n isItemDisabled={objectsIsItemDisabled}\n selectableItemsTypes={selectableItemsTypes}\n i18nStrings={i18nStrings}\n isVisualRefresh={isVisualRefresh}\n onDrilldown={item => {\n dispatch({\n type: item.IsFolder ? 'browse-objects' : 'browse-versions',\n breadcrumbs: [...breadcrumbs, item.Key!],\n });\n }}\n onSelect={item => dispatch({ type: 'select-item', item })}\n />\n ) : currentView === 'versions' ? (\n <VersionsTable\n forwardFocusRef={forwardFocusRef}\n pathSegments={breadcrumbs}\n fetchData={fetchVersions}\n visibleColumns={versionsVisibleColumns}\n isItemDisabled={versionsIsItemDisabled}\n i18nStrings={i18nStrings}\n isVisualRefresh={isVisualRefresh}\n onSelect={item => dispatch({ type: 'select-item', item })}\n />\n ) : (\n assertNever(currentView)\n )}\n </InternalSpaceBetween>\n </InternalModal>\n </div>\n );\n}\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { SideNavigationProps } from './interfaces';
|
|
3
|
+
import { InternalBaseComponentProps } from '../internal/hooks/use-base-component';
|
|
4
|
+
export type SideNavigationInternalProps = SideNavigationProps & InternalBaseComponentProps;
|
|
5
|
+
export declare function SideNavigationImplementation({ header, activeHref, items, onFollow, onChange, __internalRootRef, ...props }: SideNavigationInternalProps): JSX.Element;
|
|
6
|
+
export declare const createWidgetizedSideNavigation: (Loader?: typeof SideNavigationImplementation | undefined) => typeof SideNavigationImplementation;
|
|
7
|
+
//# sourceMappingURL=implementation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"implementation.d.ts","sourceRoot":"","sources":["../../../src/side-navigation/implementation.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAMnD,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAElF,MAAM,MAAM,2BAA2B,GAAG,mBAAmB,GAAG,0BAA0B,CAAC;AAE3F,wBAAgB,4BAA4B,CAAC,EAC3C,MAAM,EACN,UAAU,EACV,KAAU,EACV,QAAQ,EACR,QAAQ,EACR,iBAAiB,EACjB,GAAG,KAAK,EACT,EAAE,2BAA2B,eAmD7B;AAED,eAAO,MAAM,8BAA8B,mGAGZ,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
import React, { useMemo, useCallback, useEffect } from 'react';
|
|
5
|
+
import clsx from 'clsx';
|
|
6
|
+
import { getBaseProps } from '../internal/base-component';
|
|
7
|
+
import { fireNonCancelableEvent, fireCancelableEvent } from '../internal/events';
|
|
8
|
+
import { Header, NavigationItemsList } from './parts';
|
|
9
|
+
import { generateExpandableItemsMapping, checkDuplicateHrefs } from './util';
|
|
10
|
+
import styles from './styles.css.js';
|
|
11
|
+
import { isDevelopment } from '../internal/is-development';
|
|
12
|
+
import { createWidgetizedComponent } from '../internal/widgets';
|
|
13
|
+
export function SideNavigationImplementation(_a) {
|
|
14
|
+
var { header, activeHref, items = [], onFollow, onChange, __internalRootRef } = _a, props = __rest(_a, ["header", "activeHref", "items", "onFollow", "onChange", "__internalRootRef"]);
|
|
15
|
+
const baseProps = getBaseProps(props);
|
|
16
|
+
const parentMap = useMemo(() => generateExpandableItemsMapping(items), [items]);
|
|
17
|
+
if (isDevelopment) {
|
|
18
|
+
// This code should be wiped in production anyway.
|
|
19
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
20
|
+
useEffect(() => checkDuplicateHrefs(items), [items]);
|
|
21
|
+
}
|
|
22
|
+
const onChangeHandler = useCallback((item, expanded) => {
|
|
23
|
+
// generateExpandableItemsMapping walks through the entire tree, so we're certain about getting a value.
|
|
24
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
25
|
+
fireNonCancelableEvent(onChange, { item, expanded: expanded, expandableParents: parentMap.get(item) });
|
|
26
|
+
}, [onChange, parentMap]);
|
|
27
|
+
const onFollowHandler = useCallback((item, sourceEvent) => {
|
|
28
|
+
fireCancelableEvent(onFollow, item, sourceEvent);
|
|
29
|
+
}, [onFollow]);
|
|
30
|
+
return (React.createElement("div", Object.assign({}, baseProps, { className: clsx(styles.root, baseProps.className), ref: __internalRootRef }),
|
|
31
|
+
header && (React.createElement(Header, { definition: header, activeHref: activeHref, fireChange: onChangeHandler, fireFollow: onFollowHandler })),
|
|
32
|
+
items && (React.createElement("div", { className: styles['list-container'] },
|
|
33
|
+
React.createElement(NavigationItemsList, { variant: "root", items: items, fireFollow: onFollowHandler, fireChange: onChangeHandler, activeHref: activeHref })))));
|
|
34
|
+
}
|
|
35
|
+
export const createWidgetizedSideNavigation = createWidgetizedComponent(SideNavigationImplementation);
|
|
36
|
+
//# sourceMappingURL=implementation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"implementation.js","sourceRoot":"","sources":["../../../src/side-navigation/implementation.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC/D,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEjF,OAAO,EAAE,M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C,CACX,CAAC;IAEF,OAAO,CACL,6CAAS,SAAS,IAAE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,iBAAiB;QAC1F,MAAM,IAAI,CACT,oBAAC,MAAM,IAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,UAAU,EAAE,eAAe,GAAI,CACjH;QACA,KAAK,IAAI,CACR,6BAAK,SAAS,EAAE,MAAM,CAAC,gBAAgB,CAAC;YACtC,oBAAC,mBAAmB,IAClB,OAAO,EAAC,MAAM,EACd,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,eAAe,EAC3B,UAAU,EAAE,eAAe,EAC3B,UAAU,EAAE,UAAU,GACtB,CACE,CACP,CACG,CACP,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,8BAA8B,GAAG,yBAAyB,CAGrE,4BAA4B,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useMemo, useCallback, useEffect } from 'react';\nimport clsx from 'clsx';\nimport { getBaseProps } from '../internal/base-component';\nimport { fireNonCancelableEvent, fireCancelableEvent } from '../internal/events';\nimport { SideNavigationProps } from './interfaces';\nimport { Header, NavigationItemsList } from './parts';\nimport { generateExpandableItemsMapping, checkDuplicateHrefs } from './util';\nimport styles from './styles.css.js';\nimport { isDevelopment } from '../internal/is-development';\nimport { createWidgetizedComponent } from '../internal/widgets';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\n\nexport type SideNavigationInternalProps = SideNavigationProps & InternalBaseComponentProps;\n\nexport function SideNavigationImplementation({\n header,\n activeHref,\n items = [],\n onFollow,\n onChange,\n __internalRootRef,\n ...props\n}: SideNavigationInternalProps) {\n const baseProps = getBaseProps(props);\n const parentMap = useMemo(() => generateExpandableItemsMapping(items), [items]);\n\n if (isDevelopment) {\n // This code should be wiped in production anyway.\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useEffect(() => checkDuplicateHrefs(items), [items]);\n }\n\n const onChangeHandler = useCallback(\n (item: SideNavigationProps.Section | SideNavigationProps.ExpandableLinkGroup, expanded: boolean) => {\n // generateExpandableItemsMapping walks through the entire tree, so we're certain about getting a value.\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n fireNonCancelableEvent(onChange, { item, expanded: expanded, expandableParents: parentMap.get(item)! });\n },\n [onChange, parentMap]\n );\n\n const onFollowHandler = useCallback(\n (\n item:\n | SideNavigationProps.Link\n | SideNavigationProps.Header\n | SideNavigationProps.LinkGroup\n | SideNavigationProps.ExpandableLinkGroup,\n sourceEvent: React.SyntheticEvent | Event\n ) => {\n fireCancelableEvent(onFollow, item, sourceEvent);\n },\n [onFollow]\n );\n\n return (\n <div {...baseProps} className={clsx(styles.root, baseProps.className)} ref={__internalRootRef}>\n {header && (\n <Header definition={header} activeHref={activeHref} fireChange={onChangeHandler} fireFollow={onFollowHandler} />\n )}\n {items && (\n <div className={styles['list-container']}>\n <NavigationItemsList\n variant=\"root\"\n items={items}\n fireFollow={onFollowHandler}\n fireChange={onChangeHandler}\n activeHref={activeHref}\n />\n </div>\n )}\n </div>\n );\n}\n\nexport const createWidgetizedSideNavigation = createWidgetizedComponent<\n SideNavigationInternalProps,\n typeof SideNavigationImplementation\n>(SideNavigationImplementation);\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { SideNavigationProps } from './interfaces';
|
|
3
3
|
export { SideNavigationProps };
|
|
4
|
-
export default function SideNavigation({
|
|
4
|
+
export default function SideNavigation({ items, ...props }: SideNavigationProps): JSX.Element;
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/side-navigation/index.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/side-navigation/index.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAKnD,OAAO,EAAE,mBAAmB,EAAE,CAAC;AAE/B,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EAAE,KAAU,EAAE,GAAG,KAAK,EAAE,EAAE,mBAAmB,eAGnF"}
|
package/side-navigation/index.js
CHANGED
|
@@ -1,38 +1,14 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
import React
|
|
5
|
-
import clsx from 'clsx';
|
|
6
|
-
import { getBaseProps } from '../internal/base-component';
|
|
7
|
-
import { fireNonCancelableEvent, fireCancelableEvent } from '../internal/events';
|
|
8
|
-
import { Header, NavigationItemsList } from './internal';
|
|
9
|
-
import { generateExpandableItemsMapping, checkDuplicateHrefs } from './util';
|
|
10
|
-
import styles from './styles.css.js';
|
|
11
|
-
import { isDevelopment } from '../internal/is-development';
|
|
4
|
+
import React from 'react';
|
|
12
5
|
import { applyDisplayName } from '../internal/utils/apply-display-name';
|
|
13
6
|
import useBaseComponent from '../internal/hooks/use-base-component';
|
|
7
|
+
import { InternalSideNavigation } from './internal';
|
|
14
8
|
export default function SideNavigation(_a) {
|
|
15
|
-
var {
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
const parentMap = useMemo(() => generateExpandableItemsMapping(items), [items]);
|
|
19
|
-
if (isDevelopment) {
|
|
20
|
-
// This code should be wiped in production anyway.
|
|
21
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
22
|
-
useEffect(() => checkDuplicateHrefs(items), [items]);
|
|
23
|
-
}
|
|
24
|
-
const onChangeHandler = useCallback((item, expanded) => {
|
|
25
|
-
// generateExpandableItemsMapping walks through the entire tree, so we're certain about getting a value.
|
|
26
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
27
|
-
fireNonCancelableEvent(onChange, { item, expanded: expanded, expandableParents: parentMap.get(item) });
|
|
28
|
-
}, [onChange, parentMap]);
|
|
29
|
-
const onFollowHandler = useCallback((item, sourceEvent) => {
|
|
30
|
-
fireCancelableEvent(onFollow, item, sourceEvent);
|
|
31
|
-
}, [onFollow]);
|
|
32
|
-
return (React.createElement("div", Object.assign({}, baseProps, { className: clsx(styles.root, baseProps.className), ref: __internalRootRef }),
|
|
33
|
-
header && (React.createElement(Header, { definition: header, activeHref: activeHref, fireChange: onChangeHandler, fireFollow: onFollowHandler })),
|
|
34
|
-
items && (React.createElement("div", { className: styles['list-container'] },
|
|
35
|
-
React.createElement(NavigationItemsList, { variant: "root", items: items, fireFollow: onFollowHandler, fireChange: onChangeHandler, activeHref: activeHref })))));
|
|
9
|
+
var { items = [] } = _a, props = __rest(_a, ["items"]);
|
|
10
|
+
const internalProps = useBaseComponent('SideNavigation');
|
|
11
|
+
return React.createElement(InternalSideNavigation, Object.assign({}, props, internalProps, { items: items }));
|
|
36
12
|
}
|
|
37
13
|
applyDisplayName(SideNavigation, 'SideNavigation');
|
|
38
14
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/side-navigation/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/side-navigation/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAIpD,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EAA6C;QAA7C,EAAE,KAAK,GAAG,EAAE,OAAiC,EAA5B,KAAK,cAAtB,SAAwB,CAAF;IAC3D,MAAM,aAAa,GAAG,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;IACzD,OAAO,oBAAC,sBAAsB,oBAAK,KAAK,EAAM,aAAa,IAAE,KAAK,EAAE,KAAK,IAAI,CAAC;AAChF,CAAC;AAED,gBAAgB,CAAC,cAAc,EAAE,gBAAgB,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { SideNavigationProps } from './interfaces';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { InternalSideNavigation } from './internal';\n\nexport { SideNavigationProps };\n\nexport default function SideNavigation({ items = [], ...props }: SideNavigationProps) {\n const internalProps = useBaseComponent('SideNavigation');\n return <InternalSideNavigation {...props} {...internalProps} items={items} />;\n}\n\napplyDisplayName(SideNavigation, 'SideNavigation');\n"]}
|
|
@@ -1,18 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { SideNavigationProps } from './interfaces';
|
|
3
|
-
interface BaseItemComponentProps {
|
|
4
|
-
activeHref?: string;
|
|
5
|
-
fireChange: (item: SideNavigationProps.Section | SideNavigationProps.ExpandableLinkGroup, expanded: boolean) => void;
|
|
6
|
-
fireFollow: (item: SideNavigationProps.Link | SideNavigationProps.Header | SideNavigationProps.LinkGroup | SideNavigationProps.ExpandableLinkGroup, event: React.SyntheticEvent | Event) => void;
|
|
7
|
-
}
|
|
8
|
-
export interface HeaderProps extends BaseItemComponentProps {
|
|
9
|
-
definition: SideNavigationProps.Header;
|
|
10
|
-
}
|
|
11
|
-
export declare function Header({ definition, activeHref, fireFollow }: HeaderProps): JSX.Element;
|
|
12
|
-
export interface NavigationItemsListProps extends BaseItemComponentProps {
|
|
13
|
-
items: ReadonlyArray<SideNavigationProps.Item>;
|
|
14
|
-
variant: 'section' | 'section-group' | 'link-group' | 'expandable-link-group' | 'root';
|
|
15
|
-
}
|
|
16
|
-
export declare function NavigationItemsList({ items, variant, activeHref, fireChange, fireFollow }: NavigationItemsListProps): JSX.Element;
|
|
17
|
-
export {};
|
|
1
|
+
export declare const InternalSideNavigation: typeof import("./implementation").SideNavigationImplementation;
|
|
18
2
|
//# sourceMappingURL=internal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/side-navigation/internal.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/side-navigation/internal.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,sBAAsB,gEAAmC,CAAC"}
|