@workday/canvas-kit-preview-react 7.0.0-alpha.129-next.3 → 7.0.0-alpha.256-next.2
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 -11
- package/dist/commonjs/form-field/lib/FormField.d.ts.map +1 -1
- package/dist/commonjs/form-field/lib/FormFieldHint.d.ts +1 -1
- package/dist/commonjs/form-field/lib/FormFieldHint.d.ts.map +1 -1
- package/dist/commonjs/form-field/lib/FormFieldHint.js +2 -3
- package/dist/commonjs/form-field/lib/FormFieldInput.d.ts +1 -1
- package/dist/commonjs/form-field/lib/FormFieldLabel.d.ts.map +1 -1
- package/dist/commonjs/form-field/lib/FormFieldLabel.js +3 -9
- package/dist/commonjs/index.d.ts +2 -1
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +2 -2
- package/dist/commonjs/menu/lib/Menu.d.ts +37 -13
- package/dist/commonjs/menu/lib/Menu.d.ts.map +1 -1
- package/dist/commonjs/menu/lib/Menu.js +42 -22
- package/dist/commonjs/menu/lib/MenuItem.d.ts +35 -13
- package/dist/commonjs/menu/lib/MenuItem.d.ts.map +1 -1
- package/dist/commonjs/menu/lib/MenuItem.js +24 -10
- package/dist/commonjs/pill/lib/Pill.d.ts +0 -10
- package/dist/commonjs/pill/lib/Pill.d.ts.map +1 -1
- package/dist/commonjs/segmented-control/index.d.ts +3 -0
- package/dist/commonjs/segmented-control/index.d.ts.map +1 -0
- package/dist/commonjs/segmented-control/index.js +14 -0
- package/dist/commonjs/segmented-control/lib/SegmentedControl.d.ts +1004 -0
- package/dist/commonjs/segmented-control/lib/SegmentedControl.d.ts.map +1 -0
- package/dist/commonjs/segmented-control/lib/SegmentedControl.js +22 -0
- package/dist/commonjs/segmented-control/lib/SegmentedControlItem.d.ts +103 -0
- package/dist/commonjs/segmented-control/lib/SegmentedControlItem.d.ts.map +1 -0
- package/dist/commonjs/segmented-control/lib/SegmentedControlItem.js +130 -0
- package/dist/commonjs/segmented-control/lib/SegmentedControlList.d.ts +66 -0
- package/dist/commonjs/segmented-control/lib/SegmentedControlList.d.ts.map +1 -0
- package/dist/commonjs/{breadcrumbs/lib/Breadcrumbs/Dropdown/MenuItemLink.js → segmented-control/lib/SegmentedControlList.js} +21 -28
- package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlItem.d.ts +60 -0
- package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlItem.d.ts.map +1 -0
- package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlItem.js +23 -0
- package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlModel.d.ts +1052 -0
- package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlModel.d.ts.map +1 -0
- package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlModel.js +74 -0
- package/dist/commonjs/select/index.d.ts.map +1 -1
- package/dist/commonjs/status-indicator/index.d.ts +2 -0
- package/dist/commonjs/status-indicator/index.d.ts.map +1 -0
- package/dist/commonjs/{breadcrumbs → status-indicator}/index.js +1 -1
- package/dist/commonjs/status-indicator/lib/StatusIndicator.d.ts +42 -0
- package/dist/commonjs/status-indicator/lib/StatusIndicator.d.ts.map +1 -0
- package/dist/commonjs/status-indicator/lib/StatusIndicator.js +55 -0
- package/dist/commonjs/status-indicator/lib/StatusIndicatorIcon.d.ts +73 -0
- package/dist/commonjs/status-indicator/lib/StatusIndicatorIcon.d.ts.map +1 -0
- package/dist/commonjs/status-indicator/lib/StatusIndicatorIcon.js +98 -0
- package/dist/commonjs/status-indicator/lib/StatusIndicatorLabel.d.ts +5 -0
- package/dist/commonjs/status-indicator/lib/StatusIndicatorLabel.d.ts.map +1 -0
- package/dist/commonjs/{breadcrumbs/lib/Breadcrumbs/Nav.js → status-indicator/lib/StatusIndicatorLabel.js} +10 -6
- package/dist/commonjs/status-indicator/lib/hooks/index.d.ts +2 -0
- package/dist/commonjs/status-indicator/lib/hooks/index.d.ts.map +1 -0
- package/dist/commonjs/status-indicator/lib/hooks/index.js +13 -0
- package/dist/commonjs/status-indicator/lib/hooks/useStatusIndicatorModel.d.ts +75 -0
- package/dist/commonjs/status-indicator/lib/hooks/useStatusIndicatorModel.d.ts.map +1 -0
- package/dist/commonjs/status-indicator/lib/hooks/useStatusIndicatorModel.js +34 -0
- package/dist/commonjs/text-area/lib/TextArea.d.ts +2 -11
- package/dist/commonjs/text-area/lib/TextArea.d.ts.map +1 -1
- package/dist/commonjs/text-area/lib/TextAreaField.d.ts +1 -1
- package/dist/commonjs/text-area/lib/TextAreaField.d.ts.map +1 -1
- package/dist/commonjs/text-area/lib/TextAreaField.js +15 -7
- package/dist/commonjs/text-input/lib/TextInput.d.ts +2 -11
- package/dist/commonjs/text-input/lib/TextInput.d.ts.map +1 -1
- package/dist/commonjs/text-input/lib/TextInputField.d.ts +1 -1
- package/dist/commonjs/text-input/lib/TextInputField.d.ts.map +1 -1
- package/dist/commonjs/text-input/lib/TextInputField.js +14 -7
- package/dist/es6/form-field/lib/FormField.d.ts +2 -11
- package/dist/es6/form-field/lib/FormField.d.ts.map +1 -1
- package/dist/es6/form-field/lib/FormFieldHint.d.ts +1 -1
- package/dist/es6/form-field/lib/FormFieldHint.d.ts.map +1 -1
- package/dist/es6/form-field/lib/FormFieldHint.js +4 -5
- package/dist/es6/form-field/lib/FormFieldInput.d.ts +1 -1
- package/dist/es6/form-field/lib/FormFieldLabel.d.ts.map +1 -1
- package/dist/es6/form-field/lib/FormFieldLabel.js +5 -11
- package/dist/es6/index.d.ts +2 -1
- package/dist/es6/index.d.ts.map +1 -1
- package/dist/es6/index.js +2 -2
- package/dist/es6/menu/lib/Menu.d.ts +37 -13
- package/dist/es6/menu/lib/Menu.d.ts.map +1 -1
- package/dist/es6/menu/lib/Menu.js +41 -21
- package/dist/es6/menu/lib/MenuItem.d.ts +35 -13
- package/dist/es6/menu/lib/MenuItem.d.ts.map +1 -1
- package/dist/es6/menu/lib/MenuItem.js +23 -9
- package/dist/es6/pill/lib/Pill.d.ts +0 -10
- package/dist/es6/pill/lib/Pill.d.ts.map +1 -1
- package/dist/es6/segmented-control/index.d.ts +3 -0
- package/dist/es6/segmented-control/index.d.ts.map +1 -0
- package/dist/es6/segmented-control/index.js +2 -0
- package/dist/es6/segmented-control/lib/SegmentedControl.d.ts +1004 -0
- package/dist/es6/segmented-control/lib/SegmentedControl.d.ts.map +1 -0
- package/dist/es6/segmented-control/lib/SegmentedControl.js +16 -0
- package/dist/es6/segmented-control/lib/SegmentedControlItem.d.ts +103 -0
- package/dist/es6/segmented-control/lib/SegmentedControlItem.d.ts.map +1 -0
- package/dist/es6/segmented-control/lib/SegmentedControlItem.js +108 -0
- package/dist/es6/segmented-control/lib/SegmentedControlList.d.ts +66 -0
- package/dist/es6/segmented-control/lib/SegmentedControlList.d.ts.map +1 -0
- package/dist/es6/segmented-control/lib/SegmentedControlList.js +44 -0
- package/dist/es6/segmented-control/lib/hooks/useSegmentedControlItem.d.ts +60 -0
- package/dist/es6/segmented-control/lib/hooks/useSegmentedControlItem.d.ts.map +1 -0
- package/dist/es6/segmented-control/lib/hooks/useSegmentedControlItem.js +20 -0
- package/dist/es6/segmented-control/lib/hooks/useSegmentedControlModel.d.ts +1052 -0
- package/dist/es6/segmented-control/lib/hooks/useSegmentedControlModel.d.ts.map +1 -0
- package/dist/es6/segmented-control/lib/hooks/useSegmentedControlModel.js +68 -0
- package/dist/es6/select/index.d.ts.map +1 -1
- package/dist/es6/status-indicator/index.d.ts +2 -0
- package/dist/es6/status-indicator/index.d.ts.map +1 -0
- package/dist/es6/status-indicator/index.js +1 -0
- package/dist/es6/status-indicator/lib/StatusIndicator.d.ts +42 -0
- package/dist/es6/status-indicator/lib/StatusIndicator.d.ts.map +1 -0
- package/dist/es6/status-indicator/lib/StatusIndicator.js +49 -0
- package/dist/es6/status-indicator/lib/StatusIndicatorIcon.d.ts +73 -0
- package/dist/es6/status-indicator/lib/StatusIndicatorIcon.d.ts.map +1 -0
- package/dist/es6/status-indicator/lib/StatusIndicatorIcon.js +92 -0
- package/dist/es6/status-indicator/lib/StatusIndicatorLabel.d.ts +5 -0
- package/dist/es6/status-indicator/lib/StatusIndicatorLabel.d.ts.map +1 -0
- package/dist/es6/{breadcrumbs/lib/Breadcrumbs/Nav.js → status-indicator/lib/StatusIndicatorLabel.js} +9 -4
- package/dist/es6/status-indicator/lib/hooks/index.d.ts +2 -0
- package/dist/es6/status-indicator/lib/hooks/index.d.ts.map +1 -0
- package/dist/es6/status-indicator/lib/hooks/index.js +1 -0
- package/dist/es6/status-indicator/lib/hooks/useStatusIndicatorModel.d.ts +75 -0
- package/dist/es6/status-indicator/lib/hooks/useStatusIndicatorModel.d.ts.map +1 -0
- package/dist/es6/status-indicator/lib/hooks/useStatusIndicatorModel.js +31 -0
- package/dist/es6/text-area/lib/TextArea.d.ts +2 -11
- package/dist/es6/text-area/lib/TextArea.d.ts.map +1 -1
- package/dist/es6/text-area/lib/TextAreaField.d.ts +1 -1
- package/dist/es6/text-area/lib/TextAreaField.d.ts.map +1 -1
- package/dist/es6/text-area/lib/TextAreaField.js +15 -7
- package/dist/es6/text-input/lib/TextInput.d.ts +2 -11
- package/dist/es6/text-input/lib/TextInput.d.ts.map +1 -1
- package/dist/es6/text-input/lib/TextInputField.d.ts +1 -1
- package/dist/es6/text-input/lib/TextInputField.d.ts.map +1 -1
- package/dist/es6/text-input/lib/TextInputField.js +14 -7
- package/form-field/lib/FormFieldHint.tsx +23 -30
- package/form-field/lib/FormFieldLabel.tsx +14 -24
- package/index.ts +2 -3
- package/menu/lib/Menu.tsx +73 -26
- package/menu/lib/MenuItem.tsx +51 -16
- package/package.json +6 -5
- package/segmented-control/LICENSE +126 -0
- package/segmented-control/README.md +6 -0
- package/segmented-control/index.ts +2 -0
- package/segmented-control/lib/SegmentedControl.tsx +21 -0
- package/segmented-control/lib/SegmentedControlItem.tsx +175 -0
- package/segmented-control/lib/SegmentedControlList.tsx +49 -0
- package/segmented-control/lib/hooks/useSegmentedControlItem.tsx +37 -0
- package/segmented-control/lib/hooks/useSegmentedControlModel.tsx +75 -0
- package/segmented-control/package.json +6 -0
- package/select/index.ts +0 -1
- package/{breadcrumbs → status-indicator}/LICENSE +1 -1
- package/status-indicator/README.md +12 -0
- package/status-indicator/index.ts +1 -0
- package/status-indicator/lib/StatusIndicator.tsx +49 -0
- package/status-indicator/lib/StatusIndicatorIcon.tsx +88 -0
- package/status-indicator/lib/StatusIndicatorLabel.tsx +28 -0
- package/status-indicator/lib/hooks/index.ts +1 -0
- package/status-indicator/lib/hooks/useStatusIndicatorModel.tsx +29 -0
- package/status-indicator/package.json +6 -0
- package/text-area/lib/TextAreaField.tsx +1 -1
- package/text-input/lib/TextInputField.tsx +1 -1
- package/breadcrumbs/README.md +0 -7
- package/breadcrumbs/index.ts +0 -1
- package/breadcrumbs/lib/Breadcrumbs/Dropdown/Button.tsx +0 -85
- package/breadcrumbs/lib/Breadcrumbs/Dropdown/Menu.tsx +0 -152
- package/breadcrumbs/lib/Breadcrumbs/Dropdown/MenuItemLink.tsx +0 -63
- package/breadcrumbs/lib/Breadcrumbs/Dropdown/hooks.ts +0 -109
- package/breadcrumbs/lib/Breadcrumbs/Dropdown/index.tsx +0 -38
- package/breadcrumbs/lib/Breadcrumbs/List/Collapsible.tsx +0 -66
- package/breadcrumbs/lib/Breadcrumbs/List/CurrentItem.tsx +0 -64
- package/breadcrumbs/lib/Breadcrumbs/List/Link.tsx +0 -88
- package/breadcrumbs/lib/Breadcrumbs/List/ListItem.tsx +0 -30
- package/breadcrumbs/lib/Breadcrumbs/List/hooks.ts +0 -114
- package/breadcrumbs/lib/Breadcrumbs/List/index.tsx +0 -26
- package/breadcrumbs/lib/Breadcrumbs/List/styles.ts +0 -12
- package/breadcrumbs/lib/Breadcrumbs/Nav.tsx +0 -14
- package/breadcrumbs/lib/Breadcrumbs/hooks.ts +0 -13
- package/breadcrumbs/lib/Breadcrumbs/index.tsx +0 -15
- package/breadcrumbs/lib/Breadcrumbs/types.ts +0 -7
- package/breadcrumbs/package.json +0 -6
- package/dist/commonjs/breadcrumbs/index.d.ts +0 -2
- package/dist/commonjs/breadcrumbs/index.d.ts.map +0 -1
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/Button.d.ts +0 -20
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/Button.d.ts.map +0 -1
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/Button.js +0 -69
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/Menu.d.ts +0 -38
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/Menu.d.ts.map +0 -1
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/Menu.js +0 -94
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/MenuItemLink.d.ts +0 -14
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/MenuItemLink.d.ts.map +0 -1
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/hooks.d.ts +0 -13
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/hooks.d.ts.map +0 -1
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/hooks.js +0 -77
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/index.d.ts +0 -8
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/index.d.ts.map +0 -1
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/index.js +0 -37
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/Collapsible.d.ts +0 -16
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/Collapsible.d.ts.map +0 -1
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/Collapsible.js +0 -78
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/CurrentItem.d.ts +0 -11
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/CurrentItem.d.ts.map +0 -1
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/CurrentItem.js +0 -49
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/Link.d.ts +0 -19
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/Link.d.ts.map +0 -1
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/Link.js +0 -66
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/ListItem.d.ts +0 -4
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/ListItem.d.ts.map +0 -1
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/ListItem.js +0 -43
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/hooks.d.ts +0 -19
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/hooks.d.ts.map +0 -1
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/hooks.js +0 -116
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/index.d.ts +0 -4
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/index.d.ts.map +0 -1
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/index.js +0 -26
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/styles.d.ts +0 -3
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/styles.d.ts.map +0 -1
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/styles.js +0 -16
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Nav.d.ts +0 -11
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Nav.d.ts.map +0 -1
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/hooks.d.ts +0 -5
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/hooks.d.ts.map +0 -1
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/hooks.js +0 -12
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/index.d.ts +0 -9
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/index.d.ts.map +0 -1
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/index.js +0 -17
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/types.d.ts +0 -8
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/types.d.ts.map +0 -1
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/types.js +0 -2
- package/dist/es6/breadcrumbs/index.d.ts +0 -2
- package/dist/es6/breadcrumbs/index.d.ts.map +0 -1
- package/dist/es6/breadcrumbs/index.js +0 -1
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/Button.d.ts +0 -20
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/Button.d.ts.map +0 -1
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/Button.js +0 -63
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/Menu.d.ts +0 -38
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/Menu.d.ts.map +0 -1
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/Menu.js +0 -87
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/MenuItemLink.d.ts +0 -14
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/MenuItemLink.d.ts.map +0 -1
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/MenuItemLink.js +0 -51
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/hooks.d.ts +0 -13
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/hooks.d.ts.map +0 -1
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/hooks.js +0 -72
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/index.d.ts +0 -8
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/index.d.ts.map +0 -1
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/index.js +0 -30
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/Collapsible.d.ts +0 -16
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/Collapsible.d.ts.map +0 -1
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/Collapsible.js +0 -55
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/CurrentItem.d.ts +0 -11
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/CurrentItem.d.ts.map +0 -1
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/CurrentItem.js +0 -42
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/Link.d.ts +0 -19
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/Link.d.ts.map +0 -1
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/Link.js +0 -59
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/ListItem.d.ts +0 -4
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/ListItem.d.ts.map +0 -1
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/ListItem.js +0 -36
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/hooks.d.ts +0 -19
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/hooks.d.ts.map +0 -1
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/hooks.js +0 -91
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/index.d.ts +0 -4
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/index.d.ts.map +0 -1
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/index.js +0 -20
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/styles.d.ts +0 -3
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/styles.d.ts.map +0 -1
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/styles.js +0 -12
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/Nav.d.ts +0 -11
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/Nav.d.ts.map +0 -1
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/hooks.d.ts +0 -5
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/hooks.d.ts.map +0 -1
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/hooks.js +0 -8
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/index.d.ts +0 -9
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/index.d.ts.map +0 -1
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/index.js +0 -14
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/types.d.ts +0 -8
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/types.d.ts.map +0 -1
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/types.js +0 -1
|
@@ -26,16 +26,7 @@ export declare const TextInput: import("@workday/canvas-kit-react/common").Eleme
|
|
|
26
26
|
};
|
|
27
27
|
events: {};
|
|
28
28
|
}> & {
|
|
29
|
-
|
|
30
|
-
state: {
|
|
31
|
-
id: string;
|
|
32
|
-
hasError: boolean;
|
|
33
|
-
isRequired: boolean;
|
|
34
|
-
};
|
|
35
|
-
events: {};
|
|
36
|
-
}>;
|
|
37
|
-
} & {
|
|
38
|
-
Field: import("@workday/canvas-kit-react/common").ElementComponentM<"input", import("@workday/canvas-kit-react/layout").BorderShorthandStyleProps & import("@workday/canvas-kit-react/layout").BorderColorStyleProps & import("@workday/canvas-kit-react/layout").BorderRadiusStyleProps & import("@workday/canvas-kit-react/layout").BorderLineStyleProps & import("@workday/canvas-kit-react/layout").BorderWidthStyleProps & import("@workday/canvas-kit-react/layout").BorderLogicalStyleProps & import("@workday/canvas-kit-react/layout").ColorStyleProps & import("@workday/canvas-kit-react/layout").DepthStyleProps & import("@workday/canvas-kit-react/layout").FlexItemStyleProps & import("@workday/canvas-kit-react/layout").LayoutStyleProps & import("@workday/canvas-kit-react/layout/lib/utils/other").OtherStyleProps & import("@workday/canvas-kit-react/layout").PositionStandardProps & import("@workday/canvas-kit-react/layout").PositionLogicalProps & import("@workday/canvas-kit-react/layout/lib/utils/space").SpaceStandardProps & import("@workday/canvas-kit-react/layout/lib/utils/space").SpaceLogicalProps & import("@workday/canvas-kit-react/common").PropsWithModel<{
|
|
29
|
+
Field: import("@workday/canvas-kit-react/common").ElementComponentM<"input", import("@workday/canvas-kit-react/layout").BackgroundStyleProps & import("@workday/canvas-kit-react/layout/lib/utils/border/color").BorderColorStyleProps & import("@workday/canvas-kit-react/layout/lib/utils/border/lineStyle").BorderLineStyleProps & import("@workday/canvas-kit-react/layout/lib/utils/border/radius").BorderRadiusStyleProps & import("@workday/canvas-kit-react/layout/lib/utils/border/shorthand").BorderShorthandStyleProps & import("@workday/canvas-kit-react/layout/lib/utils/border/width").BorderWidthStyleProps & import("@workday/canvas-kit-react/layout").ColorStyleProps & import("@workday/canvas-kit-react/layout").DepthStyleProps & import("@workday/canvas-kit-react/layout").FlexItemStyleProps & import("@workday/canvas-kit-react/layout").GridItemStyleProps & import("@workday/canvas-kit-react/layout").LayoutStyleProps & import("@workday/canvas-kit-react/layout").OtherStyleProps & import("@workday/canvas-kit-react/layout").PositionStyleProps & import("@workday/canvas-kit-react/layout").SpaceStyleProps & import("@workday/canvas-kit-react/layout").TextStyleProps & import("@workday/canvas-kit-react/common").PropsWithModel<{
|
|
39
30
|
state: {
|
|
40
31
|
id: string;
|
|
41
32
|
hasError: boolean;
|
|
@@ -58,7 +49,7 @@ export declare const TextInput: import("@workday/canvas-kit-react/common").Eleme
|
|
|
58
49
|
};
|
|
59
50
|
events: {};
|
|
60
51
|
}>;
|
|
61
|
-
Hint: import("@workday/canvas-kit-react/common").ElementComponentM<"p", import("@workday/canvas-kit-react/
|
|
52
|
+
Hint: import("@workday/canvas-kit-react/common").ElementComponentM<"p", Pick<import("@workday/canvas-kit-react/text").TypeLevelProps, "top" | "left" | "right" | "bottom" | "fill" | "children" | "color" | "resize" | "width" | "height" | "alignSelf" | "appearance" | "backgroundAttachment" | "backgroundColor" | "backgroundImage" | "backgroundRepeat" | "backgroundSize" | "borderBottomColor" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderBottomStyle" | "borderBottomWidth" | "borderCollapse" | "borderInlineEndColor" | "borderInlineEndStyle" | "borderInlineEndWidth" | "borderInlineStartColor" | "borderInlineStartStyle" | "borderInlineStartWidth" | "borderLeftColor" | "borderLeftStyle" | "borderLeftWidth" | "borderRightColor" | "borderRightStyle" | "borderRightWidth" | "borderSpacing" | "borderTopColor" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderTopStyle" | "borderTopWidth" | "boxShadow" | "boxSizing" | "content" | "cursor" | "display" | "flexBasis" | "flexGrow" | "flexShrink" | "float" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "gridColumnEnd" | "gridColumnStart" | "gridRowEnd" | "gridRowStart" | "insetInlineEnd" | "insetInlineStart" | "justifySelf" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "objectFit" | "objectPosition" | "opacity" | "order" | "outlineOffset" | "overflowWrap" | "overflowX" | "overflowY" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "pointerEvents" | "position" | "textAlign" | "textOverflow" | "textShadow" | "textTransform" | "transform" | "userSelect" | "verticalAlign" | "visibility" | "whiteSpace" | "wordBreak" | "zIndex" | "animation" | "background" | "backgroundPosition" | "border" | "borderBottom" | "borderColor" | "borderInlineEnd" | "borderInlineStart" | "borderLeft" | "borderRadius" | "borderRight" | "borderStyle" | "borderTop" | "borderWidth" | "flex" | "gridArea" | "gridColumn" | "gridRow" | "listStyle" | "margin" | "outline" | "overflow" | "padding" | "placeSelf" | "textDecoration" | "transition" | "stroke" | "depth" | "marginX" | "marginY" | "paddingX" | "paddingY" | "variant">, {
|
|
62
53
|
state: {
|
|
63
54
|
id: string;
|
|
64
55
|
hasError: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../../../../text-input/lib/TextInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAkB,YAAY,EAAC,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAC,SAAS,EAA0B,MAAM,8CAA8C,CAAC;AAMhG,MAAM,WAAW,cAAe,SAAQ,YAAY,CAAC,OAAO,SAAS,EAAE,KAAK,CAAC;IAC3E;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../../../../text-input/lib/TextInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAkB,YAAY,EAAC,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAC,SAAS,EAA0B,MAAM,8CAA8C,CAAC;AAMhG,MAAM,WAAW,cAAe,SAAQ,YAAY,CAAC,OAAO,SAAS,EAAE,KAAK,CAAC;IAC3E;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgBpB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const TextInputField: import("@workday/canvas-kit-react/common").ElementComponentM<"input", import("@workday/canvas-kit-react/layout").
|
|
1
|
+
export declare const TextInputField: import("@workday/canvas-kit-react/common").ElementComponentM<"input", import("@workday/canvas-kit-react/layout").BackgroundStyleProps & import("@workday/canvas-kit-react/layout/lib/utils/border/color").BorderColorStyleProps & import("@workday/canvas-kit-react/layout/lib/utils/border/lineStyle").BorderLineStyleProps & import("@workday/canvas-kit-react/layout/lib/utils/border/radius").BorderRadiusStyleProps & import("@workday/canvas-kit-react/layout/lib/utils/border/shorthand").BorderShorthandStyleProps & import("@workday/canvas-kit-react/layout/lib/utils/border/width").BorderWidthStyleProps & import("@workday/canvas-kit-react/layout").ColorStyleProps & import("@workday/canvas-kit-react/layout").DepthStyleProps & import("@workday/canvas-kit-react/layout").FlexItemStyleProps & import("@workday/canvas-kit-react/layout").GridItemStyleProps & import("@workday/canvas-kit-react/layout").LayoutStyleProps & import("@workday/canvas-kit-react/layout").OtherStyleProps & import("@workday/canvas-kit-react/layout").PositionStyleProps & import("@workday/canvas-kit-react/layout").SpaceStyleProps & import("@workday/canvas-kit-react/layout").TextStyleProps & import("@workday/canvas-kit-react/common").PropsWithModel<{
|
|
2
2
|
state: {
|
|
3
3
|
id: string;
|
|
4
4
|
hasError: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInputField.d.ts","sourceRoot":"","sources":["../../../../text-input/lib/TextInputField.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TextInputField.d.ts","sourceRoot":"","sources":["../../../../text-input/lib/TextInputField.tsx"],"names":[],"mappings":"AAyCA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;EAiCzB,CAAC"}
|
|
@@ -17,22 +17,29 @@ import { createSubcomponent, useTheme } from '@workday/canvas-kit-react/common';
|
|
|
17
17
|
import { useThemedRing } from '@workday/canvas-kit-labs-react/common';
|
|
18
18
|
import { FormField } from '@workday/canvas-kit-preview-react/form-field';
|
|
19
19
|
import { useTextInputField, useTextInputModel } from './hooks';
|
|
20
|
-
var baseStyles =
|
|
20
|
+
var baseStyles = {
|
|
21
|
+
transition: '0.2s box-shadow, 0.2s border-color',
|
|
22
|
+
'&::placeholder': {
|
|
21
23
|
color: inputColors.placeholder,
|
|
22
|
-
},
|
|
24
|
+
},
|
|
25
|
+
'&:hover': {
|
|
23
26
|
borderColor: inputColors.hoverBorder,
|
|
24
|
-
},
|
|
27
|
+
},
|
|
28
|
+
'&:focus:not([disabled])': {
|
|
25
29
|
outline: 'none',
|
|
26
|
-
},
|
|
30
|
+
},
|
|
31
|
+
'&:disabled': {
|
|
27
32
|
backgroundColor: inputColors.disabled.background,
|
|
28
33
|
borderColor: inputColors.disabled.border,
|
|
29
34
|
color: inputColors.disabled.text,
|
|
30
35
|
'&::placeholder': {
|
|
31
36
|
color: inputColors.disabled.text,
|
|
32
37
|
},
|
|
33
|
-
},
|
|
38
|
+
},
|
|
39
|
+
'::-ms-clear': {
|
|
34
40
|
display: 'none',
|
|
35
|
-
}
|
|
41
|
+
},
|
|
42
|
+
};
|
|
36
43
|
export var TextInputField = createSubcomponent('input')({
|
|
37
44
|
displayName: 'TextInput.Field',
|
|
38
45
|
modelHook: useTextInputModel,
|
|
@@ -48,5 +55,5 @@ export var TextInputField = createSubcomponent('input')({
|
|
|
48
55
|
boxShadow: "inset 0 0 0 1px " + theme.canvas.palette.common.focusOutline,
|
|
49
56
|
},
|
|
50
57
|
};
|
|
51
|
-
return (jsx(FormField.Input, __assign({ as: "input", css: [baseStyles, focusStyles], padding: space.xxs, margin: 0, display: "block", height: "40px", minWidth: "280px", border: "1px solid " + inputColors.border, backgroundColor: inputColors.background, borderRadius: borderRadius.m }, elemProps)));
|
|
58
|
+
return (jsx(FormField.Input, __assign({ as: "input" }, type.levels.subtext.large, { css: [baseStyles, focusStyles], padding: space.xxs, margin: 0, display: "block", height: "40px", minWidth: "280px", border: "1px solid " + inputColors.border, backgroundColor: inputColors.background, borderRadius: borderRadius.m }, elemProps)));
|
|
52
59
|
});
|
|
@@ -1,40 +1,33 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
ExtractProps,
|
|
5
|
-
useTheme,
|
|
6
|
-
styled,
|
|
7
|
-
StyledType,
|
|
8
|
-
} from '@workday/canvas-kit-react/common';
|
|
9
|
-
import {space, type} from '@workday/canvas-kit-react/tokens';
|
|
10
|
-
import {Box, BoxProps} from '@workday/canvas-kit-react/layout';
|
|
2
|
+
import {createSubcomponent, ExtractProps, useTheme} from '@workday/canvas-kit-react/common';
|
|
3
|
+
import {space} from '@workday/canvas-kit-react/tokens';
|
|
11
4
|
|
|
12
5
|
import {useFormFieldHint, useFormFieldModel} from './hooks';
|
|
13
|
-
|
|
14
|
-
const StyledHint = styled(Box)<StyledType & BoxProps>({
|
|
15
|
-
...type.levels.subtext.medium,
|
|
16
|
-
});
|
|
6
|
+
import {Subtext} from '@workday/canvas-kit-react/text';
|
|
17
7
|
|
|
18
8
|
export const FormFieldHint = createSubcomponent('p')({
|
|
19
9
|
displayName: 'FormField.Hint',
|
|
20
10
|
modelHook: useFormFieldModel,
|
|
21
11
|
elemPropsHook: useFormFieldHint,
|
|
22
|
-
})<ExtractProps<typeof
|
|
23
|
-
|
|
12
|
+
})<Omit<ExtractProps<typeof Subtext, never>, 'size'>>(
|
|
13
|
+
({children, ...elemProps}, Element, model) => {
|
|
14
|
+
const theme = useTheme();
|
|
24
15
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
16
|
+
if (!children) {
|
|
17
|
+
// If there is no hint text just skip rendering
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
29
20
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
21
|
+
return (
|
|
22
|
+
<Subtext
|
|
23
|
+
as={Element}
|
|
24
|
+
size="medium"
|
|
25
|
+
color={model.state.hasError ? theme.canvas.palette.error.main : undefined}
|
|
26
|
+
marginY={space.xxs}
|
|
27
|
+
{...elemProps}
|
|
28
|
+
>
|
|
29
|
+
{children}
|
|
30
|
+
</Subtext>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
);
|
|
@@ -1,15 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
useTheme,
|
|
7
|
-
styled,
|
|
8
|
-
StyledType,
|
|
9
|
-
} from '@workday/canvas-kit-react/common';
|
|
10
|
-
import {Box, HStack, StackSpacing} from '@workday/canvas-kit-react/layout';
|
|
11
|
-
import {type} from '@workday/canvas-kit-react/tokens';
|
|
12
|
-
|
|
3
|
+
import {createSubcomponent, ExtractProps, useTheme} from '@workday/canvas-kit-react/common';
|
|
4
|
+
import {HStack, StackSpacing} from '@workday/canvas-kit-react/layout';
|
|
5
|
+
import {LabelText, Text} from '@workday/canvas-kit-react/text';
|
|
13
6
|
import {useFormFieldLabel, useFormFieldModel} from './hooks';
|
|
14
7
|
|
|
15
8
|
export interface FormFieldLabelProps extends Omit<ExtractProps<typeof HStack, never>, 'spacing'> {
|
|
@@ -24,17 +17,6 @@ export interface FormFieldLabelProps extends Omit<ExtractProps<typeof HStack, ne
|
|
|
24
17
|
spacing?: StackSpacing;
|
|
25
18
|
}
|
|
26
19
|
|
|
27
|
-
const StyledFormFieldLabel = styled('span')({
|
|
28
|
-
...type.levels.subtext.large,
|
|
29
|
-
fontWeight: type.properties.fontWeights.medium,
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
const StyledAsterisk = styled(Box)<StyledType>({
|
|
33
|
-
fontSize: type.properties.fontSizes[20],
|
|
34
|
-
fontWeight: type.properties.fontWeights.regular,
|
|
35
|
-
textDecoration: 'unset',
|
|
36
|
-
});
|
|
37
|
-
|
|
38
20
|
export const FormFieldLabel = createSubcomponent('label')({
|
|
39
21
|
displayName: 'FormField.Label',
|
|
40
22
|
modelHook: useFormFieldModel,
|
|
@@ -44,11 +26,19 @@ export const FormFieldLabel = createSubcomponent('label')({
|
|
|
44
26
|
|
|
45
27
|
return (
|
|
46
28
|
<HStack as={Element} spacing={spacing} minWidth="180px" {...elemProps}>
|
|
47
|
-
<
|
|
29
|
+
<LabelText as="span" fontWeight="medium">
|
|
30
|
+
{children}
|
|
31
|
+
</LabelText>
|
|
48
32
|
{model.state.isRequired && (
|
|
49
|
-
<
|
|
33
|
+
<Text
|
|
34
|
+
fontSize={20}
|
|
35
|
+
fontWeight="regular"
|
|
36
|
+
textDecoration="unset"
|
|
37
|
+
color={theme.canvas.palette.error.main}
|
|
38
|
+
aria-hidden="true"
|
|
39
|
+
>
|
|
50
40
|
*
|
|
51
|
-
</
|
|
41
|
+
</Text>
|
|
52
42
|
)}
|
|
53
43
|
</HStack>
|
|
54
44
|
);
|
package/index.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
export * from './breadcrumbs';
|
|
2
1
|
export * from './color-picker';
|
|
3
2
|
export * from './form-field';
|
|
4
3
|
export * from './menu';
|
|
5
4
|
export * from './pill';
|
|
5
|
+
export * from './segmented-control';
|
|
6
6
|
export * from './select';
|
|
7
7
|
export * from './side-panel';
|
|
8
|
+
export * from './status-indicator';
|
|
8
9
|
export * from './text-area';
|
|
9
10
|
export * from './text-input';
|
|
10
|
-
|
|
11
|
-
/// <reference types="@types/node" />
|
package/menu/lib/Menu.tsx
CHANGED
|
@@ -1,23 +1,35 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import styled from '@emotion/styled';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import {DeprecatedMenuItemProps} from './MenuItem';
|
|
5
5
|
import {Card} from '@workday/canvas-kit-react/card';
|
|
6
6
|
import {commonColors, space, borderRadius} from '@workday/canvas-kit-react/tokens';
|
|
7
7
|
import {hideMouseFocus, GrowthBehavior, generateUniqueId} from '@workday/canvas-kit-react/common';
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* ### Deprecated Menu
|
|
11
|
+
*
|
|
12
|
+
* As of Canvas Kit v8, Menu is being soft-deprecated.
|
|
13
|
+
* It will be hard-deprecated (completely removed) in v9. Please see the
|
|
14
|
+
* [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
|
|
15
|
+
* for more information.
|
|
16
|
+
*/
|
|
17
|
+
export interface DeprecatedMenuProps
|
|
18
|
+
extends GrowthBehavior,
|
|
19
|
+
React.HTMLAttributes<HTMLUListElement> {
|
|
10
20
|
/**
|
|
11
|
-
* The
|
|
21
|
+
* The DeprecatedMenuItem children of the DeprecatedMenu (must be at least one). Also accepts other components which share the same interface as `DeprecatedMenuItem`.
|
|
12
22
|
*/
|
|
13
|
-
children?:
|
|
23
|
+
children?:
|
|
24
|
+
| React.ReactElement<DeprecatedMenuItemProps>
|
|
25
|
+
| React.ReactElement<DeprecatedMenuItemProps>[];
|
|
14
26
|
/**
|
|
15
|
-
* If true, set the
|
|
27
|
+
* If true, set the DeprecatedMenu to the open state. Useful for showing and hiding the DeprecatedMenu from a parent component such as a menu button.
|
|
16
28
|
* @default true
|
|
17
29
|
*/
|
|
18
30
|
isOpen?: boolean;
|
|
19
31
|
/**
|
|
20
|
-
* The width of the
|
|
32
|
+
* The width of the DeprecatedMenu. If no value is provided, the DeprecatedMenu will collapse around its content.
|
|
21
33
|
*/
|
|
22
34
|
width?: number | string;
|
|
23
35
|
/**
|
|
@@ -25,7 +37,7 @@ export interface MenuProps extends GrowthBehavior, React.HTMLAttributes<HTMLULis
|
|
|
25
37
|
*/
|
|
26
38
|
onSelect?: () => void;
|
|
27
39
|
/**
|
|
28
|
-
* The function called when the
|
|
40
|
+
* The function called when the DeprecatedMenu should close. This is called after a menu item is selected or if the escape shortcut key is used. This will not fire if the menu item sets `shouldClose` to false.
|
|
29
41
|
*/
|
|
30
42
|
onClose?: () => void;
|
|
31
43
|
/**
|
|
@@ -33,16 +45,24 @@ export interface MenuProps extends GrowthBehavior, React.HTMLAttributes<HTMLULis
|
|
|
33
45
|
*/
|
|
34
46
|
initialSelectedItem?: number;
|
|
35
47
|
/**
|
|
36
|
-
* The unique id of the
|
|
48
|
+
* The unique id of the DeprecatedMenu used for ARIA and HTML `id` attributes.
|
|
37
49
|
*/
|
|
38
50
|
id?: string;
|
|
39
51
|
/**
|
|
40
|
-
* The HTML `id` of the element that labels the
|
|
52
|
+
* The HTML `id` of the element that labels the DeprecatedMenu. Often used with menu buttons.
|
|
41
53
|
*/
|
|
42
54
|
'aria-labelledby'?: string;
|
|
43
55
|
}
|
|
44
56
|
|
|
45
|
-
|
|
57
|
+
/**
|
|
58
|
+
* ### Deprecated Menu State
|
|
59
|
+
*
|
|
60
|
+
* As of Canvas Kit v8, Menu is being soft-deprecated.
|
|
61
|
+
* It will be hard-deprecated (completely removed) in v9. Please see the
|
|
62
|
+
* [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
|
|
63
|
+
* for more information.
|
|
64
|
+
*/
|
|
65
|
+
export interface DeprecatedMenuState {
|
|
46
66
|
selectedItemIndex: number;
|
|
47
67
|
}
|
|
48
68
|
|
|
@@ -57,14 +77,22 @@ const List = styled('ul')({
|
|
|
57
77
|
...hideMouseFocus,
|
|
58
78
|
});
|
|
59
79
|
|
|
60
|
-
|
|
80
|
+
/**
|
|
81
|
+
* ### Deprecated Menu
|
|
82
|
+
*
|
|
83
|
+
* As of Canvas Kit v8, this component is being soft-deprecated.
|
|
84
|
+
* It will be hard-deprecated (completely removed) in v9. Please see the
|
|
85
|
+
* [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
|
|
86
|
+
* for more information.
|
|
87
|
+
*/
|
|
88
|
+
export class DeprecatedMenu extends React.Component<DeprecatedMenuProps, DeprecatedMenuState> {
|
|
61
89
|
private id = generateUniqueId();
|
|
62
90
|
private animateId!: number;
|
|
63
91
|
|
|
64
92
|
private menuRef: React.RefObject<HTMLUListElement>;
|
|
65
93
|
private firstCharacters!: string[];
|
|
66
94
|
|
|
67
|
-
constructor(props:
|
|
95
|
+
constructor(props: DeprecatedMenuProps) {
|
|
68
96
|
super(props);
|
|
69
97
|
this.menuRef = React.createRef();
|
|
70
98
|
|
|
@@ -79,7 +107,7 @@ export class Menu extends React.Component<MenuProps, MenuState> {
|
|
|
79
107
|
};
|
|
80
108
|
}
|
|
81
109
|
|
|
82
|
-
componentDidUpdate(prevProps:
|
|
110
|
+
componentDidUpdate(prevProps: DeprecatedMenuProps) {
|
|
83
111
|
if (this.props.children !== prevProps.children) {
|
|
84
112
|
this.setFirstCharacters();
|
|
85
113
|
this.setInitialSelectedItem();
|
|
@@ -95,6 +123,13 @@ export class Menu extends React.Component<MenuProps, MenuState> {
|
|
|
95
123
|
}
|
|
96
124
|
|
|
97
125
|
componentDidMount() {
|
|
126
|
+
console.warn(
|
|
127
|
+
`This component is being deprecated and will be removed in Canvas Kit V9.\n
|
|
128
|
+
For more information, please see the V8 upgrade guide:\n
|
|
129
|
+
https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page
|
|
130
|
+
`
|
|
131
|
+
);
|
|
132
|
+
|
|
98
133
|
this.setFirstCharacters();
|
|
99
134
|
this.setInitialSelectedItem();
|
|
100
135
|
}
|
|
@@ -119,6 +154,7 @@ export class Menu extends React.Component<MenuProps, MenuState> {
|
|
|
119
154
|
} = this.props;
|
|
120
155
|
const {selectedItemIndex} = this.state;
|
|
121
156
|
const cardWidth = grow ? '100%' : width;
|
|
157
|
+
let interactiveItemIndex: number | null = null;
|
|
122
158
|
|
|
123
159
|
return (
|
|
124
160
|
<Card display="inline-block" padding={space.zero} width={cardWidth} depth={3}>
|
|
@@ -133,17 +169,22 @@ export class Menu extends React.Component<MenuProps, MenuState> {
|
|
|
133
169
|
ref={this.menuRef}
|
|
134
170
|
{...elemProps}
|
|
135
171
|
>
|
|
136
|
-
{React.Children.map(children,
|
|
172
|
+
{React.Children.map(children, menuItem => {
|
|
137
173
|
if (!React.isValidElement(menuItem)) {
|
|
138
174
|
return;
|
|
139
175
|
}
|
|
140
|
-
|
|
176
|
+
let itemId;
|
|
177
|
+
if (!menuItem.props.isHeader) {
|
|
178
|
+
interactiveItemIndex = (interactiveItemIndex ?? -1) + 1;
|
|
179
|
+
itemId = `${id}-${interactiveItemIndex}`;
|
|
180
|
+
}
|
|
141
181
|
return (
|
|
142
182
|
<React.Fragment key={itemId}>
|
|
143
183
|
{React.cloneElement(menuItem, {
|
|
144
184
|
onClick: (event: React.MouseEvent) => this.handleClick(event, menuItem.props),
|
|
145
185
|
id: itemId,
|
|
146
|
-
isFocused:
|
|
186
|
+
isFocused:
|
|
187
|
+
selectedItemIndex === interactiveItemIndex && !menuItem.props.isHeader,
|
|
147
188
|
})}
|
|
148
189
|
</React.Fragment>
|
|
149
190
|
);
|
|
@@ -175,9 +216,12 @@ export class Menu extends React.Component<MenuProps, MenuState> {
|
|
|
175
216
|
const children = React.Children.toArray(this.props.children);
|
|
176
217
|
let nextSelectedIndex = 0;
|
|
177
218
|
let isShortcut = false;
|
|
178
|
-
const
|
|
179
|
-
|
|
180
|
-
|
|
219
|
+
const interactiveItems = children.filter(child => {
|
|
220
|
+
return !(child as React.ReactElement<DeprecatedMenuItemProps>)?.props?.isHeader;
|
|
221
|
+
});
|
|
222
|
+
const interactiveItemCount = interactiveItems.length;
|
|
223
|
+
const firstIndex = 0;
|
|
224
|
+
const lastIndex = interactiveItemCount - 1;
|
|
181
225
|
|
|
182
226
|
if (event.key.length === 1 && event.key.match(/\S/)) {
|
|
183
227
|
let start = this.state.selectedItemIndex + 1;
|
|
@@ -197,18 +241,16 @@ export class Menu extends React.Component<MenuProps, MenuState> {
|
|
|
197
241
|
switch (event.key) {
|
|
198
242
|
case 'ArrowUp':
|
|
199
243
|
case 'ArrowDown':
|
|
200
|
-
case 'Down': // IE/Edge specific value
|
|
201
|
-
case 'Up': // IE/Edge specific value
|
|
202
244
|
const direction = event.key === 'ArrowUp' ? -1 : 1;
|
|
203
245
|
isShortcut = true;
|
|
204
246
|
const nextIndex = this.state.selectedItemIndex + direction;
|
|
205
247
|
nextSelectedIndex =
|
|
206
|
-
nextIndex < 0 ?
|
|
248
|
+
nextIndex < 0 ? lastIndex : nextIndex >= interactiveItemCount ? firstIndex : nextIndex;
|
|
207
249
|
break;
|
|
208
250
|
|
|
209
251
|
case 'Home':
|
|
210
252
|
case 'End':
|
|
211
|
-
const skipTo = event.key === 'Home' ?
|
|
253
|
+
const skipTo = event.key === 'Home' ? firstIndex : lastIndex;
|
|
212
254
|
isShortcut = true;
|
|
213
255
|
nextSelectedIndex = skipTo;
|
|
214
256
|
break;
|
|
@@ -231,7 +273,9 @@ export class Menu extends React.Component<MenuProps, MenuState> {
|
|
|
231
273
|
case ' ':
|
|
232
274
|
case 'Enter':
|
|
233
275
|
nextSelectedIndex = this.state.selectedItemIndex;
|
|
234
|
-
const child =
|
|
276
|
+
const child = interactiveItems[this.state.selectedItemIndex] as React.ReactElement<
|
|
277
|
+
DeprecatedMenuItemProps
|
|
278
|
+
>;
|
|
235
279
|
this.handleClick(event, child.props);
|
|
236
280
|
isShortcut = true;
|
|
237
281
|
break;
|
|
@@ -248,11 +292,11 @@ export class Menu extends React.Component<MenuProps, MenuState> {
|
|
|
248
292
|
|
|
249
293
|
private handleClick = (
|
|
250
294
|
event: React.MouseEvent | React.KeyboardEvent,
|
|
251
|
-
menuItemProps:
|
|
295
|
+
menuItemProps: DeprecatedMenuItemProps
|
|
252
296
|
): void => {
|
|
253
297
|
/* istanbul ignore next line for coverage */
|
|
254
298
|
if (menuItemProps.isDisabled) {
|
|
255
|
-
// You should only hit this point if you are using a custom
|
|
299
|
+
// You should only hit this point if you are using a custom DeprecatedMenuItem implementation.
|
|
256
300
|
return;
|
|
257
301
|
}
|
|
258
302
|
if (menuItemProps.onClick) {
|
|
@@ -308,6 +352,9 @@ export class Menu extends React.Component<MenuProps, MenuState> {
|
|
|
308
352
|
};
|
|
309
353
|
|
|
310
354
|
const firstCharacters = React.Children.map(this.props.children, child => {
|
|
355
|
+
if ((child as React.ReactElement<DeprecatedMenuItemProps>)?.props?.isHeader) {
|
|
356
|
+
return;
|
|
357
|
+
}
|
|
311
358
|
return getFirstCharacter(child);
|
|
312
359
|
});
|
|
313
360
|
|
package/menu/lib/MenuItem.tsx
CHANGED
|
@@ -11,51 +11,64 @@ import {
|
|
|
11
11
|
import {CanvasSystemIcon} from '@workday/design-assets-types';
|
|
12
12
|
import {SystemIcon, SystemIconProps} from '@workday/canvas-kit-react/icon';
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
/**
|
|
15
|
+
* ### Deprecated Menu Item Props
|
|
16
|
+
*
|
|
17
|
+
* As of Canvas Kit v8, Menu is being soft-deprecated.
|
|
18
|
+
* It will be hard-deprecated (completely removed) in v9. Please see the
|
|
19
|
+
* [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
|
|
20
|
+
* for more information.
|
|
21
|
+
*/
|
|
22
|
+
export interface DeprecatedMenuItemProps extends React.LiHTMLAttributes<HTMLLIElement> {
|
|
15
23
|
/**
|
|
16
|
-
* The function called when the
|
|
24
|
+
* The function called when the DeprecatedMenuItem is clicked. If the item is a child of the DeprecatedMenu component, this callback will be decorated with the onSelect and onClose DeprecatedMenu callbacks. This callback will not fire if the item is disabled (see below).
|
|
17
25
|
*/
|
|
18
26
|
onClick?: (event: React.MouseEvent) => void;
|
|
19
27
|
/**
|
|
20
|
-
* The unique id for the
|
|
28
|
+
* The unique id for the DeprecatedMenuItem used for ARIA attributes. If the item is a child of the `DeprecatedMenu` component, this property will be generated and overridden.
|
|
21
29
|
*/
|
|
22
30
|
id?: string;
|
|
23
31
|
/**
|
|
24
|
-
* The icon of the
|
|
32
|
+
* The icon of the DeprecatedMenuItem. This icon is displayed before what you supplied for the children.
|
|
25
33
|
*/
|
|
26
34
|
icon?: CanvasSystemIcon;
|
|
27
35
|
/**
|
|
28
|
-
* The secondary icon of the
|
|
36
|
+
* The secondary icon of the DeprecatedMenuItem. This icon is displayed after what you supplied for the children.
|
|
29
37
|
*/
|
|
30
38
|
secondaryIcon?: CanvasSystemIcon;
|
|
31
39
|
/**
|
|
32
|
-
* If true, render a top border on the
|
|
40
|
+
* If true, render a top border on the DeprecatedMenuItem.
|
|
33
41
|
* @default false
|
|
34
42
|
*/
|
|
35
43
|
hasDivider?: boolean;
|
|
36
44
|
/**
|
|
37
|
-
* If true,
|
|
45
|
+
* If true, render a header to group data, this menu item will not be intractable.
|
|
46
|
+
* @default false
|
|
47
|
+
*/
|
|
48
|
+
isHeader?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* If true, set the DeprecatedMenuItem to the disabled state so it is not clickable.
|
|
38
51
|
* @default false
|
|
39
52
|
*/
|
|
40
53
|
isDisabled?: boolean;
|
|
41
54
|
/**
|
|
42
|
-
* If true, set the
|
|
55
|
+
* If true, set the DeprecatedMenuItem to be the currently selected item. If the item is a child of the DeprecatedMenu component, this property will be generated and overridden.
|
|
43
56
|
* @default false
|
|
44
57
|
*/
|
|
45
58
|
isFocused?: boolean;
|
|
46
59
|
/**
|
|
47
|
-
* The role of the
|
|
60
|
+
* The role of the DeprecatedMenuItem. Use this to override the role of the item (e.g. you can use this element as an option in a Combobox).
|
|
48
61
|
* @default menuItem
|
|
49
62
|
*/
|
|
50
63
|
role?: string;
|
|
51
64
|
/**
|
|
52
|
-
* If true, allow the onClose
|
|
65
|
+
* If true, allow the onClose DeprecatedMenu callback to be fired after the DeprecatedMenuItem has been clicked.
|
|
53
66
|
* @default true
|
|
54
67
|
*/
|
|
55
68
|
shouldClose?: boolean;
|
|
56
69
|
}
|
|
57
70
|
|
|
58
|
-
const Item = styled('li')<Pick<
|
|
71
|
+
const Item = styled('li')<Pick<DeprecatedMenuItemProps, 'isDisabled' | 'isFocused' | 'isHeader'>>(
|
|
59
72
|
{
|
|
60
73
|
...type.levels.subtext.large,
|
|
61
74
|
padding: `${space.xxs} ${space.s}`,
|
|
@@ -71,6 +84,9 @@ const Item = styled('li')<Pick<MenuItemProps, 'isDisabled' | 'isFocused'>>(
|
|
|
71
84
|
outline: 'none',
|
|
72
85
|
},
|
|
73
86
|
},
|
|
87
|
+
({isHeader}) => {
|
|
88
|
+
return {pointerEvents: isHeader ? 'none' : 'all'};
|
|
89
|
+
},
|
|
74
90
|
({isFocused, isDisabled}) => {
|
|
75
91
|
if (!isFocused && !isDisabled) {
|
|
76
92
|
return {
|
|
@@ -237,10 +253,27 @@ const scrollIntoViewIfNeeded = (elem: HTMLElement, centerIfNeeded = true): void
|
|
|
237
253
|
}
|
|
238
254
|
};
|
|
239
255
|
|
|
240
|
-
|
|
256
|
+
/**
|
|
257
|
+
* ### Deprecated Menu Item
|
|
258
|
+
*
|
|
259
|
+
* As of Canvas Kit v8, Menu is being soft-deprecated.
|
|
260
|
+
* It will be hard-deprecated (completely removed) in v9. Please see the
|
|
261
|
+
* [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
|
|
262
|
+
* for more information.
|
|
263
|
+
*/
|
|
264
|
+
export class DeprecatedMenuItem extends React.Component<DeprecatedMenuItemProps> {
|
|
241
265
|
ref = React.createRef<HTMLLIElement>();
|
|
242
266
|
|
|
243
|
-
|
|
267
|
+
componentDidMount() {
|
|
268
|
+
console.warn(
|
|
269
|
+
`This component is being deprecated and will be removed in Canvas Kit V9.\n
|
|
270
|
+
For more information, please see the V8 upgrade guide:\n
|
|
271
|
+
https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page
|
|
272
|
+
`
|
|
273
|
+
);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
componentDidUpdate = (prevProps: DeprecatedMenuItemProps) => {
|
|
244
277
|
if (!prevProps.isFocused && this.props.isFocused) {
|
|
245
278
|
if (this.ref.current) {
|
|
246
279
|
scrollIntoViewIfNeeded(this.ref.current);
|
|
@@ -248,7 +281,7 @@ export class MenuItem extends React.Component<MenuItemProps> {
|
|
|
248
281
|
}
|
|
249
282
|
};
|
|
250
283
|
|
|
251
|
-
render()
|
|
284
|
+
render() {
|
|
252
285
|
const {
|
|
253
286
|
onClick,
|
|
254
287
|
children,
|
|
@@ -258,6 +291,7 @@ export class MenuItem extends React.Component<MenuItemProps> {
|
|
|
258
291
|
hasDivider,
|
|
259
292
|
isDisabled,
|
|
260
293
|
isFocused,
|
|
294
|
+
isHeader,
|
|
261
295
|
role,
|
|
262
296
|
...elemProps
|
|
263
297
|
} = this.props;
|
|
@@ -272,11 +306,12 @@ export class MenuItem extends React.Component<MenuItemProps> {
|
|
|
272
306
|
ref={this.ref}
|
|
273
307
|
tabIndex={-1}
|
|
274
308
|
id={id}
|
|
275
|
-
role={role}
|
|
309
|
+
role={isHeader ? 'presentation' : role}
|
|
276
310
|
onClick={this.handleClick}
|
|
277
311
|
aria-disabled={isDisabled ? true : undefined}
|
|
278
312
|
isDisabled={!!isDisabled}
|
|
279
313
|
isFocused={!!isFocused}
|
|
314
|
+
isHeader={!!isHeader}
|
|
280
315
|
{...elemProps}
|
|
281
316
|
>
|
|
282
317
|
{icon && iconProps && <StyledSystemIcon {...iconProps} />}
|
|
@@ -306,7 +341,7 @@ export class MenuItem extends React.Component<MenuItemProps> {
|
|
|
306
341
|
*/
|
|
307
342
|
// TODO: Remove this ts-ignore when we convert to a functional component
|
|
308
343
|
// @ts-ignore
|
|
309
|
-
|
|
344
|
+
DeprecatedMenuItem.defaultProps = {
|
|
310
345
|
shouldClose: true,
|
|
311
346
|
role: 'menuitem',
|
|
312
347
|
};
|