orcs-design-system 3.3.59 → 3.3.60
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.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { useState, useImperativeHandle, createContext, useContext, useMemo, useId, useLayoutEffect } from "react";
|
|
2
2
|
import styled, { css, ThemeProvider } from "styled-components";
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
|
+
import { NavLink } from "react-router-dom";
|
|
4
5
|
import { space, layout } from "styled-system";
|
|
5
6
|
import { themeGet } from "@styled-system/theme-get";
|
|
6
7
|
import { commonKeys } from "../../hooks/keypress";
|
|
@@ -61,6 +62,11 @@ export const ActionsMenuHeading = styled(props => {
|
|
|
61
62
|
displayName: "ActionsMenu__ActionsMenuHeading",
|
|
62
63
|
componentId: "sc-yvbni2-6"
|
|
63
64
|
})(["color:", ";padding:8px;width:100%;font-size:", ";font-weight:", ";border-bottom:solid 1px ", ";white-space:nowrap;cursor:", ";"], props => themeGet("colors.greyDark")(props), props => themeGet("fontSizes.0")(props), props => themeGet("fontWeights.1")(props), props => themeGet("colors.greyLighter")(props), props => props.canClick ? "pointer" : "default");
|
|
65
|
+
const ActionMenuItemStyles = css(["white-space:nowrap;display:block;width:100%;text-align:left;cursor:pointer;margin:0;padding:8px;appearance:none;background-color:", ";border:none;border-bottom:solid 1px ", ";border-radius:0;color:", ";font-size:", ";line-height:", ";font-family:", ";font-weight:", ";text-decoration:none;transition:", ";&:hover{background-color:", ";}&:first-child{border-radius:", " ", " 0 0;}&:last-child{border:0;border-radius:0 0 ", " ", ";}&:only-child{border-radius:", ";}&#other{padding:6px 8px;}"], props => props.selected ? themeGet("colors.success20")(props) : "transparent", themeGet("colors.white"), themeGet("colors.greyDarkest"), themeGet("fontSizes.0"), themeGet("fontSizes.0"), themeGet("fonts.main"), themeGet("fontWeights.2"), themeGet("transition.transitionDefault"), themeGet("colors.primaryLightest"), themeGet("radii.2"), themeGet("radii.2"), themeGet("radii.2"), themeGet("radii.2"), themeGet("radii.2"));
|
|
66
|
+
const StyledNavLink = styled(NavLink).withConfig({
|
|
67
|
+
displayName: "ActionsMenu__StyledNavLink",
|
|
68
|
+
componentId: "sc-yvbni2-7"
|
|
69
|
+
})(["text-decoration:none;"]);
|
|
64
70
|
export const ActionsMenuItem = styled(props => {
|
|
65
71
|
const {
|
|
66
72
|
id,
|
|
@@ -84,6 +90,15 @@ export const ActionsMenuItem = styled(props => {
|
|
|
84
90
|
onItemClick?.(e);
|
|
85
91
|
originalOnClick?.(e);
|
|
86
92
|
}, [originalOnClick, onItemClick]);
|
|
93
|
+
if (props.to) {
|
|
94
|
+
const LinkedComponent = props.Component || Component;
|
|
95
|
+
return /*#__PURE__*/_jsx(StyledNavLink, {
|
|
96
|
+
to: props.to,
|
|
97
|
+
children: /*#__PURE__*/_jsx(LinkedComponent, {
|
|
98
|
+
...newProps
|
|
99
|
+
})
|
|
100
|
+
});
|
|
101
|
+
}
|
|
87
102
|
if (Component === "button") {
|
|
88
103
|
newProps = {
|
|
89
104
|
...others,
|
|
@@ -105,12 +120,12 @@ export const ActionsMenuItem = styled(props => {
|
|
|
105
120
|
role: "menuitem"
|
|
106
121
|
}).withConfig({
|
|
107
122
|
displayName: "ActionsMenu__ActionsMenuItem",
|
|
108
|
-
componentId: "sc-yvbni2-
|
|
123
|
+
componentId: "sc-yvbni2-8"
|
|
109
124
|
})(["", ""], _ref => {
|
|
110
125
|
let {
|
|
111
126
|
Component
|
|
112
127
|
} = _ref;
|
|
113
|
-
return Component ? "" :
|
|
128
|
+
return Component ? "" : ActionMenuItemStyles;
|
|
114
129
|
});
|
|
115
130
|
export const ActionsMenuBody = _ref2 => {
|
|
116
131
|
let {
|