@jobber/components 2.72.0 → 2.72.3
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/CHANGELOG.md +27 -0
- package/dist/Card/index.js +1 -1
- package/dist/Chips/index.js +23 -7
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,33 @@ menu: Changelog
|
|
|
8
8
|
All notable changes to this project will be documented in this file.
|
|
9
9
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
10
10
|
|
|
11
|
+
## [2.72.3](https://github.com/GetJobber/atlantis/compare/@jobber/components@2.72.2...@jobber/components@2.72.3) (2022-01-21)
|
|
12
|
+
|
|
13
|
+
**Note:** Version bump only for package @jobber/components
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
## [2.72.2](https://github.com/GetJobber/atlantis/compare/@jobber/components@2.72.1...@jobber/components@2.72.2) (2022-01-21)
|
|
20
|
+
|
|
21
|
+
**Note:** Version bump only for package @jobber/components
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
## [2.72.1](https://github.com/GetJobber/atlantis/compare/@jobber/components@2.72.0...@jobber/components@2.72.1) (2022-01-12)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### Bug Fixes
|
|
31
|
+
|
|
32
|
+
* Allow space bar key deselect on single select chip ([#827](https://github.com/GetJobber/atlantis/issues/827)) ([a6bc802](https://github.com/GetJobber/atlantis/commit/a6bc802b128a731be5a308f955ee2099029375dd))
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
11
38
|
# [2.72.0](https://github.com/GetJobber/atlantis/compare/@jobber/components@2.71.7...@jobber/components@2.72.0) (2022-01-11)
|
|
12
39
|
|
|
13
40
|
|
package/dist/Card/index.js
CHANGED
|
@@ -52,7 +52,7 @@ function Card(_a) {
|
|
|
52
52
|
var className = classnames(styles.card, accent && styles.accent, (url || onClick) && styles.clickable, accent && colors[accent]);
|
|
53
53
|
var cardContent = (React__default.createElement(React__default.Fragment, null,
|
|
54
54
|
title && (React__default.createElement("div", { className: styles.header },
|
|
55
|
-
React__default.createElement(index.Typography, { element: "h3", size: "large", textCase: "uppercase", fontWeight: "extraBold" }, title))),
|
|
55
|
+
React__default.createElement(index.Typography, { element: "h3", size: "large", textCase: "uppercase", fontWeight: "extraBold", textColor: "heading" }, title))),
|
|
56
56
|
children));
|
|
57
57
|
if (onClick) {
|
|
58
58
|
return (React__default.createElement(CardClickable, { className: className, onClick: onClick }, cardContent));
|
package/dist/Chips/index.js
CHANGED
|
@@ -130,18 +130,34 @@ function ChipDismissible(_a) {
|
|
|
130
130
|
|
|
131
131
|
function InternalChipSingleSelect(_a) {
|
|
132
132
|
var children = _a.children, selected = _a.selected, _b = _a.name, name = _b === void 0 ? uuid.v1() : _b, onChange = _a.onChange, onClick = _a.onClick;
|
|
133
|
-
return (React__default.createElement("div", { className: styles.wrapper, "data-testid": "singleselect-chips" }, React__default.Children.map(children, function (child) {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
133
|
+
return (React__default.createElement("div", { className: styles.wrapper, "data-testid": "singleselect-chips" }, React__default.Children.map(children, function (child) {
|
|
134
|
+
var isSelected = child.props.value === selected;
|
|
135
|
+
return (React__default.createElement("label", null,
|
|
136
|
+
React__default.createElement("input", { type: "radio", checked: isSelected, className: styles.input, name: name, onClick: handleClick(child.props.value), onKeyUp: handleKeyUp(isSelected, child.props.value), onChange: function () {
|
|
137
|
+
/* No op. onClick handles the change to allow deselecting. */
|
|
138
|
+
}, disabled: child.props.disabled }),
|
|
139
|
+
React__default.createElement(InternalChip, __chunk_1.__assign({}, child.props, { active: isSelected }))));
|
|
140
|
+
})));
|
|
141
|
+
function handleKeyUp(active, value) {
|
|
142
|
+
if (!active)
|
|
143
|
+
return;
|
|
144
|
+
return function (event) {
|
|
145
|
+
if (event.key === " ") {
|
|
146
|
+
// Wait for DOM changes before applying the new change.
|
|
147
|
+
setTimeout(function () { return handleChange(value); }, 0);
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
}
|
|
138
151
|
function handleClick(value) {
|
|
139
152
|
return function (event) {
|
|
140
153
|
onClick === null || onClick === void 0 ? void 0 : onClick(event, value);
|
|
141
|
-
|
|
142
|
-
onChange(newValue);
|
|
154
|
+
handleChange(value);
|
|
143
155
|
};
|
|
144
156
|
}
|
|
157
|
+
function handleChange(value) {
|
|
158
|
+
var newValue = value !== selected ? value : undefined;
|
|
159
|
+
onChange(newValue);
|
|
160
|
+
}
|
|
145
161
|
}
|
|
146
162
|
|
|
147
163
|
function InternalChipMultiSelect(_a) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components",
|
|
3
|
-
"version": "2.72.
|
|
3
|
+
"version": "2.72.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@jobber/design": "^0.21.0",
|
|
21
21
|
"@jobber/formatters": "^0.2.0",
|
|
22
|
-
"@jobber/hooks": "^1.
|
|
22
|
+
"@jobber/hooks": "^1.10.0",
|
|
23
23
|
"@popperjs/core": "^2.0.6",
|
|
24
24
|
"@std-proposal/temporal": "0.0.1",
|
|
25
25
|
"@types/color": "^3.0.1",
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
"> 1%",
|
|
85
85
|
"IE 10"
|
|
86
86
|
],
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "46471932c9cbf4529a13a249971f3e50cb6ca9c6"
|
|
88
88
|
}
|