orcs-design-system 2.0.72 → 2.0.75
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,43 @@ 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",
|
|
164
|
+
"&:has(> div)": {
|
|
165
|
+
backgroundColor: "transparent",
|
|
166
|
+
padding: "0 !important",
|
|
167
|
+
borderRadius: "0 !important"
|
|
168
|
+
}
|
|
162
169
|
});
|
|
163
170
|
},
|
|
164
171
|
multiValueRemove: function multiValueRemove(provided, state) {
|
|
165
172
|
return _objectSpread(_objectSpread({}, provided), {}, {
|
|
166
|
-
backgroundColor:
|
|
173
|
+
backgroundColor: themeGet("colors.primary")(props),
|
|
167
174
|
color: themeGet("colors.white")(props),
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
paddingRight: themeGet("space.1")(props),
|
|
175
|
+
borderLeft: "solid 1px ".concat(themeGet("colors.primaryDark")(props)),
|
|
176
|
+
padding: "6.5px 6px 6.5px 5px",
|
|
171
177
|
display: state.data.isFixed ? "none" : provided.display,
|
|
178
|
+
cursor: "pointer",
|
|
179
|
+
borderRadius: "0 15px 15px 0",
|
|
180
|
+
transition: themeGet("transition.transitionDefault")(props),
|
|
172
181
|
"&:hover": {
|
|
173
|
-
backgroundColor: themeGet("colors.
|
|
182
|
+
backgroundColor: themeGet("colors.primaryDark")(props),
|
|
174
183
|
color: themeGet("colors.white")(props)
|
|
175
184
|
}
|
|
176
185
|
});
|
|
@@ -180,7 +189,7 @@ var Select = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
180
189
|
opacity: state.isDisabled ? 0.7 : 1,
|
|
181
190
|
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
191
|
fontSize: themeGet("fontSizes.1")(props),
|
|
183
|
-
whiteSpace: "
|
|
192
|
+
whiteSpace: "break-spaces"
|
|
184
193
|
});
|
|
185
194
|
},
|
|
186
195
|
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
|
|
@@ -72,13 +72,16 @@ var TagType = styled.div.withConfig({
|
|
|
72
72
|
|
|
73
73
|
export default function Tag(_ref) {
|
|
74
74
|
var selected = _ref.selected,
|
|
75
|
+
onSelect = _ref.onSelect,
|
|
75
76
|
disabled = _ref.disabled,
|
|
76
77
|
showRemove = _ref.showRemove,
|
|
78
|
+
onRemove = _ref.onRemove,
|
|
77
79
|
theme = _ref.theme,
|
|
78
80
|
tagType = _ref.tagType,
|
|
79
81
|
showEdit = _ref.showEdit,
|
|
82
|
+
onEdit = _ref.onEdit,
|
|
80
83
|
children = _ref.children,
|
|
81
|
-
props = _objectWithoutProperties(_ref, ["selected", "disabled", "showRemove", "theme", "tagType", "showEdit", "children"]);
|
|
84
|
+
props = _objectWithoutProperties(_ref, ["selected", "onSelect", "disabled", "showRemove", "onRemove", "theme", "tagType", "showEdit", "onEdit", "children"]);
|
|
82
85
|
|
|
83
86
|
return /*#__PURE__*/React.createElement(ThemeProvider, {
|
|
84
87
|
theme: theme
|
|
@@ -86,20 +89,23 @@ export default function Tag(_ref) {
|
|
|
86
89
|
selected: selected,
|
|
87
90
|
disabled: disabled,
|
|
88
91
|
showEdit: showEdit,
|
|
89
|
-
showRemove: showRemove
|
|
92
|
+
showRemove: showRemove,
|
|
93
|
+
onClick: onSelect
|
|
90
94
|
}, children, tagType ? /*#__PURE__*/React.createElement(TagType, {
|
|
91
95
|
selected: selected,
|
|
92
96
|
disabled: disabled
|
|
93
97
|
}, tagType) : null), showEdit ? /*#__PURE__*/React.createElement(TagEdit, {
|
|
94
98
|
selected: selected,
|
|
95
99
|
disabled: disabled,
|
|
96
|
-
showRemove: showRemove
|
|
100
|
+
showRemove: showRemove,
|
|
101
|
+
onClick: onEdit
|
|
97
102
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
98
103
|
icon: ["fas", "pen"],
|
|
99
104
|
size: "xs"
|
|
100
105
|
})) : null, showRemove ? /*#__PURE__*/React.createElement(TagRemove, {
|
|
101
106
|
selected: selected,
|
|
102
|
-
disabled: disabled
|
|
107
|
+
disabled: disabled,
|
|
108
|
+
onClick: onRemove
|
|
103
109
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
104
110
|
icon: ["fas", "times"],
|
|
105
111
|
size: "xs"
|
|
@@ -109,12 +115,21 @@ Tag.propTypes = {
|
|
|
109
115
|
/** Adds selected styling to tag */
|
|
110
116
|
selected: PropTypes.bool,
|
|
111
117
|
|
|
118
|
+
/** On tag selected */
|
|
119
|
+
onSelect: PropTypes.func,
|
|
120
|
+
|
|
112
121
|
/** Shows the remove button */
|
|
113
122
|
showRemove: PropTypes.bool,
|
|
114
123
|
|
|
124
|
+
/** On tag remove button clicked */
|
|
125
|
+
onRemove: PropTypes.func,
|
|
126
|
+
|
|
115
127
|
/** Shows edit button */
|
|
116
128
|
showEdit: PropTypes.bool,
|
|
117
129
|
|
|
130
|
+
/** On tag edit button clicked */
|
|
131
|
+
onEdit: PropTypes.func,
|
|
132
|
+
|
|
118
133
|
/** Can add a type to a tag as text */
|
|
119
134
|
tagType: PropTypes.string,
|
|
120
135
|
|
|
@@ -191,6 +206,27 @@ Tag.__docgenInfo = {
|
|
|
191
206
|
"required": false,
|
|
192
207
|
"description": "Specifies the design theme"
|
|
193
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
|
+
},
|
|
194
230
|
"tagType": {
|
|
195
231
|
"type": {
|
|
196
232
|
"name": "string"
|