react-timezone-range-picker 0.1.4 → 0.1.6
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/README.md +28 -11
- package/dist/AroundTimePanel/util.d.ts.map +1 -1
- package/dist/Footer/index.d.ts +1 -1
- package/dist/Footer/index.d.ts.map +1 -1
- package/dist/Provider/PopoverProvider.d.ts +1 -1
- package/dist/Provider/PopoverProvider.d.ts.map +1 -1
- package/dist/RelativeTimePanel/index.d.ts +1 -1
- package/dist/RelativeTimePanel/index.d.ts.map +1 -1
- package/dist/RelativeTimePanel/timeOptions.d.ts +4 -1
- package/dist/RelativeTimePanel/timeOptions.d.ts.map +1 -1
- package/dist/Sidebar/index.d.ts +1 -1
- package/dist/Sidebar/index.d.ts.map +1 -1
- package/dist/StartEndTimePanel/index.d.ts.map +1 -1
- package/dist/TimezonePanel/index.d.ts.map +1 -1
- package/dist/TimezonePanel/util/getBrowserTimezone.d.ts.map +1 -1
- package/dist/TimezonePanel/util/getTimezones.d.ts.map +1 -1
- package/dist/TimezoneRangePicker/AdvancedPickerView.d.ts +8 -0
- package/dist/TimezoneRangePicker/AdvancedPickerView.d.ts.map +1 -0
- package/dist/TimezoneRangePicker/BasicPickerView.d.ts +9 -0
- package/dist/TimezoneRangePicker/BasicPickerView.d.ts.map +1 -0
- package/dist/TimezoneRangePicker/index.d.ts +2 -7
- package/dist/TimezoneRangePicker/index.d.ts.map +1 -1
- package/dist/TimezoneRangePicker/panels.d.ts +7 -0
- package/dist/TimezoneRangePicker/panels.d.ts.map +1 -0
- package/dist/index.cjs.js +12 -12
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +5806 -2066
- package/dist/index.es.js.map +1 -1
- package/dist/interfaces/index.d.ts +7 -0
- package/dist/interfaces/index.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/util/dateTime.d.ts +9 -3
- package/dist/util/dateTime.d.ts.map +1 -1
- package/package.json +19 -15
|
@@ -11,6 +11,12 @@ export interface OnApplyParams {
|
|
|
11
11
|
endTime: string | null;
|
|
12
12
|
timezone: TimezoneData;
|
|
13
13
|
}
|
|
14
|
+
export interface TimezoneRangePickerOptions {
|
|
15
|
+
disableSeconds?: boolean;
|
|
16
|
+
disableMinutes?: boolean;
|
|
17
|
+
disableHours?: boolean;
|
|
18
|
+
disableDays?: boolean;
|
|
19
|
+
}
|
|
14
20
|
export interface TzRange {
|
|
15
21
|
startDate: string | null;
|
|
16
22
|
startTime: string | null;
|
|
@@ -19,5 +25,6 @@ export interface TzRange {
|
|
|
19
25
|
timezone: TimezoneData;
|
|
20
26
|
onApply: ({ startDate, startTime, endDate, endTime, timezone }: OnApplyParams) => void;
|
|
21
27
|
buttonStyle?: MantineStyleProp;
|
|
28
|
+
options?: TimezoneRangePickerOptions;
|
|
22
29
|
}
|
|
23
30
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjD,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,QAAQ,EAAE,YAAY,CAAC;CACxB;AAED,MAAM,WAAW,OAAO;IACtB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzB,OAAO,EAAE,MAAM,GA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AAO,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,aAAa,KAAK,IAAI,CAAC;IAEvF,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B,OAAO,CAAC,EAAE,0BAA0B,CAAC;CACtC"}
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
._row_550mo_1{padding:.4rem}._row-dark_550mo_5{cursor:pointer}._row-dark_550mo_5:hover{background-color:#3a3a3a}._row-light_550mo_12{cursor:pointer}._row-light_550mo_12:hover{background-color:#f3f4f6}._row-selected-dark_550mo_19{background-color:#5a5a5a;font-weight:600}._row-selected-dark_550mo_19:hover{background-color:#5a5a5a}._row-selected-light_550mo_27{background-color:#f3f4f6;font-weight:600}._row-selected-light_550mo_27:hover{background-color:#f3f4f6}._timezone-panel-container_tykz4_1{height:100%;min-height:0}._search-container_tykz4_6{position:sticky;top:0;z-index:1;width:95%;margin:0 auto;padding-bottom:8px}._timezone-scroll-area_tykz4_15{flex:1;min-height:0;overflow-y:auto}._list-container_tykz4_21{margin-top:.5rem}._form-container_1xxf4_1{display:flex;flex:2;flex-direction:column;justify-content:space-between;height:100%}._sidebar-container_1cvpv_1{display:flex;flex-direction:column;height:100%;min-height:0;min-width:220px;overflow:hidden;border-right:1px solid #ddd}._sidebar-mobile-relative_1cvpv_11{height:100%;min-height:0;overflow:hidden}._sidebar-row_1cvpv_17{cursor:pointer}._sidebar-row_1cvpv_17>div>svg{margin-right:.5rem}._relative-time-root_emohw_1{display:flex;flex:1;flex-direction:column;height:100%;min-height:0}._relative-time-panel-container_emohw_9{flex:1;min-height:0;overflow-y:auto;margin-top:8px}._time-row_emohw_16{cursor:pointer}._time-row-dark_emohw_20:hover{background-color:#3a3a3a}._time-row-light_emohw_26:hover{background-color:#f3f4f6}._trigger-
|
|
1
|
+
._row_550mo_1{padding:.4rem}._row-dark_550mo_5{cursor:pointer}._row-dark_550mo_5:hover{background-color:#3a3a3a}._row-light_550mo_12{cursor:pointer}._row-light_550mo_12:hover{background-color:#f3f4f6}._row-selected-dark_550mo_19{background-color:#5a5a5a;font-weight:600}._row-selected-dark_550mo_19:hover{background-color:#5a5a5a}._row-selected-light_550mo_27{background-color:#f3f4f6;font-weight:600}._row-selected-light_550mo_27:hover{background-color:#f3f4f6}._timezone-panel-container_tykz4_1{height:100%;min-height:0}._search-container_tykz4_6{position:sticky;top:0;z-index:1;width:95%;margin:0 auto;padding-bottom:8px}._timezone-scroll-area_tykz4_15{flex:1;min-height:0;overflow-y:auto}._list-container_tykz4_21{margin-top:.5rem}._form-container_1xxf4_1{display:flex;flex:2;flex-direction:column;justify-content:space-between;height:100%}._sidebar-container_1cvpv_1{display:flex;flex-direction:column;height:100%;min-height:0;min-width:220px;overflow:hidden;border-right:1px solid #ddd}._sidebar-mobile-relative_1cvpv_11{height:100%;min-height:0;overflow:hidden}._sidebar-row_1cvpv_17{cursor:pointer}._sidebar-row_1cvpv_17>div>svg{margin-right:.5rem}._relative-time-root_emohw_1{display:flex;flex:1;flex-direction:column;height:100%;min-height:0}._relative-time-panel-container_emohw_9{flex:1;min-height:0;overflow-y:auto;margin-top:8px}._time-row_emohw_16{cursor:pointer}._time-row-dark_emohw_20:hover{background-color:#3a3a3a}._time-row-light_emohw_26:hover{background-color:#f3f4f6}._trigger-button_1rr9j_1{max-width:100%}._trigger-button_1rr9j_1 .mantine-Button-inner{min-width:0}._trigger-button_1rr9j_1 .mantine-Button-label{display:flex;align-items:center;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._picker-shell_1rr9j_18{height:100%}._basic-view_1rr9j_22{padding:12px}._basic-quick-options_1rr9j_26{height:150px;flex:none;overflow-y:auto}._drawer-view_1rr9j_32{height:100%;min-height:0}._drawer-view_1rr9j_32 ._basic-view_1rr9j_22{width:min(100%,420px);height:auto;margin:0 auto}._mobile-layout_1rr9j_43{display:flex;flex-direction:column;height:100%;min-height:0}._mobile-nav_1rr9j_50{padding:12px}._mobile-content_1rr9j_54{flex:1;min-height:0;overflow:hidden}
|
package/dist/util/dateTime.d.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { TzRange } from "../interfaces";
|
|
3
3
|
export declare const DATEFORMAT = "YYYY/MM/DD";
|
|
4
4
|
export declare const TIMEFORMAT = "HH:mm:ss";
|
|
5
|
+
export type DateTimeUnit = "second" | "minute" | "hour" | "day";
|
|
6
|
+
export declare const formatShortDate: (date: Temporal.PlainDate) => string;
|
|
7
|
+
export declare const formatTwelveHourTime: (dateTime: Temporal.ZonedDateTime) => string;
|
|
8
|
+
export declare const nowInTimezone: (zone?: string | null) => Temporal.ZonedDateTime;
|
|
5
9
|
export declare const getCurrentTime: (tzRange: TzRange) => string;
|
|
6
10
|
export declare const getCurrentDate: (tzRange: TzRange) => string;
|
|
7
11
|
export declare const getCurrentPlusDate: (amount: number) => string;
|
|
@@ -9,11 +13,13 @@ export declare const getShortTimezoneName: (tz: string | null) => string | null;
|
|
|
9
13
|
type ButtonTextSize = "desktop" | "tablet" | "mobile";
|
|
10
14
|
export declare const getPopoverButtonText: (tzRange: TzRange, size?: ButtonTextSize) => string;
|
|
11
15
|
export declare const getTimezoneMetaLabel: (timezone: TzRange["timezone"], compact?: boolean) => string;
|
|
12
|
-
export declare const
|
|
16
|
+
export declare const parseDate: (date: string) => Temporal.PlainDate;
|
|
17
|
+
export declare const parseDateTime: (date: string, time: string) => Temporal.PlainDateTime;
|
|
18
|
+
export declare const getPastDateTime: (date: string | null, time: string, amount: number, unit: DateTimeUnit) => {
|
|
13
19
|
date: string;
|
|
14
20
|
time: string;
|
|
15
21
|
};
|
|
16
|
-
export declare const getFutureDateTime: (date: string | null, time: string, amount: number, unit:
|
|
22
|
+
export declare const getFutureDateTime: (date: string | null, time: string, amount: number, unit: DateTimeUnit) => {
|
|
17
23
|
date: string;
|
|
18
24
|
time: string;
|
|
19
25
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dateTime.d.ts","sourceRoot":"","sources":["../../src/util/dateTime.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"dateTime.d.ts","sourceRoot":"","sources":["../../src/util/dateTime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,eAAO,MAAM,UAAU,eAAe,CAAC;AACvC,eAAO,MAAM,UAAU,aAAa,CAAC;AAErC,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,CAAC;AAYhE,eAAO,MAAM,eAAe,GAAI,MAAM,QAAQ,CAAC,SAAS,WAKvD,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,UAAU,QAAQ,CAAC,aAAa,WAGpE,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,OAAO,MAAM,GAAG,IAAI,2BAC4B,CAAC;AAE/E,eAAO,MAAM,cAAc,GAAI,SAAS,OAAO,WACiB,CAAC;AAEjE,eAAO,MAAM,cAAc,GAAI,SAAS,OAAO,WACiB,CAAC;AAEjE,eAAO,MAAM,kBAAkB,GAAI,QAAQ,MAAM,WACgB,CAAC;AAElE,eAAO,MAAM,oBAAoB,GAAI,IAAI,MAAM,GAAG,IAAI,kBAClB,CAAC;AAErC,KAAK,cAAc,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEtD,eAAO,MAAM,oBAAoB,GAAI,SAAS,OAAO,EAAE,OAAM,cAA0B,WAmBtF,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,UAAU,OAAO,CAAC,UAAU,CAAC,EAAE,iBAAe,WAIlF,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,MAAM,MAAM,uBAAsD,CAAC;AAE7F,eAAO,MAAM,aAAa,GAAI,MAAM,MAAM,EAAE,MAAM,MAAM,2BACY,CAAC;AAiBrE,eAAO,MAAM,eAAe,GAC1B,MAAM,MAAM,GAAG,IAAI,EACnB,MAAM,MAAM,EACZ,QAAQ,MAAM,EACd,MAAM,YAAY;;;CAC6B,CAAC;AAElD,eAAO,MAAM,iBAAiB,GAC5B,MAAM,MAAM,GAAG,IAAI,EACnB,MAAM,MAAM,EACZ,QAAQ,MAAM,EACd,MAAM,YAAY;;;CAC4B,CAAC;AAEjD,eAAO,MAAM,QAAQ,GAAI,SAAS,MAAM,EAAE,SAAS,MAAM,EAAE,YAAY,MAAM,WACO,CAAC;AAErF,eAAO,MAAM,IAAI,GAAI,QAAQ,MAAM,EAAE,MAAM,MAAM;;;CAGhD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-timezone-range-picker",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "React UI components for building timezone-aware date and time range pickers, powered by Mantine and designed for flexibility.",
|
|
5
5
|
"author": "Vaibhav Dangra vaibhav1180@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
7
|
+
"repository": "https://github.com/GermaVinsmoke/react-timezone-range-picker",
|
|
7
8
|
"main": "dist/index.cjs.js",
|
|
8
9
|
"module": "dist/index.es.js",
|
|
9
10
|
"types": "dist/index.d.ts",
|
|
@@ -33,37 +34,40 @@
|
|
|
33
34
|
"lint": "eslint src --ext .ts,.tsx"
|
|
34
35
|
},
|
|
35
36
|
"peerDependencies": {
|
|
36
|
-
"@mantine/core": "^
|
|
37
|
-
"@mantine/dates": "^
|
|
38
|
-
"@mantine/form": "^
|
|
39
|
-
"@mantine/hooks": "^
|
|
40
|
-
"
|
|
41
|
-
"react": "
|
|
42
|
-
"react-dom": ">=18"
|
|
37
|
+
"@mantine/core": "^9.5.2",
|
|
38
|
+
"@mantine/dates": "^9.5.2",
|
|
39
|
+
"@mantine/form": "^9.5.2",
|
|
40
|
+
"@mantine/hooks": "^9.5.2",
|
|
41
|
+
"react": "^19.2.0",
|
|
42
|
+
"react-dom": "^19.2.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@mantine/core": "^
|
|
46
|
-
"@mantine/dates": "^
|
|
47
|
-
"@mantine/form": "^
|
|
48
|
-
"@mantine/hooks": "^
|
|
45
|
+
"@mantine/core": "^9.5.2",
|
|
46
|
+
"@mantine/dates": "^9.5.2",
|
|
47
|
+
"@mantine/form": "^9.5.2",
|
|
48
|
+
"@mantine/hooks": "^9.5.2",
|
|
49
49
|
"@tabler/icons-react": "^3.35.0",
|
|
50
50
|
"@testing-library/jest-dom": "^6.8.0",
|
|
51
51
|
"@testing-library/react": "^16.3.0",
|
|
52
52
|
"@types/node": "^24.5.0",
|
|
53
|
-
"@types/react": "^
|
|
54
|
-
"@types/react-dom": "^
|
|
53
|
+
"@types/react": "^19.2.18",
|
|
54
|
+
"@types/react-dom": "^19.2.5",
|
|
55
55
|
"@typescript-eslint/eslint-plugin": "^8.44.0",
|
|
56
56
|
"@typescript-eslint/parser": "^8.44.0",
|
|
57
57
|
"@vitejs/plugin-react": "^5.0.2",
|
|
58
58
|
"add": "^2.0.6",
|
|
59
59
|
"clsx": "^2.1.1",
|
|
60
|
-
"dayjs": "^1.11.18",
|
|
61
60
|
"eslint": "^9.35.0",
|
|
62
61
|
"eslint-plugin-react-refresh": "^0.4.20",
|
|
63
62
|
"jsdom": "^27.0.0",
|
|
63
|
+
"react": "^19.2.0",
|
|
64
|
+
"react-dom": "^19.2.0",
|
|
64
65
|
"react-use": "^17.6.0",
|
|
65
66
|
"typescript": "^5.9.2",
|
|
66
67
|
"vite": "^7.1.5",
|
|
67
68
|
"vitest": "^3.2.4"
|
|
69
|
+
},
|
|
70
|
+
"dependencies": {
|
|
71
|
+
"@js-temporal/polyfill": "^0.5.1"
|
|
68
72
|
}
|
|
69
73
|
}
|