orcs-design-system 2.0.71 → 2.0.74
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.
|
@@ -110,7 +110,7 @@ var Select = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
110
110
|
},
|
|
111
111
|
valueContainer: function valueContainer(provided) {
|
|
112
112
|
return _objectSpread(_objectSpread({}, provided), {}, {
|
|
113
|
-
padding: props.padding ? props.padding : "2px
|
|
113
|
+
padding: props.padding ? props.padding : "2px 4px"
|
|
114
114
|
});
|
|
115
115
|
},
|
|
116
116
|
clearIndicator: function clearIndicator(provided, state) {
|
|
@@ -143,34 +143,38 @@ var Select = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
143
143
|
multiValue: function multiValue(provided, state) {
|
|
144
144
|
return _objectSpread(_objectSpread({}, provided), {}, {
|
|
145
145
|
opacity: state.isDisabled ? 0.7 : 1,
|
|
146
|
-
backgroundColor:
|
|
146
|
+
backgroundColor: "transparent",
|
|
147
147
|
color: themeGet("colors.white")(props),
|
|
148
|
-
|
|
148
|
+
alignItems: "center",
|
|
149
|
+
padding: "0 !important",
|
|
149
150
|
fontSize: themeGet("fontSizes.1")(props),
|
|
150
151
|
wordWrap: "break-word"
|
|
151
152
|
});
|
|
152
153
|
},
|
|
153
|
-
multiValueLabel: function multiValueLabel(provided) {
|
|
154
|
+
multiValueLabel: function multiValueLabel(provided, state) {
|
|
154
155
|
return _objectSpread(_objectSpread({}, provided), {}, {
|
|
155
|
-
backgroundColor:
|
|
156
|
+
backgroundColor: themeGet("colors.primary")(props),
|
|
156
157
|
color: themeGet("colors.white"),
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
158
|
+
padding: state.data.isFixed ? "4px 10px 5px 10px !important" : "4px 8px 5px 10px !important",
|
|
159
|
+
fontSize: "1.3rem",
|
|
160
|
+
fontWeight: "600",
|
|
160
161
|
wordWrap: "break-word",
|
|
161
|
-
whiteSpace: "
|
|
162
|
+
whiteSpace: "break-spaces",
|
|
163
|
+
borderRadius: state.data.isFixed ? "15px" : "15px 0 0 15px"
|
|
162
164
|
});
|
|
163
165
|
},
|
|
164
166
|
multiValueRemove: function multiValueRemove(provided, state) {
|
|
165
167
|
return _objectSpread(_objectSpread({}, provided), {}, {
|
|
166
|
-
backgroundColor:
|
|
168
|
+
backgroundColor: themeGet("colors.primary")(props),
|
|
167
169
|
color: themeGet("colors.white")(props),
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
paddingRight: themeGet("space.1")(props),
|
|
170
|
+
borderLeft: "solid 1px ".concat(themeGet("colors.primaryDark")(props)),
|
|
171
|
+
padding: "6.5px 6px 6.5px 5px",
|
|
171
172
|
display: state.data.isFixed ? "none" : provided.display,
|
|
173
|
+
cursor: "pointer",
|
|
174
|
+
borderRadius: "0 15px 15px 0",
|
|
175
|
+
transition: themeGet("transition.transitionDefault")(props),
|
|
172
176
|
"&:hover": {
|
|
173
|
-
backgroundColor: themeGet("colors.
|
|
177
|
+
backgroundColor: themeGet("colors.primaryDark")(props),
|
|
174
178
|
color: themeGet("colors.white")(props)
|
|
175
179
|
}
|
|
176
180
|
});
|
|
@@ -180,7 +184,7 @@ var Select = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
180
184
|
opacity: state.isDisabled ? 0.7 : 1,
|
|
181
185
|
backgroundColor: !state.isFocused && !props.inverted ? themeGet("colors.white")(props) : state.isFocused && !props.inverted ? themeGet("colors.primaryLightest")(props) : !state.isFocused && props.inverted ? themeGet("colors.greyDarker")(props) : themeGet("colors.primaryDark")(props),
|
|
182
186
|
fontSize: themeGet("fontSizes.1")(props),
|
|
183
|
-
whiteSpace: "
|
|
187
|
+
whiteSpace: "break-spaces"
|
|
184
188
|
});
|
|
185
189
|
},
|
|
186
190
|
placeholder: function placeholder(provided, state) {
|
|
@@ -66,14 +66,32 @@ export var showEditAndRemove = function showEditAndRemove() {
|
|
|
66
66
|
}, /*#__PURE__*/React.createElement(Tag, {
|
|
67
67
|
selected: true,
|
|
68
68
|
showEdit: true,
|
|
69
|
-
showRemove: true
|
|
69
|
+
showRemove: true,
|
|
70
|
+
onSelect: function onSelect() {
|
|
71
|
+
return console.log("select");
|
|
72
|
+
},
|
|
73
|
+
onEdit: function onEdit() {
|
|
74
|
+
return console.log("edit");
|
|
75
|
+
},
|
|
76
|
+
onRemove: function onRemove() {
|
|
77
|
+
return console.log("remove");
|
|
78
|
+
}
|
|
70
79
|
}, "devops"), /*#__PURE__*/React.createElement(Tag, {
|
|
71
80
|
selected: true,
|
|
72
81
|
showEdit: true,
|
|
73
82
|
showRemove: true
|
|
74
83
|
}, "software engineering"), /*#__PURE__*/React.createElement(Tag, {
|
|
75
84
|
showEdit: true,
|
|
76
|
-
showRemove: true
|
|
85
|
+
showRemove: true,
|
|
86
|
+
onSelect: function onSelect() {
|
|
87
|
+
return console.log("select");
|
|
88
|
+
},
|
|
89
|
+
onEdit: function onEdit() {
|
|
90
|
+
return console.log("edit");
|
|
91
|
+
},
|
|
92
|
+
onRemove: function onRemove() {
|
|
93
|
+
return console.log("remove");
|
|
94
|
+
}
|
|
77
95
|
}, "product design"), /*#__PURE__*/React.createElement(Tag, {
|
|
78
96
|
showEdit: true,
|
|
79
97
|
showRemove: true
|
|
@@ -13,18 +13,18 @@ var TagWrapper = styled.div.withConfig({
|
|
|
13
13
|
var TagValue = styled.button.withConfig({
|
|
14
14
|
displayName: "Tag__TagValue",
|
|
15
15
|
componentId: "sc-1dh2aa8-1"
|
|
16
|
-
})(["-moz-appearance:none;-webkit-appearance:none;appearance:none;box-shadow:none;font-family:\"Open Sans\",\"Helvetica Neue\",Helvetica,Arial,sans-serif;display:flex;align-items:center;flex-wrap:nowrap;font-size:1.
|
|
16
|
+
})(["-moz-appearance:none;-webkit-appearance:none;appearance:none;box-shadow:none;font-family:\"Open Sans\",\"Helvetica Neue\",Helvetica,Arial,sans-serif;display:flex;align-items:center;flex-wrap:nowrap;font-size:1.3rem;font-weight:600;white-space:nowrap;position:relative;z-index:1;transition:", ";cursor:", ";border-radius:", ";border:solid 1px ", ";padding:", ";background-color:", ";color:", ";", " &:focus{outline:0;z-index:2;box-shadow:", ";}"], themeGet("transition.transitionDefault"), function (props) {
|
|
17
17
|
return props.disabled ? "default" : "pointer";
|
|
18
18
|
}, function (props) {
|
|
19
19
|
return props.showEdit || props.showRemove ? "15px 0 0 15px" : "15px";
|
|
20
20
|
}, function (props) {
|
|
21
|
-
return props.disabled ? themeGet("colors.
|
|
21
|
+
return props.disabled ? themeGet("colors.greyLight") : themeGet("colors.primary");
|
|
22
22
|
}, function (props) {
|
|
23
|
-
return props.showEdit || props.showRemove ? "3px
|
|
23
|
+
return props.showEdit || props.showRemove ? "3px 4px 4px 10px" : "3px 10px 4px 10px";
|
|
24
24
|
}, function (props) {
|
|
25
|
-
return props.selected ? themeGet("colors.primary") : props.disabled ? themeGet("colors.
|
|
25
|
+
return props.selected ? themeGet("colors.primary") : props.disabled ? themeGet("colors.greyLighter") : themeGet("colors.white");
|
|
26
26
|
}, function (props) {
|
|
27
|
-
return props.selected ? themeGet("colors.white") : props.disabled ? themeGet("colors.
|
|
27
|
+
return props.selected ? themeGet("colors.white") : props.disabled ? themeGet("colors.greyDarker") : themeGet("colors.primary");
|
|
28
28
|
}, function (props) {
|
|
29
29
|
return props.disabled ? css([""]) : css(["&:hover{border:solid 1px ", ";color:", ";background-color:", ";div{color:", ";}}"], themeGet("colors.primaryDark"), function (props) {
|
|
30
30
|
return props.selected ? themeGet("colors.white") : themeGet("colors.primaryDark");
|
|
@@ -39,8 +39,10 @@ var TagValue = styled.button.withConfig({
|
|
|
39
39
|
var TagEdit = styled(TagValue).withConfig({
|
|
40
40
|
displayName: "Tag__TagEdit",
|
|
41
41
|
componentId: "sc-1dh2aa8-2"
|
|
42
|
-
})(["border-radius:", ";padding:
|
|
42
|
+
})(["border-radius:", ";padding:", ";&:focus{z-index:2;box-shadow:-0.5px 0 0 3.5px ", ";}", ""], function (props) {
|
|
43
43
|
return props.showRemove ? "0" : "0 15px 15px 0";
|
|
44
|
+
}, function (props) {
|
|
45
|
+
return props.showRemove ? "2px 7px 5px 7px" : "2px 8px 5px 8px";
|
|
44
46
|
}, themeGet("colors.primary30"), function (props) {
|
|
45
47
|
return props.selected ? css(["border-left:solid 1px ", ";&:hover{border-left:solid 1px ", ";}&:focus{box-shadow:", ";}"], themeGet("colors.primaryDark"), themeGet("colors.primaryDark"), function (props) {
|
|
46
48
|
return themeGet("shadows.thinOutline")(props) + " " + themeGet("colors.primary30")(props);
|
|
@@ -49,7 +51,7 @@ var TagEdit = styled(TagValue).withConfig({
|
|
|
49
51
|
var TagRemove = styled(TagValue).withConfig({
|
|
50
52
|
displayName: "Tag__TagRemove",
|
|
51
53
|
componentId: "sc-1dh2aa8-3"
|
|
52
|
-
})(["border-radius:0 15px 15px 0;padding:2px
|
|
54
|
+
})(["border-radius:0 15px 15px 0;padding:2px 10px 5px 9px;&:focus{z-index:2;box-shadow:-0.5px 0 0 3.5px ", ";}", ""], themeGet("colors.primary30"), function (props) {
|
|
53
55
|
return props.selected ? css(["border-left:solid 1px ", ";&:hover{border-left:solid 1px ", ";}&:focus{box-shadow:", ";}"], themeGet("colors.primaryDark"), themeGet("colors.primaryDark"), function (props) {
|
|
54
56
|
return themeGet("shadows.thinOutline")(props) + " " + themeGet("colors.primary30")(props);
|
|
55
57
|
}) : css(["border-left:0;&:hover{border-left:0;}"]);
|
|
@@ -57,8 +59,8 @@ var TagRemove = styled(TagValue).withConfig({
|
|
|
57
59
|
var TagType = styled.div.withConfig({
|
|
58
60
|
displayName: "Tag__TagType",
|
|
59
61
|
componentId: "sc-1dh2aa8-4"
|
|
60
|
-
})(["text-transform:uppercase;margin-left:", ";padding:3px;line-height:1;border-radius:", ";font-size:", ";background-color:", ";color:", ";"], themeGet("space.s"), themeGet("radii.1"), themeGet("fontSizes.0"), function (props) {
|
|
61
|
-
return props.selected ? themeGet("colors.primaryDark") : props.disabled ? themeGet("colors.
|
|
62
|
+
})(["text-transform:uppercase;margin-left:", ";padding:3px;font-size:1.2rem;line-height:1;border-radius:", ";font-size:", ";background-color:", ";color:", ";"], themeGet("space.s"), themeGet("radii.1"), themeGet("fontSizes.0"), function (props) {
|
|
63
|
+
return props.selected ? themeGet("colors.primaryDark") : props.disabled ? themeGet("colors.grey") : themeGet("colors.primaryLightest");
|
|
62
64
|
}, function (props) {
|
|
63
65
|
return props.selected ? themeGet("colors.white") : props.disabled ? themeGet("colors.white") : themeGet("colors.primary");
|
|
64
66
|
});
|
|
@@ -70,13 +72,16 @@ var TagType = styled.div.withConfig({
|
|
|
70
72
|
|
|
71
73
|
export default function Tag(_ref) {
|
|
72
74
|
var selected = _ref.selected,
|
|
75
|
+
onSelect = _ref.onSelect,
|
|
73
76
|
disabled = _ref.disabled,
|
|
74
77
|
showRemove = _ref.showRemove,
|
|
78
|
+
onRemove = _ref.onRemove,
|
|
75
79
|
theme = _ref.theme,
|
|
76
80
|
tagType = _ref.tagType,
|
|
77
81
|
showEdit = _ref.showEdit,
|
|
82
|
+
onEdit = _ref.onEdit,
|
|
78
83
|
children = _ref.children,
|
|
79
|
-
props = _objectWithoutProperties(_ref, ["selected", "disabled", "showRemove", "theme", "tagType", "showEdit", "children"]);
|
|
84
|
+
props = _objectWithoutProperties(_ref, ["selected", "onSelect", "disabled", "showRemove", "onRemove", "theme", "tagType", "showEdit", "onEdit", "children"]);
|
|
80
85
|
|
|
81
86
|
return /*#__PURE__*/React.createElement(ThemeProvider, {
|
|
82
87
|
theme: theme
|
|
@@ -84,20 +89,23 @@ export default function Tag(_ref) {
|
|
|
84
89
|
selected: selected,
|
|
85
90
|
disabled: disabled,
|
|
86
91
|
showEdit: showEdit,
|
|
87
|
-
showRemove: showRemove
|
|
92
|
+
showRemove: showRemove,
|
|
93
|
+
onClick: onSelect
|
|
88
94
|
}, children, tagType ? /*#__PURE__*/React.createElement(TagType, {
|
|
89
95
|
selected: selected,
|
|
90
96
|
disabled: disabled
|
|
91
97
|
}, tagType) : null), showEdit ? /*#__PURE__*/React.createElement(TagEdit, {
|
|
92
98
|
selected: selected,
|
|
93
99
|
disabled: disabled,
|
|
94
|
-
showRemove: showRemove
|
|
100
|
+
showRemove: showRemove,
|
|
101
|
+
onClick: onEdit
|
|
95
102
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
96
103
|
icon: ["fas", "pen"],
|
|
97
104
|
size: "xs"
|
|
98
105
|
})) : null, showRemove ? /*#__PURE__*/React.createElement(TagRemove, {
|
|
99
106
|
selected: selected,
|
|
100
|
-
disabled: disabled
|
|
107
|
+
disabled: disabled,
|
|
108
|
+
onClick: onRemove
|
|
101
109
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
102
110
|
icon: ["fas", "times"],
|
|
103
111
|
size: "xs"
|
|
@@ -107,12 +115,21 @@ Tag.propTypes = {
|
|
|
107
115
|
/** Adds selected styling to tag */
|
|
108
116
|
selected: PropTypes.bool,
|
|
109
117
|
|
|
118
|
+
/** On tag selected */
|
|
119
|
+
onSelect: PropTypes.func,
|
|
120
|
+
|
|
110
121
|
/** Shows the remove button */
|
|
111
122
|
showRemove: PropTypes.bool,
|
|
112
123
|
|
|
124
|
+
/** On tag remove button clicked */
|
|
125
|
+
onRemove: PropTypes.func,
|
|
126
|
+
|
|
113
127
|
/** Shows edit button */
|
|
114
128
|
showEdit: PropTypes.bool,
|
|
115
129
|
|
|
130
|
+
/** On tag edit button clicked */
|
|
131
|
+
onEdit: PropTypes.func,
|
|
132
|
+
|
|
116
133
|
/** Can add a type to a tag as text */
|
|
117
134
|
tagType: PropTypes.string,
|
|
118
135
|
|
|
@@ -189,6 +206,27 @@ Tag.__docgenInfo = {
|
|
|
189
206
|
"required": false,
|
|
190
207
|
"description": "Specifies the design theme"
|
|
191
208
|
},
|
|
209
|
+
"onSelect": {
|
|
210
|
+
"type": {
|
|
211
|
+
"name": "func"
|
|
212
|
+
},
|
|
213
|
+
"required": false,
|
|
214
|
+
"description": "On tag selected"
|
|
215
|
+
},
|
|
216
|
+
"onRemove": {
|
|
217
|
+
"type": {
|
|
218
|
+
"name": "func"
|
|
219
|
+
},
|
|
220
|
+
"required": false,
|
|
221
|
+
"description": "On tag remove button clicked"
|
|
222
|
+
},
|
|
223
|
+
"onEdit": {
|
|
224
|
+
"type": {
|
|
225
|
+
"name": "func"
|
|
226
|
+
},
|
|
227
|
+
"required": false,
|
|
228
|
+
"description": "On tag edit button clicked"
|
|
229
|
+
},
|
|
192
230
|
"tagType": {
|
|
193
231
|
"type": {
|
|
194
232
|
"name": "string"
|