@khanacademy/wonder-blocks-birthday-picker 3.2.0 → 3.2.2
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 +36 -0
- package/dist/es/index.js +1 -1
- package/dist/index.js +15 -9
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
# @khanacademy/wonder-blocks-birthday-picker
|
|
2
2
|
|
|
3
|
+
## 3.2.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 7d3f67e: Revert BirthdayPicker to use again the first day of the month when `monthYearOnly` is set
|
|
8
|
+
- Updated dependencies [ed26d66]
|
|
9
|
+
- Updated dependencies [5655b9f]
|
|
10
|
+
- Updated dependencies [5655b9f]
|
|
11
|
+
- Updated dependencies [8f53293]
|
|
12
|
+
- Updated dependencies [a42d9f3]
|
|
13
|
+
- Updated dependencies [7bb37a2]
|
|
14
|
+
- Updated dependencies [051f0f8]
|
|
15
|
+
- Updated dependencies [4ab523b]
|
|
16
|
+
- Updated dependencies [e1b78db]
|
|
17
|
+
- Updated dependencies [8f53293]
|
|
18
|
+
- Updated dependencies [051f0f8]
|
|
19
|
+
- @khanacademy/wonder-blocks-core@12.2.0
|
|
20
|
+
- @khanacademy/wonder-blocks-tokens@5.0.0
|
|
21
|
+
- @khanacademy/wonder-blocks-dropdown@9.1.2
|
|
22
|
+
- @khanacademy/wonder-blocks-icon@5.1.2
|
|
23
|
+
- @khanacademy/wonder-blocks-layout@3.1.2
|
|
24
|
+
- @khanacademy/wonder-blocks-typography@3.1.2
|
|
25
|
+
|
|
26
|
+
## 3.2.1
|
|
27
|
+
|
|
28
|
+
### Patch Changes
|
|
29
|
+
|
|
30
|
+
- ee8d95a: Rollback rollup version from v4 to v2 to prevent an issue with CJS builds in unit tests
|
|
31
|
+
- Updated dependencies [ee8d95a]
|
|
32
|
+
- @khanacademy/wonder-blocks-core@12.1.1
|
|
33
|
+
- @khanacademy/wonder-blocks-dropdown@9.1.1
|
|
34
|
+
- @khanacademy/wonder-blocks-icon@5.1.1
|
|
35
|
+
- @khanacademy/wonder-blocks-layout@3.1.1
|
|
36
|
+
- @khanacademy/wonder-blocks-tokens@4.2.1
|
|
37
|
+
- @khanacademy/wonder-blocks-typography@3.1.1
|
|
38
|
+
|
|
3
39
|
## 3.2.0
|
|
4
40
|
|
|
5
41
|
### Minor Changes
|
package/dist/es/index.js
CHANGED
|
@@ -40,7 +40,7 @@ const defaultStyles = StyleSheet.create({
|
|
|
40
40
|
class BirthdayPicker extends React.Component {
|
|
41
41
|
constructor(props) {
|
|
42
42
|
super(props);
|
|
43
|
-
this.labels =
|
|
43
|
+
this.labels = void 0;
|
|
44
44
|
this.lastChangeValue = null;
|
|
45
45
|
this.reportChange = value => {
|
|
46
46
|
if (value !== this.lastChangeValue) {
|
package/dist/index.js
CHANGED
|
@@ -12,7 +12,10 @@ var wonderBlocksIcon = require('@khanacademy/wonder-blocks-icon');
|
|
|
12
12
|
var wonderBlocksDropdown = require('@khanacademy/wonder-blocks-dropdown');
|
|
13
13
|
var infoIcon = require('@phosphor-icons/core/bold/info-bold.svg');
|
|
14
14
|
|
|
15
|
-
function
|
|
15
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
16
|
+
|
|
17
|
+
function _interopNamespace(e) {
|
|
18
|
+
if (e && e.__esModule) return e;
|
|
16
19
|
var n = Object.create(null);
|
|
17
20
|
if (e) {
|
|
18
21
|
Object.keys(e).forEach(function (k) {
|
|
@@ -25,11 +28,14 @@ function _interopNamespaceDefault(e) {
|
|
|
25
28
|
}
|
|
26
29
|
});
|
|
27
30
|
}
|
|
28
|
-
n
|
|
31
|
+
n["default"] = e;
|
|
29
32
|
return Object.freeze(n);
|
|
30
33
|
}
|
|
31
34
|
|
|
32
|
-
var
|
|
35
|
+
var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
36
|
+
var moment__default = /*#__PURE__*/_interopDefaultLegacy(moment);
|
|
37
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
38
|
+
var infoIcon__default = /*#__PURE__*/_interopDefaultLegacy(infoIcon);
|
|
33
39
|
|
|
34
40
|
const CUR_YEAR = new Date().getYear() + 1900;
|
|
35
41
|
const defaultLabels = Object.freeze({
|
|
@@ -61,7 +67,7 @@ const defaultStyles = aphrodite.StyleSheet.create({
|
|
|
61
67
|
class BirthdayPicker extends React__namespace.Component {
|
|
62
68
|
constructor(props) {
|
|
63
69
|
super(props);
|
|
64
|
-
this.labels =
|
|
70
|
+
this.labels = void 0;
|
|
65
71
|
this.lastChangeValue = null;
|
|
66
72
|
this.reportChange = value => {
|
|
67
73
|
if (value !== this.lastChangeValue) {
|
|
@@ -79,7 +85,7 @@ class BirthdayPicker extends React__namespace.Component {
|
|
|
79
85
|
this.reportChange(null);
|
|
80
86
|
return;
|
|
81
87
|
}
|
|
82
|
-
const date =
|
|
88
|
+
const date = moment__default["default"]([year, month, day]);
|
|
83
89
|
if (date.isAfter() || !date.isValid()) {
|
|
84
90
|
this.setState({
|
|
85
91
|
error: this.labels.errorMessage
|
|
@@ -121,9 +127,9 @@ class BirthdayPicker extends React__namespace.Component {
|
|
|
121
127
|
year: null,
|
|
122
128
|
error: null
|
|
123
129
|
};
|
|
124
|
-
this.labels =
|
|
130
|
+
this.labels = _extends__default["default"]({}, defaultLabels, this.props.labels);
|
|
125
131
|
if (defaultValue) {
|
|
126
|
-
const date =
|
|
132
|
+
const date = moment__default["default"](defaultValue);
|
|
127
133
|
if (date.isValid()) {
|
|
128
134
|
initialState.month = String(date.month());
|
|
129
135
|
initialState.day = String(date.date());
|
|
@@ -152,7 +158,7 @@ class BirthdayPicker extends React__namespace.Component {
|
|
|
152
158
|
role: "alert"
|
|
153
159
|
}, React__namespace.createElement(wonderBlocksIcon.PhosphorIcon, {
|
|
154
160
|
size: "small",
|
|
155
|
-
icon:
|
|
161
|
+
icon: infoIcon__default["default"],
|
|
156
162
|
color: wonderBlocksTokens.semanticColor.icon.destructive,
|
|
157
163
|
"aria-hidden": "true"
|
|
158
164
|
}), React__namespace.createElement(wonderBlocksLayout.Strut, {
|
|
@@ -185,7 +191,7 @@ class BirthdayPicker extends React__namespace.Component {
|
|
|
185
191
|
minWidth
|
|
186
192
|
}, defaultStyles.input, dropdownStyle],
|
|
187
193
|
testId: "birthday-picker-month"
|
|
188
|
-
},
|
|
194
|
+
}, moment__default["default"].monthsShort().map((month, i) => React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
189
195
|
key: month,
|
|
190
196
|
label: month,
|
|
191
197
|
value: String(i)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@khanacademy/wonder-blocks-birthday-picker",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.2",
|
|
4
4
|
"design": "v1",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -11,12 +11,12 @@
|
|
|
11
11
|
"types": "dist/index.d.ts",
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@babel/runtime": "^7.24.5",
|
|
14
|
-
"@khanacademy/wonder-blocks-core": "12.
|
|
15
|
-
"@khanacademy/wonder-blocks-dropdown": "9.1.
|
|
16
|
-
"@khanacademy/wonder-blocks-icon": "5.1.
|
|
17
|
-
"@khanacademy/wonder-blocks-layout": "3.1.
|
|
18
|
-
"@khanacademy/wonder-blocks-tokens": "
|
|
19
|
-
"@khanacademy/wonder-blocks-typography": "3.1.
|
|
14
|
+
"@khanacademy/wonder-blocks-core": "12.2.0",
|
|
15
|
+
"@khanacademy/wonder-blocks-dropdown": "9.1.2",
|
|
16
|
+
"@khanacademy/wonder-blocks-icon": "5.1.2",
|
|
17
|
+
"@khanacademy/wonder-blocks-layout": "3.1.2",
|
|
18
|
+
"@khanacademy/wonder-blocks-tokens": "5.0.0",
|
|
19
|
+
"@khanacademy/wonder-blocks-typography": "3.1.2"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
22
22
|
"@phosphor-icons/core": "^2.0.2",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"react": "18.2.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@khanacademy/wb-dev-build-settings": "2.1.
|
|
28
|
+
"@khanacademy/wb-dev-build-settings": "2.1.1"
|
|
29
29
|
},
|
|
30
30
|
"author": "",
|
|
31
31
|
"license": "MIT",
|