@cloudflare/component-toggle 4.1.0 → 4.2.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 +28 -1
- package/dist/Toggle.d.ts +1 -0
- package/es/Toggle.js +4 -2
- package/lib/Toggle.js +4 -2
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,34 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
## [4.2.3](http://stash.cfops.it:7999/fe/stratus/compare/@cloudflare/component-toggle@4.2.2...@cloudflare/component-toggle@4.2.3) (2021-09-20)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @cloudflare/component-toggle
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [4.2.2](http://stash.cfops.it:7999/fe/stratus/compare/@cloudflare/component-toggle@4.2.1...@cloudflare/component-toggle@4.2.2) (2021-09-17)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* **component-toggle:** UI-4634 Update background color ([dabbd14](http://stash.cfops.it:7999/fe/stratus/commits/dabbd14))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## [4.2.1](http://stash.cfops.it:7999/fe/stratus/compare/@cloudflare/component-toggle@4.2.0...@cloudflare/component-toggle@4.2.1) (2021-09-15)
|
|
26
|
+
|
|
27
|
+
**Note:** Version bump only for package @cloudflare/component-toggle
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
# [4.2.0](http://stash.cfops.it:7999/fe/stratus/compare/@cloudflare/component-toggle@4.0.5...@cloudflare/component-toggle@4.2.0) (2021-09-15)
|
|
7
34
|
|
|
8
35
|
|
|
9
36
|
### Bug Fixes
|
package/dist/Toggle.d.ts
CHANGED
|
@@ -322,6 +322,7 @@ declare type ToggleProps = Omit<ComponentProps<typeof Container>, 'value' | 'typ
|
|
|
322
322
|
value?: boolean;
|
|
323
323
|
onChange: ((value: boolean) => void | Promise<void>) | false;
|
|
324
324
|
labelledBy?: string;
|
|
325
|
+
name?: string;
|
|
325
326
|
invalid?: boolean;
|
|
326
327
|
height?: number;
|
|
327
328
|
color?: string;
|
package/es/Toggle.js
CHANGED
|
@@ -95,7 +95,7 @@ const ToggleIcon = createComponent(({
|
|
|
95
95
|
boxSizing: 'border-box',
|
|
96
96
|
width: `${controlSize}px`,
|
|
97
97
|
height: `${controlSize}px`,
|
|
98
|
-
backgroundColor: theme.colors.
|
|
98
|
+
backgroundColor: theme.colors.background,
|
|
99
99
|
borderRadius: `${controlSize * 2}px`,
|
|
100
100
|
boxShadow: `0 0 2px 1px ${theme.colors.gray[2]}`,
|
|
101
101
|
transition
|
|
@@ -114,9 +114,10 @@ const Toggle = (_ref) => {
|
|
|
114
114
|
color = _ref.color,
|
|
115
115
|
borderColor = _ref.borderColor,
|
|
116
116
|
invalid = _ref.invalid,
|
|
117
|
+
name = _ref.name,
|
|
117
118
|
_ref$height = _ref.height,
|
|
118
119
|
height = _ref$height === void 0 ? 24 : _ref$height,
|
|
119
|
-
rest = _objectWithoutProperties(_ref, ["id", "value", "labelledBy", "disabled", "onChange", "testId", "color", "borderColor", "invalid", "height"]);
|
|
120
|
+
rest = _objectWithoutProperties(_ref, ["id", "value", "labelledBy", "disabled", "onChange", "testId", "color", "borderColor", "invalid", "name", "height"]);
|
|
120
121
|
|
|
121
122
|
const controlSize = height - 4;
|
|
122
123
|
return /*#__PURE__*/React.createElement(Container, _extends({}, rest, {
|
|
@@ -130,6 +131,7 @@ const Toggle = (_ref) => {
|
|
|
130
131
|
id: id,
|
|
131
132
|
type: "checkbox",
|
|
132
133
|
checked: value,
|
|
134
|
+
name: name,
|
|
133
135
|
onChange: disabled || !onChange ? undefined : e => onChange(e.target.checked),
|
|
134
136
|
"aria-labelledby": labelledBy,
|
|
135
137
|
disabled: disabled,
|
package/lib/Toggle.js
CHANGED
|
@@ -111,7 +111,7 @@ var ToggleIcon = (0, _styleContainer.createComponent)(function (_ref2) {
|
|
|
111
111
|
boxSizing: 'border-box',
|
|
112
112
|
width: "".concat(controlSize, "px"),
|
|
113
113
|
height: "".concat(controlSize, "px"),
|
|
114
|
-
backgroundColor: theme.colors.
|
|
114
|
+
backgroundColor: theme.colors.background,
|
|
115
115
|
borderRadius: "".concat(controlSize * 2, "px"),
|
|
116
116
|
boxShadow: "0 0 2px 1px ".concat(theme.colors.gray[2]),
|
|
117
117
|
transition: transition
|
|
@@ -132,9 +132,10 @@ var Toggle = function Toggle(_ref3) {
|
|
|
132
132
|
color = _ref3.color,
|
|
133
133
|
borderColor = _ref3.borderColor,
|
|
134
134
|
invalid = _ref3.invalid,
|
|
135
|
+
name = _ref3.name,
|
|
135
136
|
_ref3$height = _ref3.height,
|
|
136
137
|
height = _ref3$height === void 0 ? 24 : _ref3$height,
|
|
137
|
-
rest = _objectWithoutProperties(_ref3, ["id", "value", "labelledBy", "disabled", "onChange", "testId", "color", "borderColor", "invalid", "height"]);
|
|
138
|
+
rest = _objectWithoutProperties(_ref3, ["id", "value", "labelledBy", "disabled", "onChange", "testId", "color", "borderColor", "invalid", "name", "height"]);
|
|
138
139
|
|
|
139
140
|
var controlSize = height - 4;
|
|
140
141
|
return /*#__PURE__*/_react.default.createElement(Container, _extends({}, rest, {
|
|
@@ -148,6 +149,7 @@ var Toggle = function Toggle(_ref3) {
|
|
|
148
149
|
id: id,
|
|
149
150
|
type: "checkbox",
|
|
150
151
|
checked: value,
|
|
152
|
+
name: name,
|
|
151
153
|
onChange: disabled || !onChange ? undefined : function (e) {
|
|
152
154
|
return onChange(e.target.checked);
|
|
153
155
|
},
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudflare/component-toggle",
|
|
3
3
|
"description": "Cloudflare Toggle Component",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.2.3",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
7
7
|
"author": "James Kyle <jkyle@cloudflare.com>",
|
|
@@ -11,12 +11,12 @@
|
|
|
11
11
|
"access": "public"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@cloudflare/component-icon": "^6.
|
|
15
|
-
"@cloudflare/elements": "^1.
|
|
16
|
-
"@cloudflare/intl-react": "^1.8.
|
|
14
|
+
"@cloudflare/component-icon": "^6.4.0",
|
|
15
|
+
"@cloudflare/elements": "^1.11.1",
|
|
16
|
+
"@cloudflare/intl-react": "^1.8.114",
|
|
17
17
|
"@cloudflare/style-const": "^2.4.34",
|
|
18
|
-
"@cloudflare/style-container": "^7.
|
|
19
|
-
"@cloudflare/types": "^6.8.
|
|
18
|
+
"@cloudflare/style-container": "^7.4.0",
|
|
19
|
+
"@cloudflare/types": "^6.8.21",
|
|
20
20
|
"prop-types": "^15.6.0"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
@@ -33,5 +33,5 @@
|
|
|
33
33
|
"test-coverage": "stratus test --coverage",
|
|
34
34
|
"test-watch": "stratus test --watch"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "cf3ff5236b019dfa3a85d0e5d8a5ba3adf846eb5"
|
|
37
37
|
}
|