@automattic/date-range-picker 1.0.2 → 1.0.4
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 +8 -0
- package/README.md +1 -1
- package/dist/cjs/style.css +3 -9
- package/dist/esm/style.css +3 -9
- package/dist/types/utils.d.ts +10 -10
- package/dist/types/utils.d.ts.map +1 -1
- package/package.json +19 -18
- package/src/style.scss +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.0.4
|
|
4
|
+
|
|
5
|
+
- Declare React 19 compatibility for package consumers (#111721).
|
|
6
|
+
|
|
7
|
+
## 1.0.3
|
|
8
|
+
|
|
9
|
+
- Fix: restore `*.scss` in `sideEffects` so Calypso (which consumes the package via `calypso:src`) doesn't tree-shake the `import './style.scss'` and lose all of the picker's styles.
|
|
10
|
+
|
|
3
11
|
## 1.0.2
|
|
4
12
|
|
|
5
13
|
- Packaging: pre-compile SCSS to CSS in `dist/{esm,cjs}/style.css` so external consumers no longer need a Sass loader. SCSS variables from `@wordpress/base-styles` are resolved at build time.
|
package/README.md
CHANGED
|
@@ -75,7 +75,7 @@ WordPress plugins, etc. A few things to know:
|
|
|
75
75
|
The host application must install these alongside the picker:
|
|
76
76
|
|
|
77
77
|
- `react` and `react-dom` (`^18.3.1`)
|
|
78
|
-
- `@wordpress/components` (`>=
|
|
78
|
+
- `@wordpress/components` (`>=33.1.0`)
|
|
79
79
|
- `@wordpress/compose` (`>=7.23.0`)
|
|
80
80
|
- `@wordpress/date` (`>=5.23.0`)
|
|
81
81
|
- `@wordpress/i18n` (`>=5.23.0`)
|
package/dist/cjs/style.css
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Colors
|
|
3
|
+
*/
|
|
1
4
|
/**
|
|
2
5
|
* SCSS Variables.
|
|
3
6
|
*
|
|
@@ -5,15 +8,6 @@
|
|
|
5
8
|
* Don't add to this sheet unless you're pretty sure the value will be reused in many places.
|
|
6
9
|
* For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
|
|
7
10
|
*/
|
|
8
|
-
/**
|
|
9
|
-
* Converts a hex value into the rgb equivalent.
|
|
10
|
-
*
|
|
11
|
-
* @param {string} hex - the hexadecimal value to convert
|
|
12
|
-
* @return {string} comma separated rgb values
|
|
13
|
-
*/
|
|
14
|
-
/**
|
|
15
|
-
* Colors
|
|
16
|
-
*/
|
|
17
11
|
/**
|
|
18
12
|
* Fonts & basic variables.
|
|
19
13
|
*/
|
package/dist/esm/style.css
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Colors
|
|
3
|
+
*/
|
|
1
4
|
/**
|
|
2
5
|
* SCSS Variables.
|
|
3
6
|
*
|
|
@@ -5,15 +8,6 @@
|
|
|
5
8
|
* Don't add to this sheet unless you're pretty sure the value will be reused in many places.
|
|
6
9
|
* For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
|
|
7
10
|
*/
|
|
8
|
-
/**
|
|
9
|
-
* Converts a hex value into the rgb equivalent.
|
|
10
|
-
*
|
|
11
|
-
* @param {string} hex - the hexadecimal value to convert
|
|
12
|
-
* @return {string} comma separated rgb values
|
|
13
|
-
*/
|
|
14
|
-
/**
|
|
15
|
-
* Colors
|
|
16
|
-
*/
|
|
17
11
|
/**
|
|
18
12
|
* Fonts & basic variables.
|
|
19
13
|
*/
|
package/dist/types/utils.d.ts
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
export type PresetId = 'today' | 'yesterday' | 'last-7-days' | 'last-30-days' | 'last-90-days' | 'month-to-date' | 'last-12-months' | 'year-to-date' | 'last-3-years' | 'custom';
|
|
2
2
|
export declare const presetDefs: readonly [{
|
|
3
3
|
readonly id: "today";
|
|
4
|
-
readonly label:
|
|
4
|
+
readonly label: import("@wordpress/i18n").TransformedText<"Today">;
|
|
5
5
|
}, {
|
|
6
6
|
readonly id: "yesterday";
|
|
7
|
-
readonly label:
|
|
7
|
+
readonly label: import("@wordpress/i18n").TransformedText<"Yesterday">;
|
|
8
8
|
}, {
|
|
9
9
|
readonly id: "last-7-days";
|
|
10
|
-
readonly label:
|
|
10
|
+
readonly label: import("@wordpress/i18n").TransformedText<"Last 7 days">;
|
|
11
11
|
}, {
|
|
12
12
|
readonly id: "last-30-days";
|
|
13
|
-
readonly label:
|
|
13
|
+
readonly label: import("@wordpress/i18n").TransformedText<"Last 30 days">;
|
|
14
14
|
}, {
|
|
15
15
|
readonly id: "last-90-days";
|
|
16
|
-
readonly label:
|
|
16
|
+
readonly label: import("@wordpress/i18n").TransformedText<"Last 90 days">;
|
|
17
17
|
}, {
|
|
18
18
|
readonly id: "month-to-date";
|
|
19
|
-
readonly label:
|
|
19
|
+
readonly label: import("@wordpress/i18n").TransformedText<"Month to date">;
|
|
20
20
|
}, {
|
|
21
21
|
readonly id: "last-12-months";
|
|
22
|
-
readonly label:
|
|
22
|
+
readonly label: import("@wordpress/i18n").TransformedText<"Last 12 months">;
|
|
23
23
|
}, {
|
|
24
24
|
readonly id: "year-to-date";
|
|
25
|
-
readonly label:
|
|
25
|
+
readonly label: import("@wordpress/i18n").TransformedText<"Year to date">;
|
|
26
26
|
}, {
|
|
27
27
|
readonly id: "last-3-years";
|
|
28
|
-
readonly label:
|
|
28
|
+
readonly label: import("@wordpress/i18n").TransformedText<"Last 3 years">;
|
|
29
29
|
}];
|
|
30
30
|
export declare function computePresetRange(preset: PresetId, baseDate: Date): {
|
|
31
31
|
from: Date;
|
|
32
32
|
to: Date;
|
|
33
33
|
} | undefined;
|
|
34
34
|
export declare function getActivePresetId(from?: Date, to?: Date, baseDate?: Date): PresetId | undefined;
|
|
35
|
-
export declare function formatLabel(start: Date, end: Date, locale: string):
|
|
35
|
+
export declare function formatLabel(start: Date, end: Date, locale: string): import("@wordpress/i18n").TransformedText<"%1$s to %2$s">;
|
|
36
36
|
export declare function isLast7Days(range: {
|
|
37
37
|
start: Date;
|
|
38
38
|
end: Date;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAkCA,MAAM,MAAM,QAAQ,GACjB,OAAO,GACP,WAAW,GACX,aAAa,GACb,cAAc,GACd,cAAc,GACd,eAAe,GACf,gBAAgB,GAChB,cAAc,GACd,cAAc,GACd,QAAQ,CAAC;AAEZ,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUmE,CAAC;AAE3F,wBAAgB,kBAAkB,CAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI;;;cA0BnE;AAED,wBAAgB,iBAAiB,CAAE,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,EAAE,IAAI,GAAI,QAAQ,GAAG,SAAS,CAiEjG;AAGD,wBAAgB,WAAW,CAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAkCA,MAAM,MAAM,QAAQ,GACjB,OAAO,GACP,WAAW,GACX,aAAa,GACb,cAAc,GACd,cAAc,GACd,eAAe,GACf,gBAAgB,GAChB,cAAc,GACd,cAAc,GACd,QAAQ,CAAC;AAEZ,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUmE,CAAC;AAE3F,wBAAgB,kBAAkB,CAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI;;;cA0BnE;AAED,wBAAgB,iBAAiB,CAAE,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,EAAE,IAAI,GAAI,QAAQ,GAAG,SAAS,CAiEjG;AAGD,wBAAgB,WAAW,CAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,6DAOlE;AAGD,wBAAgB,WAAW,CAC1B,KAAK,EAAE;IAAE,KAAK,EAAE,IAAI,CAAC;IAAC,GAAG,EAAE,IAAI,CAAA;CAAE,EACjC,cAAc,CAAC,EAAE,MAAM,EACvB,SAAS,CAAC,EAAE,MAAM,GAChB,OAAO,CAKT"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@automattic/date-range-picker",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "A date-range picker built on top of @automattic/ui's DateRangeCalendar, with timezone-aware site-day handling, preset shortcuts, and accessible inputs.",
|
|
5
5
|
"homepage": "https://github.com/Automattic/wp-calypso",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
22
|
"sideEffects": [
|
|
23
|
-
"*.css"
|
|
23
|
+
"*.css",
|
|
24
|
+
"*.scss"
|
|
24
25
|
],
|
|
25
26
|
"repository": {
|
|
26
27
|
"type": "git",
|
|
@@ -44,17 +45,17 @@
|
|
|
44
45
|
"prepack": "yarn run clean && yarn run build"
|
|
45
46
|
},
|
|
46
47
|
"dependencies": {
|
|
47
|
-
"@automattic/ui": "^1.0.
|
|
48
|
+
"@automattic/ui": "^1.0.3",
|
|
48
49
|
"date-fns": "^4.1.0"
|
|
49
50
|
},
|
|
50
51
|
"peerDependencies": {
|
|
51
|
-
"@wordpress/components": ">=
|
|
52
|
-
"@wordpress/compose": ">=
|
|
53
|
-
"@wordpress/date": ">=5.
|
|
54
|
-
"@wordpress/i18n": ">=
|
|
55
|
-
"@wordpress/icons": ">=
|
|
56
|
-
"react": "^18.3.1",
|
|
57
|
-
"react-dom": "^18.3.1"
|
|
52
|
+
"@wordpress/components": ">=35.0.0",
|
|
53
|
+
"@wordpress/compose": ">=8.1.0",
|
|
54
|
+
"@wordpress/date": ">=5.48.0",
|
|
55
|
+
"@wordpress/i18n": ">=6.21.0",
|
|
56
|
+
"@wordpress/icons": ">=13.3.0",
|
|
57
|
+
"react": "^18.3.1 || ^19.0.0",
|
|
58
|
+
"react-dom": "^18.3.1 || ^19.0.0"
|
|
58
59
|
},
|
|
59
60
|
"peerDependenciesMeta": {
|
|
60
61
|
"@wordpress/components": {
|
|
@@ -83,20 +84,20 @@
|
|
|
83
84
|
"@automattic/calypso-typescript-config": "^1.0.0",
|
|
84
85
|
"@testing-library/dom": "^10.4.1",
|
|
85
86
|
"@testing-library/jest-dom": "^6.9.1",
|
|
86
|
-
"@testing-library/react": "^16.3.
|
|
87
|
+
"@testing-library/react": "^16.3.2",
|
|
87
88
|
"@testing-library/user-event": "^14.6.1",
|
|
88
89
|
"@types/react": "^18.3.18",
|
|
89
|
-
"@wordpress/base-styles": "^
|
|
90
|
-
"@wordpress/components": "^
|
|
91
|
-
"@wordpress/compose": "
|
|
92
|
-
"@wordpress/date": "5.
|
|
93
|
-
"@wordpress/i18n": "^
|
|
94
|
-
"@wordpress/icons": "^
|
|
90
|
+
"@wordpress/base-styles": "^9.1.0",
|
|
91
|
+
"@wordpress/components": "^35.0.0",
|
|
92
|
+
"@wordpress/compose": "patch:@wordpress/compose@npm%3A8.1.0#~/.yarn/patches/@wordpress-compose-npm-8.1.0-ea108e3129.patch",
|
|
93
|
+
"@wordpress/date": "5.48.0",
|
|
94
|
+
"@wordpress/i18n": "^6.21.0",
|
|
95
|
+
"@wordpress/icons": "^13.3.0",
|
|
95
96
|
"jest": "^29.7.0",
|
|
96
97
|
"mockdate": "^2.0.5",
|
|
97
98
|
"postcss": "^8.5.3",
|
|
98
99
|
"sass": "1.77.8",
|
|
99
|
-
"typescript": "^
|
|
100
|
+
"typescript": "^6.0.3",
|
|
100
101
|
"webpack": "^5.99.8"
|
|
101
102
|
}
|
|
102
103
|
}
|
package/src/style.scss
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
@use "@wordpress/base-styles/colors" as colors;
|
|
1
2
|
@use "@wordpress/base-styles/variables" as v;
|
|
2
3
|
|
|
3
4
|
/* Popover sizing */
|
|
@@ -20,15 +21,15 @@
|
|
|
20
21
|
padding: v.$grid-unit-05 v.$grid-unit-05 v.$grid-unit-05 v.$grid-unit-10;
|
|
21
22
|
box-shadow: none;
|
|
22
23
|
border-radius: v.$radius-small;
|
|
23
|
-
border: 1px solid var(--dashboard-field__border-color, #{
|
|
24
|
+
border: 1px solid var(--dashboard-field__border-color, #{colors.$gray-600});
|
|
24
25
|
}
|
|
25
26
|
svg {
|
|
26
|
-
color: var(--dashboard__text-color, #{
|
|
27
|
+
color: var(--dashboard__text-color, #{colors.$gray-900});
|
|
27
28
|
padding: v.$grid-unit-05;
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
31
|
&__text {
|
|
31
|
-
color: var(--dashboard__text-color, #{
|
|
32
|
+
color: var(--dashboard__text-color, #{colors.$gray-900});
|
|
32
33
|
padding: 0 v.$grid-unit-05;
|
|
33
34
|
}
|
|
34
35
|
}
|