@workday/canvas-kit-preview-react 9.0.0-alpha.336-next.6 → 9.0.0-alpha.344-next.3
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/dist/commonjs/form-field/lib/FormField.d.ts +2 -2
- package/dist/commonjs/form-field/lib/FormFieldHint.d.ts +1 -1
- package/dist/commonjs/form-field/lib/FormFieldInput.d.ts +1 -1
- package/dist/commonjs/form-field/lib/hooks/useFormFieldHint.d.ts +1 -1
- package/dist/commonjs/form-field/lib/hooks/useFormFieldInput.d.ts +1 -1
- package/dist/commonjs/form-field/lib/hooks/useFormFieldLabel.d.ts +1 -1
- package/dist/commonjs/form-field/lib/hooks/useFormFieldModel.d.ts +2 -12
- package/dist/commonjs/form-field/lib/hooks/useFormFieldModel.d.ts.map +1 -1
- package/dist/commonjs/form-field/lib/hooks/useFormFieldModel.js +1 -3
- package/dist/commonjs/menu/lib/Menu.d.ts +12 -5
- package/dist/commonjs/menu/lib/Menu.d.ts.map +1 -1
- package/dist/commonjs/menu/lib/Menu.js +14 -5
- package/dist/commonjs/menu/lib/MenuItem.d.ts +15 -5
- package/dist/commonjs/menu/lib/MenuItem.d.ts.map +1 -1
- package/dist/commonjs/menu/lib/MenuItem.js +18 -6
- package/dist/commonjs/pill/lib/Pill.d.ts +103 -5
- package/dist/commonjs/pill/lib/Pill.d.ts.map +1 -1
- package/dist/commonjs/pill/lib/Pill.js +101 -2
- package/dist/commonjs/segmented-control/index.d.ts +2 -0
- package/dist/commonjs/segmented-control/index.d.ts.map +1 -1
- package/dist/commonjs/segmented-control/index.js +4 -0
- package/dist/commonjs/segmented-control/lib/SegmentedControl.d.ts +74 -38
- package/dist/commonjs/segmented-control/lib/SegmentedControl.d.ts.map +1 -1
- package/dist/commonjs/segmented-control/lib/SegmentedControl.js +36 -0
- package/dist/commonjs/segmented-control/lib/SegmentedControlItem.d.ts +1 -1
- package/dist/commonjs/segmented-control/lib/SegmentedControlList.d.ts +64 -1
- package/dist/commonjs/segmented-control/lib/SegmentedControlList.d.ts.map +1 -1
- package/dist/commonjs/segmented-control/lib/SegmentedControlList.js +3 -3
- package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlItem.d.ts +2 -2
- package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlModel.d.ts +39 -39
- package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlModel.js +2 -1
- package/dist/commonjs/select/lib/Select.js +2 -0
- package/dist/commonjs/side-panel/lib/SidePanel.d.ts +13 -26
- package/dist/commonjs/side-panel/lib/SidePanel.d.ts.map +1 -1
- package/dist/commonjs/side-panel/lib/SidePanel.js +73 -96
- package/dist/commonjs/side-panel/lib/SidePanelToggleButton.d.ts +17 -0
- package/dist/commonjs/side-panel/lib/SidePanelToggleButton.d.ts.map +1 -0
- package/dist/commonjs/side-panel/lib/SidePanelToggleButton.js +88 -0
- package/dist/commonjs/side-panel/lib/hooks.d.ts +20 -0
- package/dist/commonjs/side-panel/lib/hooks.d.ts.map +1 -1
- package/dist/commonjs/side-panel/lib/hooks.js +20 -1
- package/dist/commonjs/status-indicator/index.d.ts +2 -0
- package/dist/commonjs/status-indicator/index.d.ts.map +1 -1
- package/dist/commonjs/status-indicator/index.js +4 -0
- package/dist/commonjs/status-indicator/lib/StatusIndicator.d.ts +28 -2
- package/dist/commonjs/status-indicator/lib/StatusIndicator.d.ts.map +1 -1
- package/dist/commonjs/status-indicator/lib/StatusIndicator.js +27 -1
- package/dist/commonjs/status-indicator/lib/StatusIndicatorIcon.d.ts +13 -0
- package/dist/commonjs/status-indicator/lib/StatusIndicatorIcon.d.ts.map +1 -1
- package/dist/commonjs/status-indicator/lib/StatusIndicatorIcon.js +3 -3
- package/dist/commonjs/text-area/lib/TextArea.d.ts +1 -1
- package/dist/commonjs/text-area/lib/TextArea.d.ts.map +1 -1
- package/dist/commonjs/text-area/lib/TextArea.js +1 -2
- package/dist/commonjs/text-input/lib/TextInput.d.ts +2 -2
- package/dist/commonjs/text-input/lib/TextInput.d.ts.map +1 -1
- package/dist/commonjs/text-input/lib/TextInput.js +1 -2
- package/dist/commonjs/text-input/lib/TextInputField.js +1 -1
- package/dist/commonjs/text-input/lib/hooks/useTextInputField.d.ts +1 -1
- package/dist/commonjs/text-input/lib/hooks/useTextInputModel.d.ts +1 -0
- package/dist/commonjs/text-input/lib/hooks/useTextInputModel.d.ts.map +1 -1
- package/dist/commonjs/text-input/lib/hooks/useTextInputModel.js +1 -0
- package/dist/es6/form-field/lib/FormField.d.ts +2 -2
- package/dist/es6/form-field/lib/FormFieldHint.d.ts +1 -1
- package/dist/es6/form-field/lib/FormFieldInput.d.ts +1 -1
- package/dist/es6/form-field/lib/hooks/useFormFieldHint.d.ts +1 -1
- package/dist/es6/form-field/lib/hooks/useFormFieldInput.d.ts +1 -1
- package/dist/es6/form-field/lib/hooks/useFormFieldLabel.d.ts +1 -1
- package/dist/es6/form-field/lib/hooks/useFormFieldModel.d.ts +2 -12
- package/dist/es6/form-field/lib/hooks/useFormFieldModel.d.ts.map +1 -1
- package/dist/es6/form-field/lib/hooks/useFormFieldModel.js +1 -3
- package/dist/es6/menu/lib/Menu.d.ts +12 -5
- package/dist/es6/menu/lib/Menu.d.ts.map +1 -1
- package/dist/es6/menu/lib/Menu.js +14 -5
- package/dist/es6/menu/lib/MenuItem.d.ts +15 -5
- package/dist/es6/menu/lib/MenuItem.d.ts.map +1 -1
- package/dist/es6/menu/lib/MenuItem.js +18 -6
- package/dist/es6/pill/lib/Pill.d.ts +103 -5
- package/dist/es6/pill/lib/Pill.d.ts.map +1 -1
- package/dist/es6/pill/lib/Pill.js +101 -2
- package/dist/es6/segmented-control/index.d.ts +2 -0
- package/dist/es6/segmented-control/index.d.ts.map +1 -1
- package/dist/es6/segmented-control/index.js +2 -0
- package/dist/es6/segmented-control/lib/SegmentedControl.d.ts +74 -38
- package/dist/es6/segmented-control/lib/SegmentedControl.d.ts.map +1 -1
- package/dist/es6/segmented-control/lib/SegmentedControl.js +36 -0
- package/dist/es6/segmented-control/lib/SegmentedControlItem.d.ts +1 -1
- package/dist/es6/segmented-control/lib/SegmentedControlList.d.ts +64 -1
- package/dist/es6/segmented-control/lib/SegmentedControlList.d.ts.map +1 -1
- package/dist/es6/segmented-control/lib/SegmentedControlList.js +1 -1
- package/dist/es6/segmented-control/lib/hooks/useSegmentedControlItem.d.ts +2 -2
- package/dist/es6/segmented-control/lib/hooks/useSegmentedControlModel.d.ts +39 -39
- package/dist/es6/segmented-control/lib/hooks/useSegmentedControlModel.js +2 -1
- package/dist/es6/select/lib/Select.js +2 -0
- package/dist/es6/side-panel/lib/SidePanel.d.ts +13 -26
- package/dist/es6/side-panel/lib/SidePanel.d.ts.map +1 -1
- package/dist/es6/side-panel/lib/SidePanel.js +75 -97
- package/dist/es6/side-panel/lib/SidePanelToggleButton.d.ts +17 -0
- package/dist/es6/side-panel/lib/SidePanelToggleButton.d.ts.map +1 -0
- package/dist/es6/side-panel/lib/SidePanelToggleButton.js +66 -0
- package/dist/es6/side-panel/lib/hooks.d.ts +20 -0
- package/dist/es6/side-panel/lib/hooks.d.ts.map +1 -1
- package/dist/es6/side-panel/lib/hooks.js +19 -0
- package/dist/es6/status-indicator/index.d.ts +2 -0
- package/dist/es6/status-indicator/index.d.ts.map +1 -1
- package/dist/es6/status-indicator/index.js +2 -0
- package/dist/es6/status-indicator/lib/StatusIndicator.d.ts +28 -2
- package/dist/es6/status-indicator/lib/StatusIndicator.d.ts.map +1 -1
- package/dist/es6/status-indicator/lib/StatusIndicator.js +27 -1
- package/dist/es6/status-indicator/lib/StatusIndicatorIcon.d.ts +13 -0
- package/dist/es6/status-indicator/lib/StatusIndicatorIcon.d.ts.map +1 -1
- package/dist/es6/status-indicator/lib/StatusIndicatorIcon.js +1 -1
- package/dist/es6/text-area/lib/TextArea.d.ts +1 -1
- package/dist/es6/text-area/lib/TextArea.d.ts.map +1 -1
- package/dist/es6/text-area/lib/TextArea.js +2 -3
- package/dist/es6/text-input/lib/TextInput.d.ts +2 -2
- package/dist/es6/text-input/lib/TextInput.d.ts.map +1 -1
- package/dist/es6/text-input/lib/TextInput.js +2 -3
- package/dist/es6/text-input/lib/TextInputField.js +3 -3
- package/dist/es6/text-input/lib/hooks/useTextInputField.d.ts +1 -1
- package/dist/es6/text-input/lib/hooks/useTextInputModel.d.ts +1 -0
- package/dist/es6/text-input/lib/hooks/useTextInputModel.d.ts.map +1 -1
- package/dist/es6/text-input/lib/hooks/useTextInputModel.js +1 -0
- package/form-field/lib/hooks/useFormFieldModel.tsx +1 -3
- package/menu/lib/Menu.tsx +12 -5
- package/menu/lib/MenuItem.tsx +15 -5
- package/package.json +4 -4
- package/pill/lib/Pill.tsx +101 -2
- package/segmented-control/index.ts +2 -0
- package/segmented-control/lib/SegmentedControl.tsx +36 -0
- package/segmented-control/lib/SegmentedControlList.tsx +1 -1
- package/side-panel/lib/SidePanel.tsx +119 -169
- package/side-panel/lib/SidePanelToggleButton.tsx +78 -0
- package/side-panel/lib/hooks.ts +20 -0
- package/status-indicator/index.ts +2 -0
- package/status-indicator/lib/StatusIndicator.tsx +27 -1
- package/status-indicator/lib/StatusIndicatorIcon.tsx +1 -1
- package/text-area/lib/TextArea.tsx +6 -3
- package/text-input/lib/TextInput.tsx +6 -3
- package/text-input/lib/TextInputField.tsx +3 -3
- package/text-input/lib/hooks/useTextInputModel.ts +1 -0
- package/dist/commonjs/text-area/lib/hooks/index.d.ts +0 -2
- package/dist/commonjs/text-area/lib/hooks/index.d.ts.map +0 -1
- package/dist/commonjs/text-area/lib/hooks/index.js +0 -13
- package/dist/commonjs/text-area/lib/hooks/useTextAreaModel.d.ts +0 -28
- package/dist/commonjs/text-area/lib/hooks/useTextAreaModel.d.ts.map +0 -1
- package/dist/commonjs/text-area/lib/hooks/useTextAreaModel.js +0 -5
- package/dist/es6/text-area/lib/hooks/index.d.ts +0 -2
- package/dist/es6/text-area/lib/hooks/index.d.ts.map +0 -1
- package/dist/es6/text-area/lib/hooks/index.js +0 -1
- package/dist/es6/text-area/lib/hooks/useTextAreaModel.d.ts +0 -28
- package/dist/es6/text-area/lib/hooks/useTextAreaModel.d.ts.map +0 -1
- package/dist/es6/text-area/lib/hooks/useTextAreaModel.js +0 -2
- package/text-area/lib/hooks/index.ts +0 -1
- package/text-area/lib/hooks/useTextAreaModel.ts +0 -3
|
@@ -25,7 +25,7 @@ export declare const useSegmentedControlModel: (<TT_Special_Generic>(config?: (P
|
|
|
25
25
|
* We suggest to use the `vertical` orientation only for icon only variant.
|
|
26
26
|
* @default 'horizontal'
|
|
27
27
|
*/
|
|
28
|
-
orientation: "
|
|
28
|
+
orientation: import("@workday/canvas-kit-react/collection/lib/useBaseListModel").Orientation;
|
|
29
29
|
initialSelectedIds: import("@workday/canvas-kit-react/collection/lib/useSelectionListModel").SelectedIds;
|
|
30
30
|
initialUnselectedIds: string[];
|
|
31
31
|
selection: import("@workday/canvas-kit-react/collection/lib/useSelectionListModel").SelectionManager;
|
|
@@ -44,7 +44,7 @@ export declare const useSegmentedControlModel: (<TT_Special_Generic>(config?: (P
|
|
|
44
44
|
}, prevState: {
|
|
45
45
|
disabled: boolean;
|
|
46
46
|
size: "small" | "medium" | "large";
|
|
47
|
-
selectedIds:
|
|
47
|
+
selectedIds: string[] | "all";
|
|
48
48
|
unselectedIds: string[];
|
|
49
49
|
cursorId: string;
|
|
50
50
|
columnCount: number;
|
|
@@ -67,7 +67,7 @@ export declare const useSegmentedControlModel: (<TT_Special_Generic>(config?: (P
|
|
|
67
67
|
onSelectAll?: ((data: undefined, prevState: {
|
|
68
68
|
disabled: boolean;
|
|
69
69
|
size: "small" | "medium" | "large";
|
|
70
|
-
selectedIds:
|
|
70
|
+
selectedIds: string[] | "all";
|
|
71
71
|
unselectedIds: string[];
|
|
72
72
|
cursorId: string;
|
|
73
73
|
columnCount: number;
|
|
@@ -90,7 +90,7 @@ export declare const useSegmentedControlModel: (<TT_Special_Generic>(config?: (P
|
|
|
90
90
|
onUnselectAll?: ((data: undefined, prevState: {
|
|
91
91
|
disabled: boolean;
|
|
92
92
|
size: "small" | "medium" | "large";
|
|
93
|
-
selectedIds:
|
|
93
|
+
selectedIds: string[] | "all";
|
|
94
94
|
unselectedIds: string[];
|
|
95
95
|
cursorId: string;
|
|
96
96
|
columnCount: number;
|
|
@@ -116,7 +116,7 @@ export declare const useSegmentedControlModel: (<TT_Special_Generic>(config?: (P
|
|
|
116
116
|
}, prevState: {
|
|
117
117
|
disabled: boolean;
|
|
118
118
|
size: "small" | "medium" | "large";
|
|
119
|
-
selectedIds:
|
|
119
|
+
selectedIds: string[] | "all";
|
|
120
120
|
unselectedIds: string[];
|
|
121
121
|
cursorId: string;
|
|
122
122
|
columnCount: number;
|
|
@@ -141,7 +141,7 @@ export declare const useSegmentedControlModel: (<TT_Special_Generic>(config?: (P
|
|
|
141
141
|
}, prevState: {
|
|
142
142
|
disabled: boolean;
|
|
143
143
|
size: "small" | "medium" | "large";
|
|
144
|
-
selectedIds:
|
|
144
|
+
selectedIds: string[] | "all";
|
|
145
145
|
unselectedIds: string[];
|
|
146
146
|
cursorId: string;
|
|
147
147
|
columnCount: number;
|
|
@@ -164,7 +164,7 @@ export declare const useSegmentedControlModel: (<TT_Special_Generic>(config?: (P
|
|
|
164
164
|
onGoToNext?: ((data: undefined, prevState: {
|
|
165
165
|
disabled: boolean;
|
|
166
166
|
size: "small" | "medium" | "large";
|
|
167
|
-
selectedIds:
|
|
167
|
+
selectedIds: string[] | "all";
|
|
168
168
|
unselectedIds: string[];
|
|
169
169
|
cursorId: string;
|
|
170
170
|
columnCount: number;
|
|
@@ -187,7 +187,7 @@ export declare const useSegmentedControlModel: (<TT_Special_Generic>(config?: (P
|
|
|
187
187
|
onGoToPrevious?: ((data: undefined, prevState: {
|
|
188
188
|
disabled: boolean;
|
|
189
189
|
size: "small" | "medium" | "large";
|
|
190
|
-
selectedIds:
|
|
190
|
+
selectedIds: string[] | "all";
|
|
191
191
|
unselectedIds: string[];
|
|
192
192
|
cursorId: string;
|
|
193
193
|
columnCount: number;
|
|
@@ -210,7 +210,7 @@ export declare const useSegmentedControlModel: (<TT_Special_Generic>(config?: (P
|
|
|
210
210
|
onGoToPreviousRow?: ((data: undefined, prevState: {
|
|
211
211
|
disabled: boolean;
|
|
212
212
|
size: "small" | "medium" | "large";
|
|
213
|
-
selectedIds:
|
|
213
|
+
selectedIds: string[] | "all";
|
|
214
214
|
unselectedIds: string[];
|
|
215
215
|
cursorId: string;
|
|
216
216
|
columnCount: number;
|
|
@@ -233,7 +233,7 @@ export declare const useSegmentedControlModel: (<TT_Special_Generic>(config?: (P
|
|
|
233
233
|
onGoToNextRow?: ((data: undefined, prevState: {
|
|
234
234
|
disabled: boolean;
|
|
235
235
|
size: "small" | "medium" | "large";
|
|
236
|
-
selectedIds:
|
|
236
|
+
selectedIds: string[] | "all";
|
|
237
237
|
unselectedIds: string[];
|
|
238
238
|
cursorId: string;
|
|
239
239
|
columnCount: number;
|
|
@@ -256,7 +256,7 @@ export declare const useSegmentedControlModel: (<TT_Special_Generic>(config?: (P
|
|
|
256
256
|
onGoToFirst?: ((data: undefined, prevState: {
|
|
257
257
|
disabled: boolean;
|
|
258
258
|
size: "small" | "medium" | "large";
|
|
259
|
-
selectedIds:
|
|
259
|
+
selectedIds: string[] | "all";
|
|
260
260
|
unselectedIds: string[];
|
|
261
261
|
cursorId: string;
|
|
262
262
|
columnCount: number;
|
|
@@ -279,7 +279,7 @@ export declare const useSegmentedControlModel: (<TT_Special_Generic>(config?: (P
|
|
|
279
279
|
onGoToLast?: ((data: undefined, prevState: {
|
|
280
280
|
disabled: boolean;
|
|
281
281
|
size: "small" | "medium" | "large";
|
|
282
|
-
selectedIds:
|
|
282
|
+
selectedIds: string[] | "all";
|
|
283
283
|
unselectedIds: string[];
|
|
284
284
|
cursorId: string;
|
|
285
285
|
columnCount: number;
|
|
@@ -302,7 +302,7 @@ export declare const useSegmentedControlModel: (<TT_Special_Generic>(config?: (P
|
|
|
302
302
|
onGoToFirstOfRow?: ((data: undefined, prevState: {
|
|
303
303
|
disabled: boolean;
|
|
304
304
|
size: "small" | "medium" | "large";
|
|
305
|
-
selectedIds:
|
|
305
|
+
selectedIds: string[] | "all";
|
|
306
306
|
unselectedIds: string[];
|
|
307
307
|
cursorId: string;
|
|
308
308
|
columnCount: number;
|
|
@@ -325,7 +325,7 @@ export declare const useSegmentedControlModel: (<TT_Special_Generic>(config?: (P
|
|
|
325
325
|
onGoToLastOfRow?: ((data: undefined, prevState: {
|
|
326
326
|
disabled: boolean;
|
|
327
327
|
size: "small" | "medium" | "large";
|
|
328
|
-
selectedIds:
|
|
328
|
+
selectedIds: string[] | "all";
|
|
329
329
|
unselectedIds: string[];
|
|
330
330
|
cursorId: string;
|
|
331
331
|
columnCount: number;
|
|
@@ -348,7 +348,7 @@ export declare const useSegmentedControlModel: (<TT_Special_Generic>(config?: (P
|
|
|
348
348
|
onGoToNextPage?: ((data: undefined, prevState: {
|
|
349
349
|
disabled: boolean;
|
|
350
350
|
size: "small" | "medium" | "large";
|
|
351
|
-
selectedIds:
|
|
351
|
+
selectedIds: string[] | "all";
|
|
352
352
|
unselectedIds: string[];
|
|
353
353
|
cursorId: string;
|
|
354
354
|
columnCount: number;
|
|
@@ -371,7 +371,7 @@ export declare const useSegmentedControlModel: (<TT_Special_Generic>(config?: (P
|
|
|
371
371
|
onGoToPreviousPage?: ((data: undefined, prevState: {
|
|
372
372
|
disabled: boolean;
|
|
373
373
|
size: "small" | "medium" | "large";
|
|
374
|
-
selectedIds:
|
|
374
|
+
selectedIds: string[] | "all";
|
|
375
375
|
unselectedIds: string[];
|
|
376
376
|
cursorId: string;
|
|
377
377
|
columnCount: number;
|
|
@@ -396,7 +396,7 @@ export declare const useSegmentedControlModel: (<TT_Special_Generic>(config?: (P
|
|
|
396
396
|
}, prevState: {
|
|
397
397
|
disabled: boolean;
|
|
398
398
|
size: "small" | "medium" | "large";
|
|
399
|
-
selectedIds:
|
|
399
|
+
selectedIds: string[] | "all";
|
|
400
400
|
unselectedIds: string[];
|
|
401
401
|
cursorId: string;
|
|
402
402
|
columnCount: number;
|
|
@@ -421,7 +421,7 @@ export declare const useSegmentedControlModel: (<TT_Special_Generic>(config?: (P
|
|
|
421
421
|
}, prevState: {
|
|
422
422
|
disabled: boolean;
|
|
423
423
|
size: "small" | "medium" | "large";
|
|
424
|
-
selectedIds:
|
|
424
|
+
selectedIds: string[] | "all";
|
|
425
425
|
unselectedIds: string[];
|
|
426
426
|
cursorId: string;
|
|
427
427
|
columnCount: number;
|
|
@@ -447,7 +447,7 @@ export declare const useSegmentedControlModel: (<TT_Special_Generic>(config?: (P
|
|
|
447
447
|
}, state: {
|
|
448
448
|
disabled: boolean;
|
|
449
449
|
size: "small" | "medium" | "large";
|
|
450
|
-
selectedIds:
|
|
450
|
+
selectedIds: string[] | "all";
|
|
451
451
|
unselectedIds: string[];
|
|
452
452
|
cursorId: string;
|
|
453
453
|
columnCount: number;
|
|
@@ -470,7 +470,7 @@ export declare const useSegmentedControlModel: (<TT_Special_Generic>(config?: (P
|
|
|
470
470
|
shouldSelectAll?: ((data: undefined, state: {
|
|
471
471
|
disabled: boolean;
|
|
472
472
|
size: "small" | "medium" | "large";
|
|
473
|
-
selectedIds:
|
|
473
|
+
selectedIds: string[] | "all";
|
|
474
474
|
unselectedIds: string[];
|
|
475
475
|
cursorId: string;
|
|
476
476
|
columnCount: number;
|
|
@@ -493,7 +493,7 @@ export declare const useSegmentedControlModel: (<TT_Special_Generic>(config?: (P
|
|
|
493
493
|
shouldUnselectAll?: ((data: undefined, state: {
|
|
494
494
|
disabled: boolean;
|
|
495
495
|
size: "small" | "medium" | "large";
|
|
496
|
-
selectedIds:
|
|
496
|
+
selectedIds: string[] | "all";
|
|
497
497
|
unselectedIds: string[];
|
|
498
498
|
cursorId: string;
|
|
499
499
|
columnCount: number;
|
|
@@ -519,7 +519,7 @@ export declare const useSegmentedControlModel: (<TT_Special_Generic>(config?: (P
|
|
|
519
519
|
}, state: {
|
|
520
520
|
disabled: boolean;
|
|
521
521
|
size: "small" | "medium" | "large";
|
|
522
|
-
selectedIds:
|
|
522
|
+
selectedIds: string[] | "all";
|
|
523
523
|
unselectedIds: string[];
|
|
524
524
|
cursorId: string;
|
|
525
525
|
columnCount: number;
|
|
@@ -544,7 +544,7 @@ export declare const useSegmentedControlModel: (<TT_Special_Generic>(config?: (P
|
|
|
544
544
|
}, state: {
|
|
545
545
|
disabled: boolean;
|
|
546
546
|
size: "small" | "medium" | "large";
|
|
547
|
-
selectedIds:
|
|
547
|
+
selectedIds: string[] | "all";
|
|
548
548
|
unselectedIds: string[];
|
|
549
549
|
cursorId: string;
|
|
550
550
|
columnCount: number;
|
|
@@ -567,7 +567,7 @@ export declare const useSegmentedControlModel: (<TT_Special_Generic>(config?: (P
|
|
|
567
567
|
shouldGoToNext?: ((data: undefined, state: {
|
|
568
568
|
disabled: boolean;
|
|
569
569
|
size: "small" | "medium" | "large";
|
|
570
|
-
selectedIds:
|
|
570
|
+
selectedIds: string[] | "all";
|
|
571
571
|
unselectedIds: string[];
|
|
572
572
|
cursorId: string;
|
|
573
573
|
columnCount: number;
|
|
@@ -590,7 +590,7 @@ export declare const useSegmentedControlModel: (<TT_Special_Generic>(config?: (P
|
|
|
590
590
|
shouldGoToPrevious?: ((data: undefined, state: {
|
|
591
591
|
disabled: boolean;
|
|
592
592
|
size: "small" | "medium" | "large";
|
|
593
|
-
selectedIds:
|
|
593
|
+
selectedIds: string[] | "all";
|
|
594
594
|
unselectedIds: string[];
|
|
595
595
|
cursorId: string;
|
|
596
596
|
columnCount: number;
|
|
@@ -613,7 +613,7 @@ export declare const useSegmentedControlModel: (<TT_Special_Generic>(config?: (P
|
|
|
613
613
|
shouldGoToPreviousRow?: ((data: undefined, state: {
|
|
614
614
|
disabled: boolean;
|
|
615
615
|
size: "small" | "medium" | "large";
|
|
616
|
-
selectedIds:
|
|
616
|
+
selectedIds: string[] | "all";
|
|
617
617
|
unselectedIds: string[];
|
|
618
618
|
cursorId: string;
|
|
619
619
|
columnCount: number;
|
|
@@ -636,7 +636,7 @@ export declare const useSegmentedControlModel: (<TT_Special_Generic>(config?: (P
|
|
|
636
636
|
shouldGoToNextRow?: ((data: undefined, state: {
|
|
637
637
|
disabled: boolean;
|
|
638
638
|
size: "small" | "medium" | "large";
|
|
639
|
-
selectedIds:
|
|
639
|
+
selectedIds: string[] | "all";
|
|
640
640
|
unselectedIds: string[];
|
|
641
641
|
cursorId: string;
|
|
642
642
|
columnCount: number;
|
|
@@ -659,7 +659,7 @@ export declare const useSegmentedControlModel: (<TT_Special_Generic>(config?: (P
|
|
|
659
659
|
shouldGoToFirst?: ((data: undefined, state: {
|
|
660
660
|
disabled: boolean;
|
|
661
661
|
size: "small" | "medium" | "large";
|
|
662
|
-
selectedIds:
|
|
662
|
+
selectedIds: string[] | "all";
|
|
663
663
|
unselectedIds: string[];
|
|
664
664
|
cursorId: string;
|
|
665
665
|
columnCount: number;
|
|
@@ -682,7 +682,7 @@ export declare const useSegmentedControlModel: (<TT_Special_Generic>(config?: (P
|
|
|
682
682
|
shouldGoToLast?: ((data: undefined, state: {
|
|
683
683
|
disabled: boolean;
|
|
684
684
|
size: "small" | "medium" | "large";
|
|
685
|
-
selectedIds:
|
|
685
|
+
selectedIds: string[] | "all";
|
|
686
686
|
unselectedIds: string[];
|
|
687
687
|
cursorId: string;
|
|
688
688
|
columnCount: number;
|
|
@@ -705,7 +705,7 @@ export declare const useSegmentedControlModel: (<TT_Special_Generic>(config?: (P
|
|
|
705
705
|
shouldGoToFirstOfRow?: ((data: undefined, state: {
|
|
706
706
|
disabled: boolean;
|
|
707
707
|
size: "small" | "medium" | "large";
|
|
708
|
-
selectedIds:
|
|
708
|
+
selectedIds: string[] | "all";
|
|
709
709
|
unselectedIds: string[];
|
|
710
710
|
cursorId: string;
|
|
711
711
|
columnCount: number;
|
|
@@ -728,7 +728,7 @@ export declare const useSegmentedControlModel: (<TT_Special_Generic>(config?: (P
|
|
|
728
728
|
shouldGoToLastOfRow?: ((data: undefined, state: {
|
|
729
729
|
disabled: boolean;
|
|
730
730
|
size: "small" | "medium" | "large";
|
|
731
|
-
selectedIds:
|
|
731
|
+
selectedIds: string[] | "all";
|
|
732
732
|
unselectedIds: string[];
|
|
733
733
|
cursorId: string;
|
|
734
734
|
columnCount: number;
|
|
@@ -751,7 +751,7 @@ export declare const useSegmentedControlModel: (<TT_Special_Generic>(config?: (P
|
|
|
751
751
|
shouldGoToNextPage?: ((data: undefined, state: {
|
|
752
752
|
disabled: boolean;
|
|
753
753
|
size: "small" | "medium" | "large";
|
|
754
|
-
selectedIds:
|
|
754
|
+
selectedIds: string[] | "all";
|
|
755
755
|
unselectedIds: string[];
|
|
756
756
|
cursorId: string;
|
|
757
757
|
columnCount: number;
|
|
@@ -774,7 +774,7 @@ export declare const useSegmentedControlModel: (<TT_Special_Generic>(config?: (P
|
|
|
774
774
|
shouldGoToPreviousPage?: ((data: undefined, state: {
|
|
775
775
|
disabled: boolean;
|
|
776
776
|
size: "small" | "medium" | "large";
|
|
777
|
-
selectedIds:
|
|
777
|
+
selectedIds: string[] | "all";
|
|
778
778
|
unselectedIds: string[];
|
|
779
779
|
cursorId: string;
|
|
780
780
|
columnCount: number;
|
|
@@ -799,7 +799,7 @@ export declare const useSegmentedControlModel: (<TT_Special_Generic>(config?: (P
|
|
|
799
799
|
}, state: {
|
|
800
800
|
disabled: boolean;
|
|
801
801
|
size: "small" | "medium" | "large";
|
|
802
|
-
selectedIds:
|
|
802
|
+
selectedIds: string[] | "all";
|
|
803
803
|
unselectedIds: string[];
|
|
804
804
|
cursorId: string;
|
|
805
805
|
columnCount: number;
|
|
@@ -824,7 +824,7 @@ export declare const useSegmentedControlModel: (<TT_Special_Generic>(config?: (P
|
|
|
824
824
|
}, state: {
|
|
825
825
|
disabled: boolean;
|
|
826
826
|
size: "small" | "medium" | "large";
|
|
827
|
-
selectedIds:
|
|
827
|
+
selectedIds: string[] | "all";
|
|
828
828
|
unselectedIds: string[];
|
|
829
829
|
cursorId: string;
|
|
830
830
|
columnCount: number;
|
|
@@ -848,7 +848,7 @@ export declare const useSegmentedControlModel: (<TT_Special_Generic>(config?: (P
|
|
|
848
848
|
state: {
|
|
849
849
|
disabled: boolean;
|
|
850
850
|
size: "small" | "medium" | "large";
|
|
851
|
-
selectedIds:
|
|
851
|
+
selectedIds: string[] | "all";
|
|
852
852
|
unselectedIds: string[];
|
|
853
853
|
cursorId: string;
|
|
854
854
|
columnCount: number;
|
|
@@ -927,7 +927,7 @@ export declare const useSegmentedControlModel: (<TT_Special_Generic>(config?: (P
|
|
|
927
927
|
* We suggest to use the `vertical` orientation only for icon only variant.
|
|
928
928
|
* @default 'horizontal'
|
|
929
929
|
*/
|
|
930
|
-
orientation: "
|
|
930
|
+
orientation: import("@workday/canvas-kit-react/collection/lib/useBaseListModel").Orientation;
|
|
931
931
|
initialSelectedIds: import("@workday/canvas-kit-react/collection/lib/useSelectionListModel").SelectedIds;
|
|
932
932
|
initialUnselectedIds: string[];
|
|
933
933
|
selection: import("@workday/canvas-kit-react/collection/lib/useSelectionListModel").SelectionManager;
|
|
@@ -943,7 +943,7 @@ export declare const useSegmentedControlModel: (<TT_Special_Generic>(config?: (P
|
|
|
943
943
|
}, {}, {
|
|
944
944
|
disabled: boolean;
|
|
945
945
|
size: "small" | "medium" | "large";
|
|
946
|
-
selectedIds:
|
|
946
|
+
selectedIds: string[] | "all";
|
|
947
947
|
unselectedIds: string[];
|
|
948
948
|
cursorId: string;
|
|
949
949
|
columnCount: number;
|
|
@@ -995,7 +995,7 @@ export declare const useSegmentedControlModel: (<TT_Special_Generic>(config?: (P
|
|
|
995
995
|
state: {
|
|
996
996
|
disabled: boolean;
|
|
997
997
|
size: "small" | "medium" | "large";
|
|
998
|
-
selectedIds:
|
|
998
|
+
selectedIds: string[] | "all";
|
|
999
999
|
unselectedIds: string[];
|
|
1000
1000
|
cursorId: string;
|
|
1001
1001
|
columnCount: number;
|
|
@@ -63,7 +63,8 @@ exports.useSegmentedControlModel = common_1.createModelHook({
|
|
|
63
63
|
},
|
|
64
64
|
initialSelectedIds: config.initialValue
|
|
65
65
|
? [config.initialValue]
|
|
66
|
-
: ((_a = config.items) === null || _a === void 0 ? void 0 : _a.length)
|
|
66
|
+
: ((_a = config.items) === null || _a === void 0 ? void 0 : _a.length)
|
|
67
|
+
? [getId(config.items[0])]
|
|
67
68
|
: [],
|
|
68
69
|
shouldVirtualize: false,
|
|
69
70
|
}));
|
|
@@ -7,6 +7,8 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
7
7
|
return extendStatics(d, b);
|
|
8
8
|
};
|
|
9
9
|
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
10
12
|
extendStatics(d, b);
|
|
11
13
|
function __() { this.constructor = d; }
|
|
12
14
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -1,17 +1,9 @@
|
|
|
1
1
|
/** @jsxRuntime classic */
|
|
2
2
|
/** @jsx jsx */
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import { jsx } from '@emotion/react';
|
|
5
|
-
import { TertiaryButtonProps } from '@workday/canvas-kit-react/button';
|
|
6
4
|
export declare type SidePanelVariant = 'standard' | 'alternate';
|
|
7
5
|
export declare type SidePanelTransitionStates = 'collapsed' | 'collapsing' | 'expanded' | 'expanding';
|
|
8
|
-
export interface SidePanelProps
|
|
9
|
-
/**
|
|
10
|
-
* The element the side panel will render as (e.g. 'div').
|
|
11
|
-
*
|
|
12
|
-
* @default 'section'
|
|
13
|
-
*/
|
|
14
|
-
as?: React.ElementType;
|
|
6
|
+
export interface SidePanelProps {
|
|
15
7
|
/**
|
|
16
8
|
* The width of the component (in `px` if it's a `number`) when it is collapsed.
|
|
17
9
|
*
|
|
@@ -61,25 +53,20 @@ export interface SidePanelProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
61
53
|
* @param boolean
|
|
62
54
|
*/
|
|
63
55
|
touched: boolean;
|
|
56
|
+
children?: React.ReactNode;
|
|
57
|
+
onAnimationStart?: React.AnimationEventHandler<HTMLElement>;
|
|
58
|
+
onAnimationEnd?: React.AnimationEventHandler<HTMLElement>;
|
|
64
59
|
}
|
|
65
|
-
export declare const
|
|
66
|
-
state: string;
|
|
67
|
-
origin: string;
|
|
68
|
-
}>;
|
|
69
|
-
export declare const SidePanel: {
|
|
70
|
-
({ as, children, collapsedWidth, expanded, expandedWidth, onAnimationEnd, onAnimationStart, onExpandedChange, onStateTransition, origin, variant, touched, ...elemProps }: SidePanelProps): jsx.JSX.Element;
|
|
71
|
-
ToggleButton: ({ variant, icon, tooltipTextExpand: expandLabel, tooltipTextCollapse: collapseLabel, ...rest }: ToggleButtonProps & React.ButtonHTMLAttributes<HTMLButtonElement>) => jsx.JSX.Element;
|
|
72
|
-
};
|
|
73
|
-
export declare type ToggleButtonProps = TertiaryButtonProps & {
|
|
60
|
+
export declare const SidePanel: import("@workday/canvas-kit-react/common").ElementComponent<"section", SidePanelProps> & {
|
|
74
61
|
/**
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
*
|
|
81
|
-
*
|
|
62
|
+
* `SidePanel.ToggleButton` is a control that is meant to toggle between `expanded = true` and
|
|
63
|
+
* `expanded = false` states. It must be used within the `SidePanel` component as a child. Use
|
|
64
|
+
* in conjunction with `useSidePanel`'s `controlProps`, otherwise it does not come with explicit
|
|
65
|
+
* `onClick` handlers.
|
|
66
|
+
*
|
|
67
|
+
* For accessibility purposes, it must be the first focusable element. We recommend that you
|
|
68
|
+
* keep it as the first child of `SidePanel`
|
|
82
69
|
*/
|
|
83
|
-
|
|
70
|
+
ToggleButton: import("@workday/canvas-kit-react/common").ElementComponent<"button", import("./SidePanelToggleButton").SidePanelToggleButtonProps>;
|
|
84
71
|
};
|
|
85
72
|
//# sourceMappingURL=SidePanel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidePanel.d.ts","sourceRoot":"","sources":["../../../../side-panel/lib/SidePanel.tsx"],"names":[],"mappings":"AAAA,0BAA0B;AAC1B,eAAe;AACf,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"SidePanel.d.ts","sourceRoot":"","sources":["../../../../side-panel/lib/SidePanel.tsx"],"names":[],"mappings":"AAAA,0BAA0B;AAC1B,eAAe;AACf,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,oBAAY,gBAAgB,GAAG,UAAU,GAAG,WAAW,CAAC;AACxD,oBAAY,yBAAyB,GAAG,WAAW,GAAG,YAAY,GAAG,UAAU,GAAG,WAAW,CAAC;AAE9F,MAAM,WAAW,cAAc;IAC7B;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACjC;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1B;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD;;;;;;OAMG;IACH,iBAAiB,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,yBAAyB,KAAK,IAAI,CAAC;IAChE;;;;OAIG;IACH,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B;;;;OAIG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,gBAAgB,CAAC,EAAE,KAAK,CAAC,qBAAqB,CAAC,WAAW,CAAC,CAAC;IAC5D,cAAc,CAAC,EAAE,KAAK,CAAC,qBAAqB,CAAC,WAAW,CAAC,CAAC;CAC3D;AAsCD,eAAO,MAAM,SAAS;IAwGlB;;;;;;;;OAQG;;CAGL,CAAC"}
|
|
@@ -45,16 +45,15 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
45
45
|
return t;
|
|
46
46
|
};
|
|
47
47
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
-
exports.SidePanel =
|
|
48
|
+
exports.SidePanel = void 0;
|
|
49
49
|
/** @jsxRuntime classic */
|
|
50
50
|
/** @jsx jsx */
|
|
51
51
|
var React = __importStar(require("react"));
|
|
52
52
|
var common_1 = require("@workday/canvas-kit-react/common");
|
|
53
53
|
var react_1 = require("@emotion/react");
|
|
54
|
-
var button_1 = require("@workday/canvas-kit-react/button");
|
|
55
54
|
var tokens_1 = require("@workday/canvas-kit-react/tokens");
|
|
56
|
-
var
|
|
57
|
-
var
|
|
55
|
+
var hooks_1 = require("./hooks");
|
|
56
|
+
var SidePanelToggleButton_1 = require("./SidePanelToggleButton");
|
|
58
57
|
var createKeyframes = function (from, to) {
|
|
59
58
|
var normalized = {
|
|
60
59
|
from: typeof from === 'number' ? from + 'px' : from,
|
|
@@ -74,99 +73,77 @@ var Panel = common_1.styled('section')({
|
|
|
74
73
|
boxSizing: 'border-box',
|
|
75
74
|
height: '100%',
|
|
76
75
|
});
|
|
77
|
-
exports.
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
var
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
if (typeof onExpandedChange !== 'undefined') {
|
|
86
|
-
onExpandedChange(expanded);
|
|
87
|
-
}
|
|
88
|
-
}, [expanded, onExpandedChange]);
|
|
89
|
-
React.useEffect(function () {
|
|
90
|
-
if (typeof onStateTransition !== 'undefined') {
|
|
91
|
-
onStateTransition(state);
|
|
92
|
-
}
|
|
93
|
-
}, [state, onStateTransition]);
|
|
94
|
-
var motion = {
|
|
95
|
-
collapse: createKeyframes(expandedWidth, collapsedWidth),
|
|
96
|
-
expand: createKeyframes(collapsedWidth, expandedWidth),
|
|
97
|
-
};
|
|
98
|
-
var handleAnimationEnd = function (event) {
|
|
99
|
-
if (event.currentTarget === event.target) {
|
|
100
|
-
if (event.animationName === motion.collapse.name) {
|
|
101
|
-
setState('collapsed');
|
|
76
|
+
exports.SidePanel = common_1.createComponent('section')({
|
|
77
|
+
displayName: 'SidePanel',
|
|
78
|
+
Component: function (_a, ref, Element) {
|
|
79
|
+
var children = _a.children, _b = _a.collapsedWidth, collapsedWidth = _b === void 0 ? 64 : _b, _c = _a.expanded, expanded = _c === void 0 ? true : _c, _d = _a.expandedWidth, expandedWidth = _d === void 0 ? 320 : _d, onAnimationEnd = _a.onAnimationEnd, onAnimationStart = _a.onAnimationStart, onExpandedChange = _a.onExpandedChange, onStateTransition = _a.onStateTransition, _e = _a.origin, origin = _e === void 0 ? 'left' : _e, _f = _a.variant, variant = _f === void 0 ? 'standard' : _f, touched = _a.touched, elemProps = __rest(_a, ["children", "collapsedWidth", "expanded", "expandedWidth", "onAnimationEnd", "onAnimationStart", "onExpandedChange", "onStateTransition", "origin", "variant", "touched"]);
|
|
80
|
+
var _g = React.useState(expanded ? 'expanded' : 'collapsed'), state = _g[0], setState = _g[1];
|
|
81
|
+
React.useEffect(function () {
|
|
82
|
+
if (typeof onExpandedChange !== 'undefined') {
|
|
83
|
+
onExpandedChange(expanded);
|
|
102
84
|
}
|
|
103
|
-
|
|
104
|
-
|
|
85
|
+
}, [expanded, onExpandedChange]);
|
|
86
|
+
React.useEffect(function () {
|
|
87
|
+
if (typeof onStateTransition !== 'undefined') {
|
|
88
|
+
onStateTransition(state);
|
|
105
89
|
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
90
|
+
}, [state, onStateTransition]);
|
|
91
|
+
var motion = {
|
|
92
|
+
collapse: createKeyframes(expandedWidth, collapsedWidth),
|
|
93
|
+
expand: createKeyframes(collapsedWidth, expandedWidth),
|
|
94
|
+
};
|
|
95
|
+
var handleAnimationEnd = function (event) {
|
|
96
|
+
if (event.currentTarget === event.target) {
|
|
97
|
+
if (event.animationName === motion.collapse.name) {
|
|
98
|
+
setState('collapsed');
|
|
99
|
+
}
|
|
100
|
+
if (event.animationName === motion.expand.name) {
|
|
101
|
+
setState('expanded');
|
|
102
|
+
}
|
|
116
103
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
left: context.state === 'collapsed' ? 0 : rtlOrigin === 'right' ? tokens_1.space.s : undefined,
|
|
163
|
-
margin: context.state === 'collapsed' ? 'auto' : 0,
|
|
164
|
-
transform: context.state === 'collapsed' || context.state === 'collapsing'
|
|
165
|
-
? "scaleX(" + (rtlOrigin === 'left' ? '1' : '-1') + ")"
|
|
166
|
-
: "scaleX(" + (rtlOrigin === 'left' ? '-1' : '1') + ")",
|
|
167
|
-
});
|
|
168
|
-
return (react_1.jsx(tooltip_1.Tooltip, { title: context.state === 'collapsed' ? expandLabel : collapseLabel, type: "muted" },
|
|
169
|
-
react_1.jsx(button_1.TertiaryButton, __assign({ type: "button", css: buttonStyle, icon: icon, variant: variant }, rest))));
|
|
170
|
-
};
|
|
171
|
-
exports.SidePanel.ToggleButton = ToggleButton;
|
|
104
|
+
if (typeof onAnimationEnd !== 'undefined') {
|
|
105
|
+
onAnimationEnd(event);
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
var handleAnimationStart = function (event) {
|
|
109
|
+
if (event.currentTarget === event.target) {
|
|
110
|
+
if (event.animationName === motion.collapse.name ||
|
|
111
|
+
event.animationName === motion.expand.name) {
|
|
112
|
+
setState(expanded ? 'expanding' : 'collapsing');
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
if (typeof onAnimationStart !== 'undefined') {
|
|
116
|
+
onAnimationStart(event);
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
return (react_1.jsx(Panel, __assign({ ref: ref, as: Element, css: [
|
|
120
|
+
{
|
|
121
|
+
width: expanded ? expandedWidth : collapsedWidth,
|
|
122
|
+
maxWidth: expanded ? expandedWidth : collapsedWidth,
|
|
123
|
+
// mounted.current will be false on the first render, thus you won't get an unwanted animation here
|
|
124
|
+
// Will animate again if you force a re-render (like in Storybook)
|
|
125
|
+
animation: touched
|
|
126
|
+
? (expanded ? motion.expand : motion.collapse) + " 200ms ease-out"
|
|
127
|
+
: undefined,
|
|
128
|
+
},
|
|
129
|
+
containerVariantStyle[variant],
|
|
130
|
+
], onAnimationEnd: handleAnimationEnd, onAnimationStart: handleAnimationStart }, elemProps),
|
|
131
|
+
react_1.jsx(hooks_1.SidePanelContext.Provider, { value: {
|
|
132
|
+
state: state,
|
|
133
|
+
origin: origin,
|
|
134
|
+
} }, children)));
|
|
135
|
+
},
|
|
136
|
+
subComponents: {
|
|
137
|
+
/**
|
|
138
|
+
* `SidePanel.ToggleButton` is a control that is meant to toggle between `expanded = true` and
|
|
139
|
+
* `expanded = false` states. It must be used within the `SidePanel` component as a child. Use
|
|
140
|
+
* in conjunction with `useSidePanel`'s `controlProps`, otherwise it does not come with explicit
|
|
141
|
+
* `onClick` handlers.
|
|
142
|
+
*
|
|
143
|
+
* For accessibility purposes, it must be the first focusable element. We recommend that you
|
|
144
|
+
* keep it as the first child of `SidePanel`
|
|
145
|
+
*/
|
|
146
|
+
ToggleButton: SidePanelToggleButton_1.SidePanelToggleButton,
|
|
147
|
+
},
|
|
148
|
+
});
|
|
172
149
|
var templateObject_1;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ExtractProps } from '@workday/canvas-kit-react/common';
|
|
2
|
+
import { TertiaryButton } from '@workday/canvas-kit-react/button';
|
|
3
|
+
export interface SidePanelToggleButtonProps extends ExtractProps<typeof TertiaryButton, never> {
|
|
4
|
+
/**
|
|
5
|
+
* The tooltip text to expand the side panel
|
|
6
|
+
*/
|
|
7
|
+
tooltipTextExpand?: string;
|
|
8
|
+
/**
|
|
9
|
+
* The tooltip text to collapse the side panel
|
|
10
|
+
*/
|
|
11
|
+
tooltipTextCollapse?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* A toggle button styled specifically for the side panel container.
|
|
15
|
+
*/
|
|
16
|
+
export declare const SidePanelToggleButton: import("@workday/canvas-kit-react/common").ElementComponent<"button", SidePanelToggleButtonProps>;
|
|
17
|
+
//# sourceMappingURL=SidePanelToggleButton.d.ts.map
|