orcs-design-system 2.1.21 → 2.1.23
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.
|
@@ -24,8 +24,9 @@ var Item = styled("span").withConfig({
|
|
|
24
24
|
fontWeight: themeGet("fontWeights.2")(props),
|
|
25
25
|
display: "inline-block",
|
|
26
26
|
position: "relative",
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
pt: themeGet("space.2")(props),
|
|
28
|
+
pb: "calc(".concat(themeGet("space.2")(props), " + 1px)"),
|
|
29
|
+
px: themeGet("space.3")(props),
|
|
29
30
|
cursor: "default",
|
|
30
31
|
borderRadius: 1,
|
|
31
32
|
color: themeGet("colors.greyDarkest")(props),
|
|
@@ -165,6 +165,20 @@ export var withTagType = function withTagType() {
|
|
|
165
165
|
tagType: "skill"
|
|
166
166
|
}, "product design"));
|
|
167
167
|
};
|
|
168
|
+
export var smallVariant = function smallVariant() {
|
|
169
|
+
return /*#__PURE__*/React.createElement(Tag, {
|
|
170
|
+
selected: true,
|
|
171
|
+
tagType: "specialist",
|
|
172
|
+
small: true
|
|
173
|
+
}, "Agile Coach");
|
|
174
|
+
};
|
|
175
|
+
export var highlightedVariant = function highlightedVariant() {
|
|
176
|
+
return /*#__PURE__*/React.createElement(Tag, {
|
|
177
|
+
selected: true,
|
|
178
|
+
highlighted: true,
|
|
179
|
+
tagType: "specialist"
|
|
180
|
+
}, "Agile Coach");
|
|
181
|
+
};
|
|
168
182
|
defaultTag.__docgenInfo = {
|
|
169
183
|
"description": "",
|
|
170
184
|
"methods": [],
|
|
@@ -204,4 +218,14 @@ withTagType.__docgenInfo = {
|
|
|
204
218
|
"description": "",
|
|
205
219
|
"methods": [],
|
|
206
220
|
"displayName": "withTagType"
|
|
221
|
+
};
|
|
222
|
+
smallVariant.__docgenInfo = {
|
|
223
|
+
"description": "",
|
|
224
|
+
"methods": [],
|
|
225
|
+
"displayName": "smallVariant"
|
|
226
|
+
};
|
|
227
|
+
highlightedVariant.__docgenInfo = {
|
|
228
|
+
"description": "",
|
|
229
|
+
"methods": [],
|
|
230
|
+
"displayName": "highlightedVariant"
|
|
207
231
|
};
|
|
@@ -13,8 +13,10 @@ 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:", ";font-weight:", ";white-space:nowrap;position:relative;z-index:1;transition:", ";cursor:", ";border-radius:", ";border:solid 1px ", ";padding:", ";background-color:", ";color:", ";", ""], function (props) {
|
|
16
|
+
})(["-moz-appearance:none;-webkit-appearance:none;appearance:none;box-shadow:none;font-family:\"Open Sans\",\"Helvetica Neue\",Helvetica,Arial,sans-serif;line-height:", ";display:flex;align-items:center;flex-wrap:nowrap;font-size:", ";font-weight:", ";white-space:nowrap;position:relative;z-index:1;transition:", ";cursor:", ";border-radius:", ";border:solid 1px ", ";padding:", ";background-color:", ";color:", ";", ""], function (props) {
|
|
17
17
|
return themeGet("fontSizes.1")(props);
|
|
18
|
+
}, function (props) {
|
|
19
|
+
return props.small ? themeGet("fontSizes.0")(props) : themeGet("fontSizes.1")(props);
|
|
18
20
|
}, function (props) {
|
|
19
21
|
return themeGet("fontWeights.2")(props);
|
|
20
22
|
}, function (props) {
|
|
@@ -24,29 +26,33 @@ var TagValue = styled.button.withConfig({
|
|
|
24
26
|
}, function (props) {
|
|
25
27
|
return props.showEdit || props.showRemove ? "15px 0 0 15px" : "15px";
|
|
26
28
|
}, function (props) {
|
|
27
|
-
return props.disabled ? themeGet("colors.greyLight")(props) : themeGet("colors.primary")(props);
|
|
29
|
+
return props.disabled ? themeGet("colors.greyLight")(props) : props.selected && props.highlighted ? themeGet("colors.warningDark")(props) : themeGet("colors.primary")(props);
|
|
28
30
|
}, function (props) {
|
|
29
|
-
return props.showEdit || props.showRemove ? "3px 4px 4px 10px" : "3px 10px 4px 10px";
|
|
31
|
+
return props.showEdit || props.showRemove ? "3px 4px 4px 10px" : props.small ? "calc(".concat(themeGet("space.2")(props), " - 1px)") + " " + themeGet("space.3")(props) + " " + themeGet("space.2")(props) + " " + themeGet("space.3")(props) : "3px 10px 4px 10px";
|
|
30
32
|
}, function (props) {
|
|
31
|
-
return props.selected ? themeGet("colors.
|
|
33
|
+
return props.disabled ? themeGet("colors.greyLighter")(props) : props.selected && props.highlighted ? themeGet("colors.warningDark")(props) : props.selected ? themeGet("colors.primary")(props) : themeGet("colors.white")(props);
|
|
32
34
|
}, function (props) {
|
|
33
|
-
return props.selected ? themeGet("colors.white")(props) : props.
|
|
35
|
+
return props.disabled ? themeGet("colors.greyDarker")(props) : props.selected && props.highlighted ? themeGet("colors.white")(props) : props.selected ? themeGet("colors.white")(props) : themeGet("colors.primary")(props);
|
|
34
36
|
}, function (props) {
|
|
35
|
-
return props.disabled ? css([""]) : css(["&:hover,&:focus{outline:0;border:
|
|
37
|
+
return props.disabled ? css([""]) : css(["&:hover,&:focus{outline:0;border:", ";color:", ";background-color:", ";div{color:", ";}div[class*=\"TagType\"]{background-color:", ";}}"], function (props) {
|
|
38
|
+
return props.selected && props.highlighted ? "solid 1px ".concat(themeGet("colors.warningDarker")(props)) : "solid 1px ".concat(themeGet("colors.primaryDark")(props));
|
|
39
|
+
}, function (props) {
|
|
36
40
|
return props.selected ? themeGet("colors.white")(props) : themeGet("colors.primaryDark")(props);
|
|
37
41
|
}, function (props) {
|
|
38
|
-
return props.selected ? themeGet("colors.primaryDark")(props) : themeGet("colors.primaryLightest")(props);
|
|
42
|
+
return props.selected && props.highlighted ? themeGet("colors.warningDarker")(props) : props.selected ? themeGet("colors.primaryDark")(props) : themeGet("colors.primaryLightest")(props);
|
|
39
43
|
}, function (props) {
|
|
40
44
|
return props.selected ? themeGet("colors.white")(props) : themeGet("colors.primaryDark")(props);
|
|
41
45
|
}, function (props) {
|
|
42
|
-
return props.selected ? themeGet("colors.primaryDarker")(props) : themeGet("colors.primaryLighter")(props);
|
|
46
|
+
return props.selected && props.highlighted ? themeGet("colors.warningDarkest")(props) : props.selected ? themeGet("colors.primaryDarker")(props) : themeGet("colors.primaryLighter")(props);
|
|
43
47
|
});
|
|
44
48
|
});
|
|
45
49
|
var TagValueText = styled.div.withConfig({
|
|
46
50
|
displayName: "Tag__TagValueText",
|
|
47
51
|
componentId: "sc-1dh2aa8-2"
|
|
48
|
-
})(["text-decoration:", ";text-overflow:ellipsis;white-space:normal;text-align:left;"], function (props) {
|
|
52
|
+
})(["text-decoration:", ";text-overflow:ellipsis;white-space:normal;text-align:left;line-height:", ";"], function (props) {
|
|
49
53
|
return props.showStrikeThrough ? "line-through" : "none";
|
|
54
|
+
}, function (props) {
|
|
55
|
+
return themeGet("fontSizes.1")(props);
|
|
50
56
|
});
|
|
51
57
|
var TagEdit = styled(TagValue).withConfig({
|
|
52
58
|
displayName: "Tag__TagEdit",
|
|
@@ -56,27 +62,37 @@ var TagEdit = styled(TagValue).withConfig({
|
|
|
56
62
|
}, function (props) {
|
|
57
63
|
return props.showRemove ? "2px 7px 5px 7px" : "2px 8px 5px 8px";
|
|
58
64
|
}, function (props) {
|
|
59
|
-
return props.selected ? css(["border-left:
|
|
65
|
+
return props.selected ? css(["border-left:", ";&:hover{border-left:", ";}"], function (props) {
|
|
66
|
+
return props.selected && props.highlighted ? "solid 1px ".concat(themeGet("colors.warningDarker")(props)) : "solid 1px ".concat(themeGet("colors.primaryDark")(props));
|
|
67
|
+
}, function (props) {
|
|
68
|
+
return props.selected && props.highlighted ? "solid 1px ".concat(themeGet("colors.warningDarker")(props)) : "solid 1px ".concat(themeGet("colors.primaryDark")(props));
|
|
69
|
+
}) : css(["border-left:0;&:hover,&:focus{background-color:", ";border-left:0;}"], themeGet("colors.primaryLightest")(props));
|
|
60
70
|
});
|
|
61
71
|
var TagRemove = styled(TagValue).withConfig({
|
|
62
72
|
displayName: "Tag__TagRemove",
|
|
63
73
|
componentId: "sc-1dh2aa8-4"
|
|
64
74
|
})(["border-radius:0 15px 15px 0;padding:2px 10px 5px 9px;&:focus{z-index:2;}", ""], function (props) {
|
|
65
|
-
return props.selected ? css(["border-left:
|
|
75
|
+
return props.selected ? css(["border-left:", ";&:hover{border-left:", ";}"], function (props) {
|
|
76
|
+
return props.selected && props.highlighted ? "solid 1px ".concat(themeGet("colors.warningDarker")(props)) : "solid 1px ".concat(themeGet("colors.primaryDark")(props));
|
|
77
|
+
}, function (props) {
|
|
78
|
+
return props.selected && props.highlighted ? "solid 1px ".concat(themeGet("colors.warningDarker")(props)) : "solid 1px ".concat(themeGet("colors.primaryDark")(props));
|
|
79
|
+
}) : css(["border-left:0;&:hover,&:focus{background-color:", ";border-left:0;}"], themeGet("colors.primaryLightest")(props));
|
|
66
80
|
});
|
|
67
81
|
var TagType = styled.div.withConfig({
|
|
68
82
|
displayName: "Tag__TagType",
|
|
69
83
|
componentId: "sc-1dh2aa8-5"
|
|
70
|
-
})(["text-transform:uppercase;margin-left:", ";padding:
|
|
84
|
+
})(["text-transform:uppercase;margin-left:", ";padding:", ";line-height:1;white-space:normal;text-align:left;flex:1 1 auto;border-radius:", ";font-size:", ";background-color:", ";color:", ";"], function (props) {
|
|
71
85
|
return themeGet("space.s")(props);
|
|
86
|
+
}, function (props) {
|
|
87
|
+
return props.small ? themeGet("space.1")(props) : themeGet("space.2")(props);
|
|
72
88
|
}, function (props) {
|
|
73
89
|
return themeGet("radii.1")(props);
|
|
74
90
|
}, function (props) {
|
|
75
|
-
return themeGet("fontSizes.0")(props);
|
|
91
|
+
return props.small ? "1rem" : themeGet("fontSizes.0")(props);
|
|
76
92
|
}, function (props) {
|
|
77
|
-
return props.selected ? themeGet("colors.
|
|
93
|
+
return props.disabled ? themeGet("colors.grey")(props) : props.selected && props.highlighted ? themeGet("colors.black20")(props) : props.selected ? themeGet("colors.primaryDark")(props) : themeGet("colors.primaryLightest")(props);
|
|
78
94
|
}, function (props) {
|
|
79
|
-
return props.selected ? themeGet("colors.white")(props) : props.
|
|
95
|
+
return props.disabled ? themeGet("colors.white")(props) : props.selected && props.highlighted ? themeGet("colors.white")(props) : props.selected ? themeGet("colors.white")(props) : themeGet("colors.primary")(props);
|
|
80
96
|
});
|
|
81
97
|
/**
|
|
82
98
|
* The top two rows are an example of how tags should be used when they are selectable/unselectable. There is the option to display the cross icon or not.
|
|
@@ -97,23 +113,30 @@ export default function Tag(_ref) {
|
|
|
97
113
|
showStrikeThrough = _ref.showStrikeThrough,
|
|
98
114
|
children = _ref.children,
|
|
99
115
|
isPending = _ref.isPending,
|
|
100
|
-
|
|
116
|
+
small = _ref.small,
|
|
117
|
+
highlighted = _ref.highlighted,
|
|
118
|
+
props = _objectWithoutProperties(_ref, ["selected", "onSelect", "disabled", "showRemove", "onRemove", "theme", "tagType", "showEdit", "onEdit", "showStrikeThrough", "children", "isPending", "small", "highlighted"]);
|
|
101
119
|
|
|
102
120
|
var component = /*#__PURE__*/React.createElement(TagWrapper, props, /*#__PURE__*/React.createElement(TagValue, {
|
|
103
121
|
selected: selected,
|
|
122
|
+
highlighted: highlighted,
|
|
104
123
|
disabled: disabled,
|
|
105
124
|
showEdit: showEdit,
|
|
106
125
|
showRemove: showRemove,
|
|
107
|
-
onClick: onSelect
|
|
126
|
+
onClick: onSelect,
|
|
127
|
+
small: small
|
|
108
128
|
}, /*#__PURE__*/React.createElement(TagValueText, {
|
|
109
129
|
showStrikeThrough: showStrikeThrough
|
|
110
130
|
}, children), tagType && /*#__PURE__*/React.createElement(TagType, {
|
|
111
131
|
selected: selected,
|
|
112
|
-
|
|
132
|
+
highlighted: highlighted,
|
|
133
|
+
disabled: disabled,
|
|
134
|
+
small: small
|
|
113
135
|
}, tagType), isPending && /*#__PURE__*/React.createElement(Loading, {
|
|
114
136
|
ml: "s"
|
|
115
137
|
})), showEdit && /*#__PURE__*/React.createElement(TagEdit, {
|
|
116
138
|
selected: selected,
|
|
139
|
+
highlighted: highlighted,
|
|
117
140
|
disabled: disabled,
|
|
118
141
|
showRemove: showRemove,
|
|
119
142
|
onClick: onEdit
|
|
@@ -122,6 +145,7 @@ export default function Tag(_ref) {
|
|
|
122
145
|
size: "xs"
|
|
123
146
|
})), showRemove && /*#__PURE__*/React.createElement(TagRemove, {
|
|
124
147
|
selected: selected,
|
|
148
|
+
highlighted: highlighted,
|
|
125
149
|
disabled: disabled,
|
|
126
150
|
onClick: onRemove
|
|
127
151
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
@@ -166,10 +190,18 @@ Tag.propTypes = {
|
|
|
166
190
|
theme: PropTypes.object,
|
|
167
191
|
|
|
168
192
|
/** Add a strikethrough to a tag value text */
|
|
169
|
-
showStrikeThrough: PropTypes.bool
|
|
193
|
+
showStrikeThrough: PropTypes.bool,
|
|
194
|
+
|
|
195
|
+
/** Applies the small variant styles */
|
|
196
|
+
small: PropTypes.bool,
|
|
197
|
+
|
|
198
|
+
/** Applies a highlighted style and colour to the tag */
|
|
199
|
+
highlighted: PropTypes.bool
|
|
170
200
|
};
|
|
171
201
|
Tag.defaultProps = {
|
|
172
202
|
selected: false,
|
|
203
|
+
small: false,
|
|
204
|
+
highlighted: false,
|
|
173
205
|
disabled: false,
|
|
174
206
|
showEdit: false,
|
|
175
207
|
showRemove: false,
|
|
@@ -191,6 +223,28 @@ Tag.__docgenInfo = {
|
|
|
191
223
|
"required": false,
|
|
192
224
|
"description": "Adds selected styling to tag"
|
|
193
225
|
},
|
|
226
|
+
"small": {
|
|
227
|
+
"defaultValue": {
|
|
228
|
+
"value": "false",
|
|
229
|
+
"computed": false
|
|
230
|
+
},
|
|
231
|
+
"type": {
|
|
232
|
+
"name": "bool"
|
|
233
|
+
},
|
|
234
|
+
"required": false,
|
|
235
|
+
"description": "Applies the small variant styles"
|
|
236
|
+
},
|
|
237
|
+
"highlighted": {
|
|
238
|
+
"defaultValue": {
|
|
239
|
+
"value": "false",
|
|
240
|
+
"computed": false
|
|
241
|
+
},
|
|
242
|
+
"type": {
|
|
243
|
+
"name": "bool"
|
|
244
|
+
},
|
|
245
|
+
"required": false,
|
|
246
|
+
"description": "Applies a highlighted style and colour to the tag"
|
|
247
|
+
},
|
|
194
248
|
"disabled": {
|
|
195
249
|
"defaultValue": {
|
|
196
250
|
"value": "false",
|
|
@@ -167,8 +167,8 @@ export var colors = {
|
|
|
167
167
|
warningLighter: lighten(0.25, warning),
|
|
168
168
|
warningLightest: lighten(0.3, warning),
|
|
169
169
|
warningDark: darken(0.05, warningSaturated),
|
|
170
|
-
warningDarker: darken(0.
|
|
171
|
-
warningDarkest: darken(0.
|
|
170
|
+
warningDarker: darken(0.15, warningSaturated),
|
|
171
|
+
warningDarkest: darken(0.25, warningSaturated),
|
|
172
172
|
warning10: rgba(warning, 0.1),
|
|
173
173
|
warning20: rgba(warning, 0.2),
|
|
174
174
|
warning30: rgba(warning, 0.3),
|
package/es/systemtheme.js
CHANGED
|
@@ -166,8 +166,8 @@ export var colors = {
|
|
|
166
166
|
warningLighter: lighten(0.25, warning),
|
|
167
167
|
warningLightest: lighten(0.3, warning),
|
|
168
168
|
warningDark: darken(0.05, warningSaturated),
|
|
169
|
-
warningDarker: darken(0.
|
|
170
|
-
warningDarkest: darken(0.
|
|
169
|
+
warningDarker: darken(0.15, warningSaturated),
|
|
170
|
+
warningDarkest: darken(0.25, warningSaturated),
|
|
171
171
|
warning10: rgba(warning, 0.1),
|
|
172
172
|
warning20: rgba(warning, 0.2),
|
|
173
173
|
warning30: rgba(warning, 0.3),
|