@workday/canvas-kit-preview-react 8.0.0 → 8.0.1
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/color-picker/README.md +1 -1
- package/color-picker/index.ts +1 -1
- package/color-picker/lib/ColorPicker.tsx +2 -3
- package/dist/commonjs/color-picker/index.d.ts +1 -1
- package/dist/commonjs/color-picker/index.d.ts.map +1 -1
- package/dist/commonjs/color-picker/index.js +2 -6
- package/dist/commonjs/color-picker/lib/ColorPicker.d.ts +1 -2
- package/dist/commonjs/color-picker/lib/ColorPicker.d.ts.map +1 -1
- package/dist/commonjs/color-picker/lib/ColorPicker.js +5 -4
- 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/index.d.ts +1 -4
- package/dist/commonjs/menu/index.d.ts.map +1 -1
- package/dist/commonjs/menu/index.js +1 -9
- 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 +43 -22
- package/dist/commonjs/menu/lib/MenuItem.d.ts +35 -14
- package/dist/commonjs/menu/lib/MenuItem.d.ts.map +1 -1
- package/dist/commonjs/menu/lib/MenuItem.js +24 -9
- 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/{breadcrumbs → segmented-control}/index.js +2 -5
- 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 +0 -3
- package/dist/commonjs/select/index.d.ts.map +1 -1
- package/dist/commonjs/select/index.js +0 -7
- package/dist/commonjs/select/lib/Select.d.ts +0 -1
- package/dist/commonjs/select/lib/Select.d.ts.map +1 -1
- package/dist/commonjs/select/lib/Select.js +2 -6
- package/dist/commonjs/select/lib/SelectBase.d.ts +2 -2
- package/dist/commonjs/select/lib/SelectBase.d.ts.map +1 -1
- package/dist/commonjs/select/lib/SelectBase.js +6 -9
- package/dist/commonjs/select/lib/SelectMenu.d.ts +2 -2
- package/dist/commonjs/select/lib/SelectMenu.d.ts.map +1 -1
- package/dist/commonjs/select/lib/SelectMenu.js +2 -2
- package/dist/commonjs/select/lib/SelectOption.d.ts +1 -2
- package/dist/commonjs/select/lib/SelectOption.d.ts.map +1 -1
- package/dist/commonjs/select/lib/SelectOption.js +2 -1
- package/dist/commonjs/side-panel/index.d.ts +0 -3
- package/dist/commonjs/side-panel/index.d.ts.map +1 -1
- package/dist/commonjs/side-panel/index.js +0 -7
- package/dist/commonjs/side-panel/lib/SidePanel.d.ts +1 -2
- package/dist/commonjs/side-panel/lib/SidePanel.d.ts.map +1 -1
- package/dist/commonjs/side-panel/lib/SidePanel.js +3 -3
- package/dist/commonjs/status-indicator/index.d.ts +2 -0
- package/dist/commonjs/status-indicator/index.d.ts.map +1 -0
- package/dist/commonjs/status-indicator/index.js +13 -0
- 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/List/index.js → status-indicator/lib/StatusIndicatorLabel.js} +6 -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/color-picker/index.d.ts +1 -1
- package/dist/es6/color-picker/index.d.ts.map +1 -1
- package/dist/es6/color-picker/index.js +1 -1
- package/dist/es6/color-picker/lib/ColorPicker.d.ts +1 -2
- package/dist/es6/color-picker/lib/ColorPicker.d.ts.map +1 -1
- package/dist/es6/color-picker/lib/ColorPicker.js +2 -3
- 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/index.d.ts +1 -4
- package/dist/es6/menu/index.d.ts.map +1 -1
- package/dist/es6/menu/index.js +1 -4
- 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 +42 -22
- package/dist/es6/menu/lib/MenuItem.d.ts +35 -14
- 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 +6 -16
- package/dist/es6/pill/lib/Pill.d.ts.map +1 -1
- package/dist/es6/pill/lib/PillAvatar.d.ts +1 -2
- package/dist/es6/pill/lib/PillAvatar.d.ts.map +1 -1
- package/dist/es6/pill/lib/PillIcon.d.ts +1 -2
- package/dist/es6/pill/lib/PillIcon.d.ts.map +1 -1
- package/dist/es6/pill/lib/PillIconButton.d.ts +1 -2
- package/dist/es6/pill/lib/PillIconButton.d.ts.map +1 -1
- package/dist/es6/pill/lib/PillLabel.d.ts +1 -2
- package/dist/es6/pill/lib/PillLabel.d.ts.map +1 -1
- package/dist/es6/pill/lib/usePillModel.d.ts +5 -5
- 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 +0 -3
- package/dist/es6/select/index.d.ts.map +1 -1
- package/dist/es6/select/index.js +0 -3
- package/dist/es6/select/lib/Select.d.ts +0 -1
- package/dist/es6/select/lib/Select.d.ts.map +1 -1
- package/dist/es6/select/lib/Select.js +1 -2
- package/dist/es6/select/lib/SelectBase.d.ts +2 -2
- package/dist/es6/select/lib/SelectBase.d.ts.map +1 -1
- package/dist/es6/select/lib/SelectBase.js +3 -4
- package/dist/es6/select/lib/SelectMenu.d.ts +2 -2
- package/dist/es6/select/lib/SelectMenu.d.ts.map +1 -1
- package/dist/es6/select/lib/SelectMenu.js +1 -2
- package/dist/es6/select/lib/SelectOption.d.ts +1 -2
- package/dist/es6/select/lib/SelectOption.d.ts.map +1 -1
- package/dist/es6/select/lib/SelectOption.js +1 -2
- package/dist/es6/side-panel/index.d.ts +0 -3
- package/dist/es6/side-panel/index.d.ts.map +1 -1
- package/dist/es6/side-panel/index.js +0 -3
- package/dist/es6/side-panel/lib/SidePanel.d.ts +1 -2
- package/dist/es6/side-panel/lib/SidePanel.d.ts.map +1 -1
- package/dist/es6/side-panel/lib/SidePanel.js +1 -2
- 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/List/index.js → status-indicator/lib/StatusIndicatorLabel.js} +5 -5
- 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/index.ts +1 -6
- package/menu/lib/Menu.tsx +74 -27
- package/menu/lib/MenuItem.tsx +51 -18
- package/package.json +7 -6
- 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/README.md +7 -7
- package/select/index.ts +0 -4
- package/select/lib/Select.tsx +1 -3
- package/select/lib/SelectBase.tsx +3 -5
- package/select/lib/SelectMenu.tsx +1 -3
- package/select/lib/SelectOption.tsx +1 -3
- package/side-panel/index.ts +0 -4
- package/side-panel/lib/SidePanel.tsx +1 -2
- 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 -5
- 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 -28
- 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 -5
- 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/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/Nav.js +0 -34
- 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 -5
- package/dist/es6/breadcrumbs/index.d.ts.map +0 -1
- package/dist/es6/breadcrumbs/index.js +0 -4
- 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/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/Nav.js +0 -27
- 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
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {styled} from '@workday/canvas-kit-react/common';
|
|
3
|
-
import {Hyperlink} from '@workday/canvas-kit-react/button';
|
|
4
|
-
import {type} from '@workday/canvas-kit-react/tokens';
|
|
5
|
-
import {TooltipContainer} from '@workday/canvas-kit-react/tooltip';
|
|
6
|
-
import {Popper} from '@workday/canvas-kit-react/popup';
|
|
7
|
-
|
|
8
|
-
import {useTruncateTooltip} from './hooks';
|
|
9
|
-
import {truncateStyles} from './styles';
|
|
10
|
-
|
|
11
|
-
export interface BreadcrumbLinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
12
|
-
/**
|
|
13
|
-
* The href url of the anchor tag
|
|
14
|
-
*/
|
|
15
|
-
href: string;
|
|
16
|
-
/**
|
|
17
|
-
* The max-width of the link text
|
|
18
|
-
*
|
|
19
|
-
* @default 350px
|
|
20
|
-
*/
|
|
21
|
-
maxWidth?: number;
|
|
22
|
-
/**
|
|
23
|
-
* A handler function for overriding hard-redirects with links
|
|
24
|
-
*/
|
|
25
|
-
onAction?: (href: string) => void;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
type StyledLinkProps = Pick<BreadcrumbLinkProps, 'maxWidth' | 'href'>;
|
|
29
|
-
|
|
30
|
-
const {color, ...subtextLargeStyles} = type.levels.subtext.large;
|
|
31
|
-
|
|
32
|
-
const StyledLink = styled(Hyperlink)(
|
|
33
|
-
{
|
|
34
|
-
...subtextLargeStyles,
|
|
35
|
-
},
|
|
36
|
-
({maxWidth}: StyledLinkProps) => ({
|
|
37
|
-
...truncateStyles(maxWidth),
|
|
38
|
-
})
|
|
39
|
-
);
|
|
40
|
-
|
|
41
|
-
export const BreadcrumbLink = ({
|
|
42
|
-
maxWidth,
|
|
43
|
-
onAction,
|
|
44
|
-
onClick,
|
|
45
|
-
href,
|
|
46
|
-
children,
|
|
47
|
-
...props
|
|
48
|
-
}: BreadcrumbLinkProps) => {
|
|
49
|
-
const ref = React.useRef<HTMLAnchorElement>(null);
|
|
50
|
-
const {isTooltipOpen, openTooltip, closeTooltip, tooltipProps} = useTruncateTooltip(ref);
|
|
51
|
-
|
|
52
|
-
const handleClick = (event: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => {
|
|
53
|
-
event.preventDefault();
|
|
54
|
-
// allow an override to the hard redirect
|
|
55
|
-
if (onAction) {
|
|
56
|
-
onAction(href);
|
|
57
|
-
} else {
|
|
58
|
-
// default to hard redirecting
|
|
59
|
-
window.location.href = href;
|
|
60
|
-
}
|
|
61
|
-
// don't block the onClick event if it's provided
|
|
62
|
-
if (onClick) {
|
|
63
|
-
onClick(event);
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
return (
|
|
68
|
-
<React.Fragment>
|
|
69
|
-
<StyledLink
|
|
70
|
-
ref={ref}
|
|
71
|
-
maxWidth={maxWidth}
|
|
72
|
-
onMouseEnter={openTooltip}
|
|
73
|
-
onMouseLeave={closeTooltip}
|
|
74
|
-
onFocus={openTooltip}
|
|
75
|
-
onBlur={closeTooltip}
|
|
76
|
-
href={href}
|
|
77
|
-
role="link"
|
|
78
|
-
onClick={handleClick}
|
|
79
|
-
{...props}
|
|
80
|
-
>
|
|
81
|
-
{children}
|
|
82
|
-
</StyledLink>
|
|
83
|
-
<Popper open={isTooltipOpen} anchorElement={ref} placement="top">
|
|
84
|
-
<TooltipContainer {...tooltipProps}>{children}</TooltipContainer>
|
|
85
|
-
</Popper>
|
|
86
|
-
</React.Fragment>
|
|
87
|
-
);
|
|
88
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {SystemIcon} from '@workday/canvas-kit-react/icon';
|
|
3
|
-
import {chevronLeftSmallIcon, chevronRightSmallIcon} from '@workday/canvas-system-icons-web';
|
|
4
|
-
import {colors} from '@workday/canvas-kit-react/tokens';
|
|
5
|
-
|
|
6
|
-
import {useRTL} from '../hooks';
|
|
7
|
-
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
8
|
-
|
|
9
|
-
export type ListItemProps = React.HTMLAttributes<HTMLLIElement>;
|
|
10
|
-
|
|
11
|
-
export const BreadcrumbsListItem = ({children, ...props}: ListItemProps) => {
|
|
12
|
-
const {shouldUseRTL} = useRTL();
|
|
13
|
-
const icon = shouldUseRTL ? chevronLeftSmallIcon : chevronRightSmallIcon;
|
|
14
|
-
|
|
15
|
-
return (
|
|
16
|
-
<Flex as="li" alignItems="center" {...props}>
|
|
17
|
-
{children}
|
|
18
|
-
<SystemIcon
|
|
19
|
-
icon={icon}
|
|
20
|
-
color={colors.licorice200}
|
|
21
|
-
colorHover={colors.licorice200}
|
|
22
|
-
size={20}
|
|
23
|
-
height={32}
|
|
24
|
-
width={32}
|
|
25
|
-
styles={{justifyContent: 'center', alignItems: 'center', display: 'inline-flex'}}
|
|
26
|
-
aria-hidden
|
|
27
|
-
/>
|
|
28
|
-
</Flex>
|
|
29
|
-
);
|
|
30
|
-
};
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import React, {Children, useLayoutEffect, useState, useEffect} from 'react';
|
|
2
|
-
|
|
3
|
-
import {BreadcrumbLink} from './Link';
|
|
4
|
-
import {Breadcrumb} from '../types';
|
|
5
|
-
|
|
6
|
-
export const useCollapse = <E extends HTMLElement>(listEl: React.RefObject<E>, maxWidth = 0) => {
|
|
7
|
-
const [shouldCollapseList, setShouldCollapseList] = useState<boolean>(false);
|
|
8
|
-
|
|
9
|
-
useLayoutEffect(() => {
|
|
10
|
-
const listWidth = listEl.current?.clientWidth || 0;
|
|
11
|
-
setShouldCollapseList(listWidth > maxWidth);
|
|
12
|
-
}, [listEl, maxWidth]);
|
|
13
|
-
|
|
14
|
-
return {shouldCollapseList};
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
const getBreadcrumbLink = (breadcrumb: React.ReactElement) => {
|
|
18
|
-
return Children.toArray(breadcrumb.props.children).filter(child => {
|
|
19
|
-
return React.isValidElement(child) && child.type === BreadcrumbLink;
|
|
20
|
-
})[0] as React.ReactElement;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
const buildCollapsedList = (
|
|
24
|
-
list: Breadcrumb[],
|
|
25
|
-
containerWidth: number,
|
|
26
|
-
maxWidth: number,
|
|
27
|
-
collapsedList: Breadcrumb[] = []
|
|
28
|
-
): Breadcrumb[] => {
|
|
29
|
-
// TODO: Calculate expander width dynamically
|
|
30
|
-
const EXPANDER_WIDTH = 66;
|
|
31
|
-
// recurse over the breadcrumb items until the containerWidth is less than or equal to the maxWidth
|
|
32
|
-
if (!list.length || containerWidth + EXPANDER_WIDTH <= maxWidth) {
|
|
33
|
-
return collapsedList;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const [firstCrumb, ...restList] = list;
|
|
37
|
-
const updatedCollapsedList = collapsedList.concat(firstCrumb);
|
|
38
|
-
const adjustedWidth = containerWidth - firstCrumb.width;
|
|
39
|
-
return buildCollapsedList(restList, adjustedWidth, maxWidth, updatedCollapsedList);
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export const useBuildCollapsedList = <E extends HTMLElement>(
|
|
43
|
-
listEl: React.RefObject<E>,
|
|
44
|
-
children: React.ReactNode,
|
|
45
|
-
maxWidth: number
|
|
46
|
-
) => {
|
|
47
|
-
const [collapsedItems, setCollapsedItems] = useState<Breadcrumb[]>([]);
|
|
48
|
-
|
|
49
|
-
useLayoutEffect(() => {
|
|
50
|
-
const listItemNodes = listEl.current ? listEl.current.querySelectorAll('li') : [];
|
|
51
|
-
const containerWidth = listEl.current ? listEl.current.clientWidth : 0;
|
|
52
|
-
const listItems: Breadcrumb[] = [];
|
|
53
|
-
Children.forEach(children, (child, index) => {
|
|
54
|
-
if (!React.isValidElement(child)) {
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
const breadcrumbLink = getBreadcrumbLink(child);
|
|
58
|
-
// We should make this match work better
|
|
59
|
-
const listItemNode = listItemNodes[index];
|
|
60
|
-
|
|
61
|
-
// We might need to allow folks to spread more props from the link
|
|
62
|
-
listItems.push({
|
|
63
|
-
index: index, // TODO: use unique identifiers instead of indices
|
|
64
|
-
link: breadcrumbLink?.props?.href || '',
|
|
65
|
-
text: listItemNode ? listItemNode.innerText : '',
|
|
66
|
-
width: listItemNode ? listItemNode.clientWidth : 0,
|
|
67
|
-
onAction: breadcrumbLink?.props?.onAction,
|
|
68
|
-
} as Breadcrumb);
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
// don't collapse the root breadcrumb
|
|
72
|
-
const collapsibleListItems = listItems.slice(1);
|
|
73
|
-
const collapsedList = buildCollapsedList(collapsibleListItems, containerWidth, maxWidth);
|
|
74
|
-
setCollapsedItems(collapsedList);
|
|
75
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
76
|
-
}, [maxWidth]);
|
|
77
|
-
|
|
78
|
-
const collapsedItemIndices = collapsedItems.map(child => child.index);
|
|
79
|
-
return {collapsedItems, collapsedItemIndices};
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
export const useTruncateTooltip = (ref?: React.RefObject<HTMLSpanElement>) => {
|
|
83
|
-
const [isTooltipOpen, setIsTooltipOpen] = useState(false);
|
|
84
|
-
const [shouldShowTooltip, setShouldShowTooltip] = useState(false);
|
|
85
|
-
useEffect(() => {
|
|
86
|
-
if (ref?.current) {
|
|
87
|
-
setShouldShowTooltip(ref.current.scrollWidth > ref.current.clientWidth);
|
|
88
|
-
}
|
|
89
|
-
}, [ref]);
|
|
90
|
-
|
|
91
|
-
const openTooltip = (event: React.MouseEvent | React.FocusEvent) => {
|
|
92
|
-
const {currentTarget} = event;
|
|
93
|
-
// if the target is truncated, show the tooltip
|
|
94
|
-
if (currentTarget.scrollWidth > currentTarget.clientWidth) {
|
|
95
|
-
setIsTooltipOpen(true);
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
const closeTooltip = () => {
|
|
100
|
-
setIsTooltipOpen(false);
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
const tooltipProps = {
|
|
104
|
-
role: 'tooltip',
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
return {
|
|
108
|
-
isTooltipOpen,
|
|
109
|
-
openTooltip,
|
|
110
|
-
closeTooltip,
|
|
111
|
-
shouldShowTooltip,
|
|
112
|
-
tooltipProps,
|
|
113
|
-
};
|
|
114
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {createComponent} from '@workday/canvas-kit-react/common';
|
|
3
|
-
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
4
|
-
|
|
5
|
-
export type BreadcrumbsListProps = React.HTMLAttributes<HTMLUListElement>;
|
|
6
|
-
|
|
7
|
-
export const BreadcrumbsList = createComponent('ul')({
|
|
8
|
-
displayName: 'BreadcrumbsList',
|
|
9
|
-
Component: ({children, ...elemProps}: BreadcrumbsListProps, ref) => {
|
|
10
|
-
return (
|
|
11
|
-
<Flex
|
|
12
|
-
padding="zero"
|
|
13
|
-
margin="zero"
|
|
14
|
-
display="inline-flex"
|
|
15
|
-
alignItems="center"
|
|
16
|
-
minHeight={40}
|
|
17
|
-
listStyle="none"
|
|
18
|
-
style={{boxSizing: 'border-box'}}
|
|
19
|
-
as="ul"
|
|
20
|
-
role="list"
|
|
21
|
-
ref={ref}
|
|
22
|
-
{...elemProps}
|
|
23
|
-
>
|
|
24
|
-
{children}
|
|
25
|
-
</Flex>
|
|
26
|
-
);
|
|
27
|
-
},
|
|
28
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import {CSSObject} from '@emotion/styled';
|
|
2
|
-
|
|
3
|
-
// default max-width for truncating text
|
|
4
|
-
const DEFAULT_MAX_WIDTH = 350;
|
|
5
|
-
|
|
6
|
-
export const truncateStyles = (maxWidth: number = DEFAULT_MAX_WIDTH): CSSObject => ({
|
|
7
|
-
display: 'inline-block',
|
|
8
|
-
maxWidth,
|
|
9
|
-
overflow: 'hidden',
|
|
10
|
-
textOverflow: 'ellipsis',
|
|
11
|
-
whiteSpace: 'nowrap',
|
|
12
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
export interface BreadcrumbsNavProps extends React.HTMLAttributes<HTMLElement> {
|
|
4
|
-
/**
|
|
5
|
-
* The accessibility label to indicate the type of navigation.
|
|
6
|
-
*
|
|
7
|
-
* Suggested value: "breadcrumb"
|
|
8
|
-
*/
|
|
9
|
-
'aria-label': string;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export const BreadcrumbsNav = ({'aria-label': ariaLabel, ...elemProps}: BreadcrumbsNavProps) => {
|
|
13
|
-
return <nav role="navigation" aria-label={ariaLabel} {...elemProps} />;
|
|
14
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
useTheme,
|
|
3
|
-
PartialEmotionCanvasTheme,
|
|
4
|
-
ContentDirection,
|
|
5
|
-
} from '@workday/canvas-kit-react/common';
|
|
6
|
-
|
|
7
|
-
export const useRTL = (partialTheme?: PartialEmotionCanvasTheme) => {
|
|
8
|
-
const theme = useTheme(partialTheme);
|
|
9
|
-
const shouldUseRTL = theme.canvas.direction === ContentDirection.RTL;
|
|
10
|
-
return {
|
|
11
|
-
shouldUseRTL,
|
|
12
|
-
};
|
|
13
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import {CurrentItem} from './List/CurrentItem';
|
|
2
|
-
import {BreadcrumbLink} from './List/Link';
|
|
3
|
-
import {BreadcrumbsNav} from './Nav';
|
|
4
|
-
import {CollapsibleList} from './List/Collapsible';
|
|
5
|
-
import {BreadcrumbsListItem} from './List/ListItem';
|
|
6
|
-
import {BreadcrumbsList} from './List';
|
|
7
|
-
|
|
8
|
-
export const Breadcrumbs = {
|
|
9
|
-
Nav: BreadcrumbsNav,
|
|
10
|
-
CollapsibleList,
|
|
11
|
-
List: BreadcrumbsList,
|
|
12
|
-
ListItem: BreadcrumbsListItem,
|
|
13
|
-
Link: BreadcrumbLink,
|
|
14
|
-
CurrentItem,
|
|
15
|
-
};
|
package/breadcrumbs/package.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../breadcrumbs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,mBAAmB,CAAC;AAE9C,eAAe,WAAW,CAAC;AAC3B,OAAO,EAAC,WAAW,EAAC,CAAC;AACrB,cAAc,mBAAmB,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { CanvasSystemIcon } from '@workday/design-assets-types';
|
|
3
|
-
export interface DropdownButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
4
|
-
/**
|
|
5
|
-
* The accessibility label for the button
|
|
6
|
-
*/
|
|
7
|
-
'aria-label': string;
|
|
8
|
-
/**
|
|
9
|
-
* The Canvas System Icon for the button
|
|
10
|
-
*
|
|
11
|
-
* @default relatedActionsIcon
|
|
12
|
-
*/
|
|
13
|
-
buttonIcon?: CanvasSystemIcon;
|
|
14
|
-
/**
|
|
15
|
-
* The boolean to determine whether the button should be in a 'toggled' state
|
|
16
|
-
*/
|
|
17
|
-
toggled: boolean;
|
|
18
|
-
}
|
|
19
|
-
export declare const DropdownButton: import("@workday/canvas-kit-react/common").ElementComponent<"button", DropdownButtonProps>;
|
|
20
|
-
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../../../breadcrumbs/lib/Breadcrumbs/Dropdown/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAI9D,MAAM,WAAW,mBAAoB,SAAQ,KAAK,CAAC,cAAc,CAAC,iBAAiB,CAAC;IAClF;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,eAAO,MAAM,cAAc,4FA2BzB,CAAC"}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
-
var t = {};
|
|
15
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
-
t[p] = s[p];
|
|
17
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
-
t[p[i]] = s[p[i]];
|
|
21
|
-
}
|
|
22
|
-
return t;
|
|
23
|
-
};
|
|
24
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
|
-
};
|
|
27
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
exports.DropdownButton = void 0;
|
|
29
|
-
var react_1 = __importDefault(require("react"));
|
|
30
|
-
var button_1 = require("@workday/canvas-kit-react/button");
|
|
31
|
-
var canvas_system_icons_web_1 = require("@workday/canvas-system-icons-web");
|
|
32
|
-
var common_1 = require("@workday/canvas-kit-react/common");
|
|
33
|
-
var tokens_1 = require("@workday/canvas-kit-react/tokens");
|
|
34
|
-
exports.DropdownButton = common_1.createComponent('button')({
|
|
35
|
-
displayName: 'DropdownButton',
|
|
36
|
-
Component: function (_a, ref, Element) {
|
|
37
|
-
var _b = _a.buttonIcon, buttonIcon = _b === void 0 ? canvas_system_icons_web_1.relatedActionsIcon : _b, toggled = _a.toggled, elemProps = __rest(_a, ["buttonIcon", "toggled"]);
|
|
38
|
-
var theme = common_1.useTheme();
|
|
39
|
-
return (react_1.default.createElement(button_1.BaseButton, __assign({ as: Element, ref: ref, "aria-pressed": undefined, "aria-expanded": toggled, "aria-haspopup": true, "aria-controls": "menu", size: "small", height: tokens_1.space.l, width: tokens_1.space.l, padding: tokens_1.space.zero, colors: getDropdownColors(toggled, theme) }, elemProps),
|
|
40
|
-
react_1.default.createElement(button_1.BaseButton.Icon, { icon: buttonIcon })));
|
|
41
|
-
},
|
|
42
|
-
});
|
|
43
|
-
var getDropdownColors = function (toggled, theme) {
|
|
44
|
-
var themePrimary = theme.canvas.palette.primary;
|
|
45
|
-
return {
|
|
46
|
-
default: {
|
|
47
|
-
icon: toggled ? themePrimary.main : tokens_1.colors.blackPepper400,
|
|
48
|
-
label: themePrimary.main,
|
|
49
|
-
},
|
|
50
|
-
hover: {
|
|
51
|
-
background: tokens_1.colors.soap200,
|
|
52
|
-
icon: toggled ? themePrimary.dark : tokens_1.colors.blackPepper500,
|
|
53
|
-
label: themePrimary.dark,
|
|
54
|
-
},
|
|
55
|
-
active: {
|
|
56
|
-
background: tokens_1.colors.soap300,
|
|
57
|
-
icon: toggled ? themePrimary.dark : tokens_1.colors.blackPepper500,
|
|
58
|
-
label: themePrimary.dark,
|
|
59
|
-
},
|
|
60
|
-
focus: {
|
|
61
|
-
icon: toggled ? themePrimary.main : tokens_1.colors.blackPepper500,
|
|
62
|
-
label: themePrimary.main,
|
|
63
|
-
},
|
|
64
|
-
disabled: {
|
|
65
|
-
icon: toggled ? themePrimary.main : tokens_1.colors.blackPepper400,
|
|
66
|
-
label: themePrimary.main,
|
|
67
|
-
},
|
|
68
|
-
};
|
|
69
|
-
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Breadcrumb } from '../types';
|
|
3
|
-
export interface DropdownMenuProps {
|
|
4
|
-
/**
|
|
5
|
-
* The active dropdown item in the menu
|
|
6
|
-
*/
|
|
7
|
-
activeDropdownItem: Breadcrumb;
|
|
8
|
-
/**
|
|
9
|
-
* The HTML `id` of the element that labels the Menu. It should match the id of the menu button.
|
|
10
|
-
*/
|
|
11
|
-
'aria-labelledby': string;
|
|
12
|
-
/**
|
|
13
|
-
* An array of Breadcrumb items to render in the dropdown menu
|
|
14
|
-
*/
|
|
15
|
-
dropdownItems: Breadcrumb[];
|
|
16
|
-
/**
|
|
17
|
-
* A function to set the active dropdown item
|
|
18
|
-
*/
|
|
19
|
-
setActiveDropdownItem: React.Dispatch<React.SetStateAction<Breadcrumb>>;
|
|
20
|
-
/**
|
|
21
|
-
* The ref of the rendered HTMLAnchorElement
|
|
22
|
-
*/
|
|
23
|
-
activeDropdownItemRef: React.RefObject<HTMLAnchorElement>;
|
|
24
|
-
/**
|
|
25
|
-
* A function to return the focus to the dropdown button
|
|
26
|
-
*/
|
|
27
|
-
resetFocus: () => void;
|
|
28
|
-
/**
|
|
29
|
-
* A function to toggle the focus to the previous list item
|
|
30
|
-
*/
|
|
31
|
-
toggleActiveItemUp: () => void;
|
|
32
|
-
/**
|
|
33
|
-
* A function to toggle the focus to the next list item
|
|
34
|
-
*/
|
|
35
|
-
toggleActiveItemDown: () => void;
|
|
36
|
-
}
|
|
37
|
-
export declare const DropdownMenu: ({ activeDropdownItemRef, activeDropdownItem, dropdownItems, resetFocus, setActiveDropdownItem, toggleActiveItemDown, toggleActiveItemUp, ...elemProps }: DropdownMenuProps) => JSX.Element;
|
|
38
|
-
//# sourceMappingURL=Menu.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../../../../breadcrumbs/lib/Breadcrumbs/Dropdown/Menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAY1B,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AAKpC,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,kBAAkB,EAAE,UAAU,CAAC;IAC/B;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,aAAa,EAAE,UAAU,EAAE,CAAC;IAC5B;;OAEG;IACH,qBAAqB,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC;IACxE;;OAEG;IACH,qBAAqB,EAAE,KAAK,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC;IAC1D;;OAEG;IACH,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB;;OAEG;IACH,kBAAkB,EAAE,MAAM,IAAI,CAAC;IAC/B;;OAEG;IACH,oBAAoB,EAAE,MAAM,IAAI,CAAC;CAClC;AAgCD,eAAO,MAAM,YAAY,4JAStB,iBAAiB,gBA4DnB,CAAC"}
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
-
var t = {};
|
|
15
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
-
t[p] = s[p];
|
|
17
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
-
t[p[i]] = s[p[i]];
|
|
21
|
-
}
|
|
22
|
-
return t;
|
|
23
|
-
};
|
|
24
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
|
-
};
|
|
27
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
exports.DropdownMenu = void 0;
|
|
29
|
-
var react_1 = __importDefault(require("react"));
|
|
30
|
-
var common_1 = require("@workday/canvas-kit-react/common");
|
|
31
|
-
var tokens_1 = require("@workday/canvas-kit-react/tokens");
|
|
32
|
-
// local components
|
|
33
|
-
var MenuItemLink_1 = require("./MenuItemLink");
|
|
34
|
-
var layout_1 = require("@workday/canvas-kit-react/layout");
|
|
35
|
-
var StyledDropdownMenu = common_1.styled(layout_1.Box)(__assign(__assign(__assign({}, tokens_1.type.levels.subtext.large), tokens_1.depth[3]), { backgroundColor: tokens_1.commonColors.background, border: "1px solid " + tokens_1.colors.soap500, borderRadius: tokens_1.borderRadius.m, boxSizing: 'border-box', display: 'inline-block', marginTop: tokens_1.space.xxxs, maxHeight: 200, outline: 'none', overflowY: 'auto', position: 'relative', width: 'max-content' }));
|
|
36
|
-
var StyledMenuList = common_1.styled('ul')({
|
|
37
|
-
boxSizing: 'border-box',
|
|
38
|
-
listStyle: 'none',
|
|
39
|
-
margin: tokens_1.space.xxs + " 0",
|
|
40
|
-
padding: 0,
|
|
41
|
-
width: 280,
|
|
42
|
-
wordBreak: 'break-word',
|
|
43
|
-
wordWrap: 'break-word',
|
|
44
|
-
});
|
|
45
|
-
var MenuList = function (elemProps) {
|
|
46
|
-
return react_1.default.createElement(StyledMenuList, __assign({ role: "menu" }, elemProps));
|
|
47
|
-
};
|
|
48
|
-
var DropdownMenu = function (_a) {
|
|
49
|
-
var activeDropdownItemRef = _a.activeDropdownItemRef, activeDropdownItem = _a.activeDropdownItem, _b = _a.dropdownItems, dropdownItems = _b === void 0 ? [] : _b, resetFocus = _a.resetFocus, setActiveDropdownItem = _a.setActiveDropdownItem, toggleActiveItemDown = _a.toggleActiveItemDown, toggleActiveItemUp = _a.toggleActiveItemUp, elemProps = __rest(_a, ["activeDropdownItemRef", "activeDropdownItem", "dropdownItems", "resetFocus", "setActiveDropdownItem", "toggleActiveItemDown", "toggleActiveItemUp"]);
|
|
50
|
-
var handleItemKeyUp = function (event) {
|
|
51
|
-
switch (event.key) {
|
|
52
|
-
case 'ArrowUp':
|
|
53
|
-
case 'Up': // IE/Edge specific value
|
|
54
|
-
case 'ArrowLeft':
|
|
55
|
-
case 'Left': // IE/Edge specific value
|
|
56
|
-
toggleActiveItemUp();
|
|
57
|
-
break;
|
|
58
|
-
case 'ArrowDown':
|
|
59
|
-
case 'Down': // IE/Edge specific value
|
|
60
|
-
case 'ArrowRight':
|
|
61
|
-
case 'Right': // IE/Edge specific value
|
|
62
|
-
toggleActiveItemDown();
|
|
63
|
-
break;
|
|
64
|
-
default:
|
|
65
|
-
break;
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
var handleItemKeyDown = function (event, item) {
|
|
69
|
-
switch (event.key) {
|
|
70
|
-
case 'Tab':
|
|
71
|
-
event.preventDefault();
|
|
72
|
-
break;
|
|
73
|
-
case 'Enter':
|
|
74
|
-
event.preventDefault();
|
|
75
|
-
if (item.onAction) {
|
|
76
|
-
item.onAction(item.link);
|
|
77
|
-
resetFocus();
|
|
78
|
-
break;
|
|
79
|
-
}
|
|
80
|
-
window.location.href = item.link;
|
|
81
|
-
break;
|
|
82
|
-
default:
|
|
83
|
-
break;
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
return (react_1.default.createElement(StyledDropdownMenu, null,
|
|
87
|
-
react_1.default.createElement(MenuList, __assign({}, elemProps), dropdownItems.map(function (item, i) {
|
|
88
|
-
var index = item.index, link = item.link, text = item.text, elemProps = __rest(item, ["index", "link", "text"]);
|
|
89
|
-
var isFocused = index === activeDropdownItem.index;
|
|
90
|
-
return (react_1.default.createElement("li", { onKeyUp: handleItemKeyUp, onKeyDown: function (e) { return handleItemKeyDown(e, item); }, key: i },
|
|
91
|
-
react_1.default.createElement(MenuItemLink_1.DropdownMenuItemLink, __assign({ ref: isFocused ? activeDropdownItemRef : null, href: link }, elemProps), text)));
|
|
92
|
-
}))));
|
|
93
|
-
};
|
|
94
|
-
exports.DropdownMenu = DropdownMenu;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface DropdownMenuItemLinkProps extends React.HTMLAttributes<HTMLAnchorElement> {
|
|
3
|
-
/**
|
|
4
|
-
* The href url of the anchor tag
|
|
5
|
-
*/
|
|
6
|
-
href: string;
|
|
7
|
-
/**
|
|
8
|
-
* A handler function for overriding hard-redirects with links
|
|
9
|
-
*/
|
|
10
|
-
onAction?: (href: string) => void;
|
|
11
|
-
}
|
|
12
|
-
export declare const DropdownMenuItemLink: React.ForwardRefExoticComponent<DropdownMenuItemLinkProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
13
|
-
export {};
|
|
14
|
-
//# sourceMappingURL=MenuItemLink.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MenuItemLink.d.ts","sourceRoot":"","sources":["../../../../../../breadcrumbs/lib/Breadcrumbs/Dropdown/MenuItemLink.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAIxC,UAAU,yBAA0B,SAAQ,KAAK,CAAC,cAAc,CAAC,iBAAiB,CAAC;IACjF;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC;AAuBD,eAAO,MAAM,oBAAoB,qGA0BhC,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { usePopupPopper } from '@workday/canvas-kit-react/popup';
|
|
2
|
-
import { DropdownButtonProps } from './Button';
|
|
3
|
-
import { DropdownMenuProps } from './Menu';
|
|
4
|
-
import { Breadcrumb } from '../types';
|
|
5
|
-
export declare const useFocusActiveItemElement: <E extends HTMLElement>(activeDropdownItemRef: import("react").RefObject<E>) => void;
|
|
6
|
-
interface UseDropdown {
|
|
7
|
-
dropdownButtonProps: Omit<DropdownButtonProps, 'aria-label'>;
|
|
8
|
-
dropdownMenuProps: DropdownMenuProps;
|
|
9
|
-
popperProps: ReturnType<typeof usePopupPopper>;
|
|
10
|
-
}
|
|
11
|
-
export declare const useDropdown: (activeDropdownItemRef: React.RefObject<HTMLAnchorElement>, items: Breadcrumb[], buttonId?: string | undefined) => UseDropdown;
|
|
12
|
-
export {};
|
|
13
|
-
//# sourceMappingURL=hooks.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../../../../breadcrumbs/lib/Breadcrumbs/Dropdown/hooks.ts"],"names":[],"mappings":"AAEA,OAAO,EAML,cAAc,EACf,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAC,mBAAmB,EAAC,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAC,iBAAiB,EAAC,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AAEpC,eAAO,MAAM,yBAAyB,sFAQrC,CAAC;AASF,UAAU,WAAW;IACnB,mBAAmB,EAAE,IAAI,CAAC,mBAAmB,EAAE,YAAY,CAAC,CAAC;IAC7D,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,WAAW,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;CAChD;AAED,eAAO,MAAM,WAAW,0BACC,MAAM,SAAS,CAAC,iBAAiB,CAAC,SAClD,UAAU,EAAE,oCAElB,WAkEF,CAAC"}
|