orcs-design-system 3.2.45 → 3.2.47
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/es/components/ActionsMenu/ActionsMenu.animations.js +10 -0
- package/es/components/ActionsMenu/ActionsMenu.stories.js +1 -1
- package/es/components/ActionsMenu/index.js +22 -17
- package/es/components/Flex/Flex.stories.js +16 -18
- package/es/components/Flex/index.js +13 -2
- package/es/components/Select/index.js +1 -0
- package/es/components/Tag/Tag.stories.js +15 -5
- package/es/components/Tag/index.js +24 -15
- package/package.json +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { keyframes } from "styled-components";
|
|
2
|
+
export const crossFadeIn = keyframes(["0%{opacity:0;}75%{opacity:0;}100%{opacity:1;}"]);
|
|
3
|
+
export const beforeDotCollapsing = keyframes(["0%{transform:translate(0,-6px);}50%{transform:translate(0,0);}100%{transform:translate(0,0);}"]);
|
|
4
|
+
export const beforeDotExpanding = keyframes(["0%{transform:translate(0,0);}50%{transform:translate(0,0);}100%{transform:translate(0,-6px);}"]);
|
|
5
|
+
export const afterDotCollapsing = keyframes(["0%{transform:translate(0,6px);}50%{transform:translate(0,0);}100%{transform:translate(0,0);}"]);
|
|
6
|
+
export const afterDotExpanding = keyframes(["0%{transform:translate(0,0);}50%{transform:translate(0,0);}100%{transform:translate(0,6px);}"]);
|
|
7
|
+
export const beforeCrossExpanding = keyframes(["0%{height:4px;transform:rotate(-45deg);}50%{height:4px;transform:rotate(-45deg);}100%{height:18px;transform:translate(0,-7px) rotate(-45deg);}"]);
|
|
8
|
+
export const beforeCrossCollapsing = keyframes(["0%{height:18px;transform:translate(0,-7px) rotate(-45deg);}50%{height:4px;transform:rotate(-45deg);}100%{height:4px;transform:rotate(-45deg);}"]);
|
|
9
|
+
export const afterCrossExpanding = keyframes(["0%{height:4px;transform:rotate(45deg);}50%{height:4px;transform:rotate(45deg);}100%{height:18px;transform:translate(0,-7px) rotate(45deg);}"]);
|
|
10
|
+
export const afterCrossCollapsing = keyframes(["0%{height:18px;transform:translate(0,-7px) rotate(45deg);}50%{height:4px;transform:rotate(45deg);}100%{height:4px;transform:rotate(45deg);}"]);
|
|
@@ -104,6 +104,7 @@ const MenuItems = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
104
104
|
if (id === "other") {
|
|
105
105
|
return /*#__PURE__*/_jsx(ActionsMenuItem, {
|
|
106
106
|
type: "button",
|
|
107
|
+
id: "other",
|
|
107
108
|
selected: selectedReason === id,
|
|
108
109
|
onClick: clickOther,
|
|
109
110
|
children: /*#__PURE__*/_jsxs(Flex, {
|
|
@@ -127,7 +128,6 @@ const MenuItems = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
127
128
|
id: "editableContent",
|
|
128
129
|
p: "s",
|
|
129
130
|
children: [/*#__PURE__*/_jsx(TextArea, {
|
|
130
|
-
inverted: true,
|
|
131
131
|
id: "TextArea01",
|
|
132
132
|
label: "Reason for rejection",
|
|
133
133
|
cols: "35",
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import React, { useState, useImperativeHandle, createContext, useContext, useMemo, useId, useLayoutEffect } from "react";
|
|
2
|
-
import styled, { css,
|
|
2
|
+
import styled, { css, ThemeProvider } from "styled-components";
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
4
|
import { space, layout } from "styled-system";
|
|
5
5
|
import { themeGet } from "@styled-system/theme-get";
|
|
6
6
|
import { commonKeys } from "../../hooks/keypress";
|
|
7
7
|
import useActionMenu from "./useActionMenu";
|
|
8
|
+
import { crossFadeIn, beforeDotCollapsing, beforeDotExpanding, afterDotCollapsing, afterDotExpanding, beforeCrossExpanding, beforeCrossCollapsing, afterCrossExpanding, afterCrossCollapsing } from "./ActionsMenu.animations";
|
|
8
9
|
import { FloatingFocusManager, FloatingPortal, useMergeRefs } from "@floating-ui/react";
|
|
9
10
|
import { getFloatingUiRootElement, getFloatingUiZIndex } from "../../utils/floatingUiHelpers";
|
|
10
11
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
12
|
const ActionMenuContext = /*#__PURE__*/createContext({});
|
|
12
|
-
const crossTransform1 = keyframes(["0%{transform:translate(0,-6px);border-radius:2px;}50%{transform:translate(0,0);border-radius:2px;}75%{transform:rotate(-45deg) translate(0,0);border-radius:2px;}100%{transform:rotate(-45deg) translate(0,0) scaleX(4);border-radius:0;}"]);
|
|
13
|
-
const crossTransform2 = keyframes(["0%{transform:translate(0,6px);border-radius:2px;}50%{transform:translate(0,0);border-radius:2px;}75%{transform:rotate(45deg) translate(0,0);border-radius:2px;}100%{transform:rotate(45deg) translate(0,0) scaleX(4);border-radius:0;}"]);
|
|
14
13
|
const StyledActionsMenuContainer = styled.div.withConfig({
|
|
15
14
|
displayName: "ActionsMenu__StyledActionsMenuContainer",
|
|
16
15
|
componentId: "sc-yvbni2-0"
|
|
@@ -22,15 +21,19 @@ const Wrapper = styled.div.withConfig({
|
|
|
22
21
|
const Control = styled.button.withConfig({
|
|
23
22
|
displayName: "ActionsMenu__Control",
|
|
24
23
|
componentId: "sc-yvbni2-2"
|
|
25
|
-
})(["position:relative;background-color:", ";border:
|
|
26
|
-
const
|
|
27
|
-
displayName: "
|
|
24
|
+
})(["position:relative;background-color:", ";border:solid 1px ", ";display:flex;align-items:center;justify-content:center;-moz-appearance:none;-webkit-appearance:none;appearance:none;box-shadow:none;text-decoration:none;text-align:center;border-radius:", ";transition:", ";cursor:pointer;width:30px;height:30px;&:hover,&:focus{outline:0;border-color:", ";}&[data-state=\"open\"] .actionsMenu__dots{&:before{animation:500ms ", " cubic-bezier(0.68,-0.6,0.32,1.6) forwards;}&:after{animation:500ms ", " cubic-bezier(0.68,-0.6,0.32,1.6) forwards;}}&[data-state=\"open\"] .actionsMenu__cross{&:before{animation:500ms ", " cubic-bezier(0.68,-0.6,0.32,1.6) forwards;}&:after{animation:500ms ", " cubic-bezier(0.68,-0.6,0.32,1.6) forwards;}}&[data-state=\"closed\"] .actionsMenu__dots{&:before{animation:500ms ", " cubic-bezier(0.68,-0.6,0.32,1.6) forwards;}&:after{animation:500ms ", " cubic-bezier(0.68,-0.6,0.32,1.6) forwards;}}&[data-state=\"closed\"] .actionsMenu__cross{&:before{animation:500ms ", " cubic-bezier(0.68,-0.6,0.32,1.6) forwards;}&:after{animation:500ms ", " cubic-bezier(0.68,-0.6,0.32,1.6) forwards;}}"], props => themeGet("colors.white")(props), props => themeGet("colors.greyLight")(props), props => themeGet("radii.2")(props), props => themeGet("transition.transitionDefault")(props), props => themeGet("colors.primary")(props), beforeDotCollapsing, afterDotCollapsing, beforeCrossExpanding, afterCrossExpanding, beforeDotExpanding, afterDotExpanding, beforeCrossCollapsing, afterCrossCollapsing);
|
|
25
|
+
const Dots = styled.div.withConfig({
|
|
26
|
+
displayName: "ActionsMenu__Dots",
|
|
28
27
|
componentId: "sc-yvbni2-3"
|
|
29
|
-
})(["border-radius:2px;height:4px;width:4px;background-color:", ";&:before,&:after{content:\"\";display:block;position:absolute;border-radius:2px;height:4px;width:4px;background-color:", ";
|
|
28
|
+
})(["border-radius:2px;height:4px;width:4px;background-color:", ";&:before,&:after{content:\"\";display:block;position:absolute;border-radius:2px;height:4px;width:4px;background-color:", ";}&:before{transform:translate(0,-6px);}&:after{transform:translate(0,6px);}"], props => themeGet("colors.greyDarker")(props), props => themeGet("colors.greyDarker")(props));
|
|
29
|
+
const Cross = styled.div.withConfig({
|
|
30
|
+
displayName: "ActionsMenu__Cross",
|
|
31
|
+
componentId: "sc-yvbni2-4"
|
|
32
|
+
})(["animation:1500ms ", " ease-in-out forwards;opacity:0;position:absolute;left:calc(50% - 2px);top:calc(50% - 2px);&:before,&:after{content:\"\";display:block;position:absolute;border-radius:2px;height:4px;width:4px;background-color:", ";}&:before{transform:rotate(-45deg);}&:after{transform:rotate(45deg);}"], crossFadeIn, props => themeGet("colors.greyDarker")(props));
|
|
30
33
|
const Menu = styled.div.withConfig({
|
|
31
34
|
displayName: "ActionsMenu__Menu",
|
|
32
|
-
componentId: "sc-yvbni2-
|
|
33
|
-
})(["display:block;width:", ";z-index:5;background-color:", ";border-radius:", ";"], props => props.menuWidth ? props.menuWidth : "auto",
|
|
35
|
+
componentId: "sc-yvbni2-5"
|
|
36
|
+
})(["display:block;width:", ";z-index:5;background-color:", ";border:1px solid ", ";box-shadow:", ";border-radius:", ";"], props => props.menuWidth ? props.menuWidth : "auto", themeGet("colors.white"), themeGet("colors.greyLight"), themeGet("shadows.boxDefault"), props => themeGet("radii.2")(props));
|
|
34
37
|
export const ActionsMenuHeading = styled(props => {
|
|
35
38
|
const {
|
|
36
39
|
actionMenu
|
|
@@ -56,8 +59,8 @@ export const ActionsMenuHeading = styled(props => {
|
|
|
56
59
|
role: "button"
|
|
57
60
|
}).withConfig({
|
|
58
61
|
displayName: "ActionsMenu__ActionsMenuHeading",
|
|
59
|
-
componentId: "sc-yvbni2-
|
|
60
|
-
})(["color:", ";padding:8px;width:100%;font-size:", ";font-weight:", ";border-bottom:solid 1px ", ";white-space:nowrap;cursor:", ";"], props => themeGet("colors.
|
|
62
|
+
componentId: "sc-yvbni2-6"
|
|
63
|
+
})(["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");
|
|
61
64
|
export const ActionsMenuItem = styled(props => {
|
|
62
65
|
const {
|
|
63
66
|
id,
|
|
@@ -102,12 +105,12 @@ export const ActionsMenuItem = styled(props => {
|
|
|
102
105
|
role: "menuitem"
|
|
103
106
|
}).withConfig({
|
|
104
107
|
displayName: "ActionsMenu__ActionsMenuItem",
|
|
105
|
-
componentId: "sc-yvbni2-
|
|
108
|
+
componentId: "sc-yvbni2-7"
|
|
106
109
|
})(["", ""], _ref => {
|
|
107
110
|
let {
|
|
108
111
|
Component
|
|
109
112
|
} = _ref;
|
|
110
|
-
return Component ? "" : 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
|
|
113
|
+
return Component ? "" : 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", props => themeGet("colors.white")(props), props => themeGet("colors.greyDarkest")(props), props => themeGet("fontSizes.0")(props), props => themeGet("fontSizes.0")(props), props => themeGet("fonts.main")(props), props => themeGet("fontWeights.2")(props), props => themeGet("transition.transitionDefault")(props), props => themeGet("colors.primaryLightest")(props), props => themeGet("radii.2")(props), props => themeGet("radii.2")(props), props => themeGet("radii.2")(props), props => themeGet("radii.2")(props), props => themeGet("radii.2")(props));
|
|
111
114
|
});
|
|
112
115
|
export const ActionsMenuBody = _ref2 => {
|
|
113
116
|
let {
|
|
@@ -153,11 +156,13 @@ export const ActionsMenuBody = _ref2 => {
|
|
|
153
156
|
"data-testid": dataTestId
|
|
154
157
|
})
|
|
155
158
|
}), [ariaLabel, onTriggerFocus, id, actionMenu, onToggle, props, triggerRef, dataTestId]);
|
|
156
|
-
let triggerComponent = /*#__PURE__*/
|
|
159
|
+
let triggerComponent = /*#__PURE__*/_jsxs(Control, {
|
|
157
160
|
...triggerProps,
|
|
158
|
-
children: /*#__PURE__*/_jsx(
|
|
159
|
-
className: "
|
|
160
|
-
})
|
|
161
|
+
children: [/*#__PURE__*/_jsx(Dots, {
|
|
162
|
+
className: "actionsMenu__dots"
|
|
163
|
+
}), /*#__PURE__*/_jsx(Cross, {
|
|
164
|
+
className: "actionsMenu__cross"
|
|
165
|
+
})]
|
|
161
166
|
});
|
|
162
167
|
if (renderTrigger) {
|
|
163
168
|
triggerComponent = renderTrigger(triggerProps);
|
|
@@ -1,29 +1,27 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import Flex from ".";
|
|
3
3
|
import Button from "../Button";
|
|
4
|
-
import Spacer from "../Spacer";
|
|
5
4
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
5
|
export default {
|
|
7
6
|
title: "Components/Flex",
|
|
8
7
|
component: Flex
|
|
9
8
|
};
|
|
10
|
-
export const basicFlex = () => /*#__PURE__*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
})
|
|
9
|
+
export const basicFlex = () => /*#__PURE__*/_jsxs(Flex, {
|
|
10
|
+
gap: "r",
|
|
11
|
+
flexWrap: "wrap",
|
|
12
|
+
children: [/*#__PURE__*/_jsx(Button, {
|
|
13
|
+
children: "Button 1"
|
|
14
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
15
|
+
children: "Button 2"
|
|
16
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
17
|
+
children: "Button 3"
|
|
18
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
19
|
+
children: "Button 4"
|
|
20
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
21
|
+
children: "Button 5"
|
|
22
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
23
|
+
children: "Button 6"
|
|
24
|
+
})]
|
|
27
25
|
});
|
|
28
26
|
basicFlex.storyName = "Basic Flex";
|
|
29
27
|
basicFlex.__docgenInfo = {
|
|
@@ -13,8 +13,9 @@ const FlexWrapper = styled("div").withConfig({
|
|
|
13
13
|
componentId: "sc-1f3kfw7-0"
|
|
14
14
|
}).attrs(props => ({
|
|
15
15
|
"data-testid": props.dataTestId ? props.dataTestId : props["data-testid"] ? props["data-testid"] : null
|
|
16
|
-
}))(css({
|
|
17
|
-
boxSizing: "border-box"
|
|
16
|
+
}))(props => css({
|
|
17
|
+
boxSizing: "border-box",
|
|
18
|
+
gap: props.gap
|
|
18
19
|
}), FlexStyles);
|
|
19
20
|
const FlexItem = styled("div").withConfig({
|
|
20
21
|
displayName: "Flex__FlexItem",
|
|
@@ -25,10 +26,12 @@ const FlexItem = styled("div").withConfig({
|
|
|
25
26
|
export default function Flex(_ref) {
|
|
26
27
|
let {
|
|
27
28
|
children,
|
|
29
|
+
gap,
|
|
28
30
|
theme,
|
|
29
31
|
...props
|
|
30
32
|
} = _ref;
|
|
31
33
|
const component = /*#__PURE__*/_jsx(FlexWrapper, {
|
|
34
|
+
gap: gap,
|
|
32
35
|
...props,
|
|
33
36
|
children: children
|
|
34
37
|
});
|
|
@@ -49,6 +52,7 @@ export default function Flex(_ref) {
|
|
|
49
52
|
Flex.propTypes = {
|
|
50
53
|
/** Children of `Flex` are taken as node elements */
|
|
51
54
|
children: PropTypes.node,
|
|
55
|
+
gap: PropTypes.string,
|
|
52
56
|
theme: PropTypes.object,
|
|
53
57
|
...styledPropTypes.space,
|
|
54
58
|
...styledPropTypes.layout,
|
|
@@ -109,6 +113,13 @@ Flex.__docgenInfo = {
|
|
|
109
113
|
},
|
|
110
114
|
"required": false
|
|
111
115
|
},
|
|
116
|
+
"gap": {
|
|
117
|
+
"description": "",
|
|
118
|
+
"type": {
|
|
119
|
+
"name": "string"
|
|
120
|
+
},
|
|
121
|
+
"required": false
|
|
122
|
+
},
|
|
112
123
|
"theme": {
|
|
113
124
|
"description": "",
|
|
114
125
|
"type": {
|
|
@@ -306,6 +306,7 @@ const Select = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
306
306
|
padding: "6.5px 6px 6.5px 5px",
|
|
307
307
|
display: state.data.isFixed ? "none" : provided.display,
|
|
308
308
|
cursor: "pointer",
|
|
309
|
+
alignSelf: "stretch",
|
|
309
310
|
borderRadius: "0 15px 15px 0",
|
|
310
311
|
transition: themeGet("transition.transitionDefault")({
|
|
311
312
|
theme
|
|
@@ -203,11 +203,21 @@ export const withTagType = () => /*#__PURE__*/_jsxs(Spacer, {
|
|
|
203
203
|
children: "product design"
|
|
204
204
|
})]
|
|
205
205
|
});
|
|
206
|
-
export const smallVariant = () => /*#__PURE__*/
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
206
|
+
export const smallVariant = () => /*#__PURE__*/_jsxs(Spacer, {
|
|
207
|
+
m: "2px",
|
|
208
|
+
children: [/*#__PURE__*/_jsx(Tag, {
|
|
209
|
+
selected: true,
|
|
210
|
+
tagType: "specialist",
|
|
211
|
+
small: true,
|
|
212
|
+
children: "Agile Coach"
|
|
213
|
+
}), /*#__PURE__*/_jsx(Tag, {
|
|
214
|
+
selected: true,
|
|
215
|
+
showRemove: true,
|
|
216
|
+
showEdit: true,
|
|
217
|
+
tagType: "Project",
|
|
218
|
+
small: true,
|
|
219
|
+
children: "Infracore 2.0"
|
|
220
|
+
})]
|
|
211
221
|
});
|
|
212
222
|
export const highlightedVariant = () => /*#__PURE__*/_jsx(Tag, {
|
|
213
223
|
selected: true,
|
|
@@ -20,7 +20,7 @@ const TagValue = styled.button.attrs(props => ({
|
|
|
20
20
|
const TagValueText = styled.div.withConfig({
|
|
21
21
|
displayName: "Tag__TagValueText",
|
|
22
22
|
componentId: "sc-1dh2aa8-2"
|
|
23
|
-
})(["text-decoration:", ";
|
|
23
|
+
})(["text-decoration:", ";white-space:normal;text-align:left;line-height:", ";padding-bottom:1px;"], props => props.showStrikeThrough ? "line-through" : "none", props => props.small ? themeGet("fontSizes.0")(props) : themeGet("fontSizes.1")(props));
|
|
24
24
|
const TagActionIconWrapper = styled(TagValue).withConfig({
|
|
25
25
|
displayName: "Tag__TagActionIconWrapper",
|
|
26
26
|
componentId: "sc-1dh2aa8-3"
|
|
@@ -28,11 +28,11 @@ const TagActionIconWrapper = styled(TagValue).withConfig({
|
|
|
28
28
|
const TagRemoveIconWrapper = styled(TagValue).withConfig({
|
|
29
29
|
displayName: "Tag__TagRemoveIconWrapper",
|
|
30
30
|
componentId: "sc-1dh2aa8-4"
|
|
31
|
-
})(["border-radius:0 15px 15px 0;padding:", ";&:focus{z-index:2;}", ""], props => props.small ? "
|
|
31
|
+
})(["border-radius:0 15px 15px 0;padding:", ";&:focus{z-index:2;}", ""], props => props.small ? "2px 8px 2px 7px" : "2px 10px 2px 9px", props => props.selected ? css(["border-left:", ";&:hover{border-left:", ";}"], props => props.selected && props.highlighted ? `solid 1px ${themeGet("colors.warningDarker")(props)}` : `solid 1px ${themeGet("colors.primaryDark")(props)}`, props => props.selected && props.highlighted ? `solid 1px ${themeGet("colors.warningDarker")(props)}` : `solid 1px ${themeGet("colors.primaryDark")(props)}`) : css(["border-left:0;&:hover,&:focus{background-color:", ";border-left:0;}"], themeGet("colors.primaryLightest")(props)));
|
|
32
32
|
const TagType = styled.div.withConfig({
|
|
33
33
|
displayName: "Tag__TagType",
|
|
34
34
|
componentId: "sc-1dh2aa8-5"
|
|
35
|
-
})(["text-transform:uppercase;margin-left:", ";padding:", ";line-height:1;white-space:
|
|
35
|
+
})(["text-transform:uppercase;margin-left:", ";padding:", ";line-height:1;white-space:nowrap;text-align:left;flex:1 1 auto;border-radius:", ";font-size:", ";background-color:", ";color:", ";"], props => props.small ? "6px" : "10px", props => props.small ? themeGet("space.2")(props) : themeGet("space.2")(props), props => themeGet("radii.1")(props), props => props.small ? "1rem" : themeGet("fontSizes.0")(props), props => props.disabled ? themeGet("colors.grey")(props) : props.selected && props.highlighted ? themeGet("colors.warningLighter")(props) : props.selected ? "rgba(0,0,0,0.25)" : themeGet("colors.primaryLightest")(props), props => props.disabled ? themeGet("colors.white")(props) : props.selected && props.highlighted ? themeGet("colors.black70")(props) : props.selected ? themeGet("colors.white")(props) : themeGet("colors.primaryDark")(props));
|
|
36
36
|
const TagAvatar = styled(Avatar).withConfig({
|
|
37
37
|
displayName: "Tag__TagAvatar",
|
|
38
38
|
componentId: "sc-1dh2aa8-6"
|
|
@@ -60,6 +60,7 @@ export default function Tag(_ref) {
|
|
|
60
60
|
showStrikeThrough,
|
|
61
61
|
children,
|
|
62
62
|
isPending,
|
|
63
|
+
ariaLabel,
|
|
63
64
|
small,
|
|
64
65
|
highlighted,
|
|
65
66
|
personEntity,
|
|
@@ -77,8 +78,7 @@ export default function Tag(_ref) {
|
|
|
77
78
|
showRemove: showRemove,
|
|
78
79
|
onClick: onSelect,
|
|
79
80
|
small: small,
|
|
80
|
-
"aria-label":
|
|
81
|
-
title: "Navigate to tag",
|
|
81
|
+
"aria-label": ariaLabel,
|
|
82
82
|
children: [personEntity && /*#__PURE__*/_jsx(TagAvatar, {
|
|
83
83
|
selected: selected,
|
|
84
84
|
highlighted: highlighted,
|
|
@@ -110,11 +110,11 @@ export default function Tag(_ref) {
|
|
|
110
110
|
showRemove: showRemove,
|
|
111
111
|
onClick: onEdit,
|
|
112
112
|
small: small,
|
|
113
|
-
"aria-label": "Edit
|
|
114
|
-
title: "Edit
|
|
113
|
+
"aria-label": "Edit",
|
|
114
|
+
title: "Edit",
|
|
115
115
|
children: /*#__PURE__*/_jsx(Icon, {
|
|
116
116
|
icon: ["fas", "pen"],
|
|
117
|
-
size: "
|
|
117
|
+
size: "sm"
|
|
118
118
|
})
|
|
119
119
|
}), showInfo && /*#__PURE__*/_jsx(TagActionIconWrapper, {
|
|
120
120
|
selected: selected,
|
|
@@ -123,11 +123,11 @@ export default function Tag(_ref) {
|
|
|
123
123
|
onClick: onInfo,
|
|
124
124
|
showInfo: showInfo,
|
|
125
125
|
small: small,
|
|
126
|
-
"aria-label": "View
|
|
127
|
-
title: "View
|
|
126
|
+
"aria-label": "View details",
|
|
127
|
+
title: "View details",
|
|
128
128
|
children: /*#__PURE__*/_jsx(Icon, {
|
|
129
129
|
icon: ["fas", "info"],
|
|
130
|
-
size: "
|
|
130
|
+
size: "sm"
|
|
131
131
|
})
|
|
132
132
|
}), showRemove && /*#__PURE__*/_jsx(TagRemoveIconWrapper, {
|
|
133
133
|
selected: selected,
|
|
@@ -135,11 +135,11 @@ export default function Tag(_ref) {
|
|
|
135
135
|
disabled: disabled,
|
|
136
136
|
onClick: onRemove,
|
|
137
137
|
small: small,
|
|
138
|
-
"aria-label": "Remove
|
|
139
|
-
title: "Remove
|
|
138
|
+
"aria-label": "Remove",
|
|
139
|
+
title: "Remove",
|
|
140
140
|
children: /*#__PURE__*/_jsx(Icon, {
|
|
141
141
|
icon: ["fas", "times"],
|
|
142
|
-
size: "
|
|
142
|
+
size: "sm"
|
|
143
143
|
})
|
|
144
144
|
})]
|
|
145
145
|
});
|
|
@@ -183,7 +183,9 @@ Tag.propTypes = {
|
|
|
183
183
|
/** Applies a highlighted style and colour to the tag */
|
|
184
184
|
highlighted: PropTypes.bool,
|
|
185
185
|
/** Allows you to set a person avatar image or initials */
|
|
186
|
-
personEntity: PropTypes.object
|
|
186
|
+
personEntity: PropTypes.object,
|
|
187
|
+
/** Add ariaLabel text describing to screen readers what this tag button does when pressed. e.g. Apply filter or Navigate to tag. */
|
|
188
|
+
ariaLabel: PropTypes.string.isRequired
|
|
187
189
|
};
|
|
188
190
|
Tag.defaultProps = {
|
|
189
191
|
selected: false,
|
|
@@ -365,6 +367,13 @@ Tag.__docgenInfo = {
|
|
|
365
367
|
"name": "object"
|
|
366
368
|
},
|
|
367
369
|
"required": false
|
|
370
|
+
},
|
|
371
|
+
"ariaLabel": {
|
|
372
|
+
"description": "Add ariaLabel text describing to screen readers what this tag button does when pressed. e.g. Apply filter or Navigate to tag.",
|
|
373
|
+
"type": {
|
|
374
|
+
"name": "string"
|
|
375
|
+
},
|
|
376
|
+
"required": true
|
|
368
377
|
}
|
|
369
378
|
}
|
|
370
379
|
};
|