@vritti/quantum-ui 0.2.5 → 0.2.7

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.
Files changed (71) hide show
  1. package/dist/Button2.js +2 -1
  2. package/dist/Button2.js.map +1 -1
  3. package/dist/Checkbox.js +3 -5
  4. package/dist/Checkbox.js.map +1 -1
  5. package/dist/DatePicker.js +416 -139
  6. package/dist/DatePicker.js.map +1 -1
  7. package/dist/Form.js.map +1 -1
  8. package/dist/Label.js +1 -1
  9. package/dist/Label.js.map +1 -1
  10. package/dist/OTPField.js +1 -1
  11. package/dist/OTPField.js.map +1 -1
  12. package/dist/PasswordField.js +3 -16
  13. package/dist/PasswordField.js.map +1 -1
  14. package/dist/PhoneField.js +23 -7
  15. package/dist/PhoneField.js.map +1 -1
  16. package/dist/Sonner.js +1249 -0
  17. package/dist/Sonner.js.map +1 -0
  18. package/dist/Spinner.js +1 -12
  19. package/dist/Spinner.js.map +1 -1
  20. package/dist/ThemeToggle.js +2 -2
  21. package/dist/ThemeToggle.js.map +1 -1
  22. package/dist/assets/quantum-ui.css +41 -10
  23. package/dist/axios.js +186 -59
  24. package/dist/axios.js.map +1 -1
  25. package/dist/circle-check-big.js +18 -0
  26. package/dist/circle-check-big.js.map +1 -0
  27. package/dist/components/Progress.js +61 -2
  28. package/dist/components/Progress.js.map +1 -1
  29. package/dist/components/Sonner.js +3 -0
  30. package/dist/components/Sonner.js.map +1 -0
  31. package/dist/createLucideIcon.js +4 -4
  32. package/dist/createLucideIcon.js.map +1 -1
  33. package/dist/field.js +2 -36
  34. package/dist/field.js.map +1 -1
  35. package/dist/index.js +2 -0
  36. package/dist/index.js.map +1 -1
  37. package/dist/index2.js +130 -54
  38. package/dist/index2.js.map +1 -1
  39. package/dist/index3.js +1 -103
  40. package/dist/index3.js.map +1 -1
  41. package/dist/index4.js +36 -35
  42. package/dist/index4.js.map +1 -1
  43. package/dist/index5.js +303 -3
  44. package/dist/index5.js.map +1 -1
  45. package/dist/lib/components/Sonner/Sonner.d.ts +5 -0
  46. package/dist/lib/components/Sonner/Sonner.d.ts.map +1 -0
  47. package/dist/lib/components/Sonner/index.d.ts +4 -0
  48. package/dist/lib/components/Sonner/index.d.ts.map +1 -0
  49. package/dist/lib/components/Sonner/toast.d.ts +29 -0
  50. package/dist/lib/components/Sonner/toast.d.ts.map +1 -0
  51. package/dist/lib/components/index.d.ts +1 -0
  52. package/dist/lib/components/index.d.ts.map +1 -1
  53. package/dist/lib/utils/axios.d.ts +5 -0
  54. package/dist/lib/utils/axios.d.ts.map +1 -1
  55. package/dist/loader-circle.js +15 -0
  56. package/dist/loader-circle.js.map +1 -0
  57. package/dist/shadcn/index.d.ts +1 -0
  58. package/dist/shadcn/index.d.ts.map +1 -1
  59. package/dist/shadcn/shadcnSonner/index.d.ts +2 -0
  60. package/dist/shadcn/shadcnSonner/index.d.ts.map +1 -0
  61. package/dist/shadcn/shadcnSonner/sonner.d.ts +4 -0
  62. package/dist/shadcn/shadcnSonner/sonner.d.ts.map +1 -0
  63. package/dist/toast.js +72 -0
  64. package/dist/toast.js.map +1 -0
  65. package/dist/utils/axios.js +1 -0
  66. package/dist/utils/axios.js.map +1 -1
  67. package/dist/utils.js +229 -150
  68. package/dist/utils.js.map +1 -1
  69. package/package.json +38 -32
  70. package/dist/index6.js +0 -246
  71. package/dist/index6.js.map +0 -1
@@ -3,17 +3,15 @@ import * as React from 'react';
3
3
  import React__default, { createContext, useContext, useCallback, useRef, useLayoutEffect, useState, useEffect, useMemo } from 'react';
4
4
  import { c as cn } from './utils.js';
5
5
  import { L as Label } from './Label.js';
6
- import { c as composeEventHandlers, b as useLayoutEffect2, a as useSize, u as useControllableState, P as Presence } from './index6.js';
7
- import { u as useComposedRefs } from './index4.js';
8
- import { c as createContextScope } from './index2.js';
9
- import { P as Primitive, d as dispatchDiscreteCustomEvent, c as createSlot } from './index5.js';
6
+ import { a as Primitive, b as composeEventHandlers, e as dispatchDiscreteCustomEvent, f as useLayoutEffect2, c as createContextScope, d as useSize, u as useControllableState, P as Presence, g as createSlot } from './index5.js';
7
+ import { u as useComposedRefs } from './index2.js';
10
8
  import * as ReactDOM from 'react-dom';
11
9
  import ReactDOM__default from 'react-dom';
12
10
  import { b as buttonVariants, B as Button$1 } from './Button2.js';
13
11
  import { c as createLucideIcon } from './createLucideIcon.js';
14
12
 
15
13
  /**
16
- * @license lucide-react v0.544.0 - ISC
14
+ * @license lucide-react v0.562.0 - ISC
17
15
  *
18
16
  * This source code is licensed under the ISC license.
19
17
  * See the LICENSE file in the root directory of this source tree.
@@ -24,7 +22,7 @@ const __iconNode$2 = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
24
22
  const ChevronDown = createLucideIcon("chevron-down", __iconNode$2);
25
23
 
26
24
  /**
27
- * @license lucide-react v0.544.0 - ISC
25
+ * @license lucide-react v0.562.0 - ISC
28
26
  *
29
27
  * This source code is licensed under the ISC license.
30
28
  * See the LICENSE file in the root directory of this source tree.
@@ -35,7 +33,7 @@ const __iconNode$1 = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]];
35
33
  const ChevronLeft = createLucideIcon("chevron-left", __iconNode$1);
36
34
 
37
35
  /**
38
- * @license lucide-react v0.544.0 - ISC
36
+ * @license lucide-react v0.562.0 - ISC
39
37
  *
40
38
  * This source code is licensed under the ISC license.
41
39
  * See the LICENSE file in the root directory of this source tree.
@@ -2250,7 +2248,7 @@ const match = {
2250
2248
  * @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)
2251
2249
  * @author Lesha Koss [@leshakoss](https://github.com/leshakoss)
2252
2250
  */
2253
- const enUS = {
2251
+ const enUS$1 = {
2254
2252
  code: "en-US",
2255
2253
  formatDistance: formatDistance,
2256
2254
  formatLong: formatLong,
@@ -3765,7 +3763,7 @@ const unescapedLatinCharacterRegExp = /[a-zA-Z]/;
3765
3763
  */
3766
3764
  function format(date, formatStr, options) {
3767
3765
  const defaultOptions = getDefaultOptions();
3768
- const locale = options?.locale ?? defaultOptions.locale ?? enUS;
3766
+ const locale = options?.locale ?? defaultOptions.locale ?? enUS$1;
3769
3767
 
3770
3768
  const firstWeekContainsDate =
3771
3769
  options?.firstWeekContainsDate ??
@@ -4215,6 +4213,69 @@ function endOfBroadcastWeek(date, dateLib) {
4215
4213
  return endDate;
4216
4214
  }
4217
4215
 
4216
+ /** English (United States) locale extended with DayPicker-specific translations. */
4217
+ const enUS = {
4218
+ ...enUS$1,
4219
+ labels: {
4220
+ labelDayButton: (date, modifiers, options, dateLib) => {
4221
+ let formatDate;
4222
+ if (dateLib && typeof dateLib.format === "function") {
4223
+ formatDate = dateLib.format.bind(dateLib);
4224
+ }
4225
+ else {
4226
+ formatDate = (d, pattern) => format(d, pattern, { locale: enUS$1, ...options });
4227
+ }
4228
+ let label = formatDate(date, "PPPP");
4229
+ if (modifiers.today)
4230
+ label = `Today, ${label}`;
4231
+ if (modifiers.selected)
4232
+ label = `${label}, selected`;
4233
+ return label;
4234
+ },
4235
+ labelMonthDropdown: "Choose the Month",
4236
+ labelNext: "Go to the Next Month",
4237
+ labelPrevious: "Go to the Previous Month",
4238
+ labelWeekNumber: (weekNumber) => `Week ${weekNumber}`,
4239
+ labelYearDropdown: "Choose the Year",
4240
+ labelGrid: (date, options, dateLib) => {
4241
+ let formatDate;
4242
+ if (dateLib && typeof dateLib.format === "function") {
4243
+ formatDate = dateLib.format.bind(dateLib);
4244
+ }
4245
+ else {
4246
+ formatDate = (d, pattern) => format(d, pattern, { locale: enUS$1, ...options });
4247
+ }
4248
+ return formatDate(date, "LLLL yyyy");
4249
+ },
4250
+ labelGridcell: (date, modifiers, options, dateLib) => {
4251
+ let formatDate;
4252
+ if (dateLib && typeof dateLib.format === "function") {
4253
+ formatDate = dateLib.format.bind(dateLib);
4254
+ }
4255
+ else {
4256
+ formatDate = (d, pattern) => format(d, pattern, { locale: enUS$1, ...options });
4257
+ }
4258
+ let label = formatDate(date, "PPPP");
4259
+ if (modifiers?.today) {
4260
+ label = `Today, ${label}`;
4261
+ }
4262
+ return label;
4263
+ },
4264
+ labelNav: "Navigation bar",
4265
+ labelWeekNumberHeader: "Week Number",
4266
+ labelWeekday: (date, options, dateLib) => {
4267
+ let formatDate;
4268
+ if (dateLib && typeof dateLib.format === "function") {
4269
+ formatDate = dateLib.format.bind(dateLib);
4270
+ }
4271
+ else {
4272
+ formatDate = (d, pattern) => format(d, pattern, { locale: enUS$1, ...options });
4273
+ }
4274
+ return formatDate(date, "cccc");
4275
+ },
4276
+ },
4277
+ };
4278
+
4218
4279
  /**
4219
4280
  * A wrapper class around [date-fns](http://date-fns.org) that provides utility
4220
4281
  * methods for date manipulation and formatting.
@@ -5437,7 +5498,7 @@ function dateMatchModifiers(date, matchers, dateLib = defaultDateLib) {
5437
5498
  return isSameDay(date, matcher);
5438
5499
  }
5439
5500
  if (isDatesArray(matcher, dateLib)) {
5440
- return matcher.includes(date);
5501
+ return matcher.some((matcherDate) => isSameDay(date, matcherDate));
5441
5502
  }
5442
5503
  if (isDateRange(matcher)) {
5443
5504
  return rangeIncludesDate(matcher, date, false, dateLib);
@@ -5822,122 +5883,6 @@ function getFormatters(customFormatters) {
5822
5883
  };
5823
5884
  }
5824
5885
 
5825
- /**
5826
- * Returns the months to show in the dropdown.
5827
- *
5828
- * This function generates a list of months for the current year, formatted
5829
- * using the provided formatter, and determines whether each month should be
5830
- * disabled based on the navigation range.
5831
- *
5832
- * @param displayMonth The currently displayed month.
5833
- * @param navStart The start date for navigation.
5834
- * @param navEnd The end date for navigation.
5835
- * @param formatters The formatters to use for formatting the month labels.
5836
- * @param dateLib The date library to use for date manipulation.
5837
- * @returns An array of dropdown options representing the months, or `undefined`
5838
- * if no months are available.
5839
- */
5840
- function getMonthOptions(displayMonth, navStart, navEnd, formatters, dateLib) {
5841
- const { startOfMonth, startOfYear, endOfYear, eachMonthOfInterval, getMonth, } = dateLib;
5842
- const months = eachMonthOfInterval({
5843
- start: startOfYear(displayMonth),
5844
- end: endOfYear(displayMonth),
5845
- });
5846
- const options = months.map((month) => {
5847
- const label = formatters.formatMonthDropdown(month, dateLib);
5848
- const value = getMonth(month);
5849
- const disabled = (navStart && month < startOfMonth(navStart)) ||
5850
- (navEnd && month > startOfMonth(navEnd)) ||
5851
- false;
5852
- return { value, label, disabled };
5853
- });
5854
- return options;
5855
- }
5856
-
5857
- /**
5858
- * Returns the computed style for a day based on its modifiers.
5859
- *
5860
- * This function merges the base styles for the day with any styles associated
5861
- * with active modifiers.
5862
- *
5863
- * @param dayModifiers The modifiers applied to the day.
5864
- * @param styles The base styles for the calendar elements.
5865
- * @param modifiersStyles The styles associated with specific modifiers.
5866
- * @returns The computed style for the day.
5867
- */
5868
- function getStyleForModifiers(dayModifiers, styles = {}, modifiersStyles = {}) {
5869
- let style = { ...styles?.[UI.Day] };
5870
- Object.entries(dayModifiers)
5871
- .filter(([, active]) => active === true)
5872
- .forEach(([modifier]) => {
5873
- style = {
5874
- ...style,
5875
- ...modifiersStyles?.[modifier],
5876
- };
5877
- });
5878
- return style;
5879
- }
5880
-
5881
- /**
5882
- * Generates a series of 7 days, starting from the beginning of the week, to use
5883
- * for formatting weekday names (e.g., Monday, Tuesday, etc.).
5884
- *
5885
- * @param dateLib The date library to use for date manipulation.
5886
- * @param ISOWeek Whether to use ISO week numbering (weeks start on Monday).
5887
- * @param broadcastCalendar Whether to use the broadcast calendar (weeks start
5888
- * on Monday, but may include adjustments for broadcast-specific rules).
5889
- * @returns An array of 7 dates representing the weekdays.
5890
- */
5891
- function getWeekdays(dateLib, ISOWeek, broadcastCalendar, today) {
5892
- const referenceToday = today ?? dateLib.today();
5893
- const start = broadcastCalendar
5894
- ? dateLib.startOfBroadcastWeek(referenceToday, dateLib)
5895
- : ISOWeek
5896
- ? dateLib.startOfISOWeek(referenceToday)
5897
- : dateLib.startOfWeek(referenceToday);
5898
- const days = [];
5899
- for (let i = 0; i < 7; i++) {
5900
- const day = dateLib.addDays(start, i);
5901
- days.push(day);
5902
- }
5903
- return days;
5904
- }
5905
-
5906
- /**
5907
- * Returns the years to display in the dropdown.
5908
- *
5909
- * This function generates a list of years between the navigation start and end
5910
- * dates, formatted using the provided formatter.
5911
- *
5912
- * @param navStart The start date for navigation.
5913
- * @param navEnd The end date for navigation.
5914
- * @param formatters The formatters to use for formatting the year labels.
5915
- * @param dateLib The date library to use for date manipulation.
5916
- * @param reverse If true, reverses the order of the years (descending).
5917
- * @returns An array of dropdown options representing the years, or `undefined`
5918
- * if `navStart` or `navEnd` is not provided.
5919
- */
5920
- function getYearOptions(navStart, navEnd, formatters, dateLib, reverse = false) {
5921
- if (!navStart)
5922
- return undefined;
5923
- if (!navEnd)
5924
- return undefined;
5925
- const { startOfYear, endOfYear, eachYearOfInterval, getYear } = dateLib;
5926
- const firstNavYear = startOfYear(navStart);
5927
- const lastNavYear = endOfYear(navEnd);
5928
- const years = eachYearOfInterval({ start: firstNavYear, end: lastNavYear });
5929
- if (reverse)
5930
- years.reverse();
5931
- return years.map((year) => {
5932
- const label = formatters.formatYearDropdown(year, dateLib);
5933
- return {
5934
- value: getYear(year),
5935
- label,
5936
- disabled: false,
5937
- };
5938
- });
5939
- }
5940
-
5941
5886
  /**
5942
5887
  * Generates the ARIA label for a day button.
5943
5888
  *
@@ -6033,6 +5978,7 @@ function labelNav() {
6033
5978
  return "";
6034
5979
  }
6035
5980
 
5981
+ const defaultLabel = "Go to the Next Month";
6036
5982
  /**
6037
5983
  * Generates the ARIA label for the "next month" button.
6038
5984
  *
@@ -6043,8 +5989,8 @@ function labelNav() {
6043
5989
  * @group Labels
6044
5990
  * @see https://daypicker.dev/docs/translation#aria-labels
6045
5991
  */
6046
- function labelNext(_month) {
6047
- return "Go to the Next Month";
5992
+ function labelNext(_month, _options) {
5993
+ return defaultLabel;
6048
5994
  }
6049
5995
 
6050
5996
  /**
@@ -6133,6 +6079,316 @@ const defaultLabels = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.definePrope
6133
6079
  labelYearDropdown
6134
6080
  }, Symbol.toStringTag, { value: 'Module' }));
6135
6081
 
6082
+ const resolveLabel = (defaultLabel, customLabel, localeLabel) => {
6083
+ if (customLabel)
6084
+ return customLabel;
6085
+ if (localeLabel) {
6086
+ return (typeof localeLabel === "function"
6087
+ ? localeLabel
6088
+ : (..._args) => localeLabel);
6089
+ }
6090
+ return defaultLabel;
6091
+ };
6092
+ /**
6093
+ * Merges custom labels from the props with the default labels.
6094
+ *
6095
+ * When available, uses the locale-provided translation for `labelNext`.
6096
+ *
6097
+ * @param customLabels The custom labels provided in the DayPicker props.
6098
+ * @param options Options from the date library, used to resolve locale
6099
+ * translations.
6100
+ * @returns The merged labels object with locale-aware defaults.
6101
+ */
6102
+ function getLabels(customLabels, options) {
6103
+ const localeLabels = options.locale?.labels ?? {};
6104
+ return {
6105
+ ...defaultLabels,
6106
+ ...(customLabels ?? {}),
6107
+ labelDayButton: resolveLabel(labelDayButton, customLabels?.labelDayButton, localeLabels.labelDayButton),
6108
+ labelMonthDropdown: resolveLabel(labelMonthDropdown, customLabels?.labelMonthDropdown, localeLabels.labelMonthDropdown),
6109
+ labelNext: resolveLabel(labelNext, customLabels?.labelNext, localeLabels.labelNext),
6110
+ labelPrevious: resolveLabel(labelPrevious, customLabels?.labelPrevious, localeLabels.labelPrevious),
6111
+ labelWeekNumber: resolveLabel(labelWeekNumber, customLabels?.labelWeekNumber, localeLabels.labelWeekNumber),
6112
+ labelYearDropdown: resolveLabel(labelYearDropdown, customLabels?.labelYearDropdown, localeLabels.labelYearDropdown),
6113
+ labelGrid: resolveLabel(labelGrid, customLabels?.labelGrid, localeLabels.labelGrid),
6114
+ labelGridcell: resolveLabel(labelGridcell, customLabels?.labelGridcell, localeLabels.labelGridcell),
6115
+ labelNav: resolveLabel(labelNav, customLabels?.labelNav, localeLabels.labelNav),
6116
+ labelWeekNumberHeader: resolveLabel(labelWeekNumberHeader, customLabels?.labelWeekNumberHeader, localeLabels.labelWeekNumberHeader),
6117
+ labelWeekday: resolveLabel(labelWeekday, customLabels?.labelWeekday, localeLabels.labelWeekday),
6118
+ };
6119
+ }
6120
+
6121
+ /**
6122
+ * Returns the months to show in the dropdown.
6123
+ *
6124
+ * This function generates a list of months for the current year, formatted
6125
+ * using the provided formatter, and determines whether each month should be
6126
+ * disabled based on the navigation range.
6127
+ *
6128
+ * @param displayMonth The currently displayed month.
6129
+ * @param navStart The start date for navigation.
6130
+ * @param navEnd The end date for navigation.
6131
+ * @param formatters The formatters to use for formatting the month labels.
6132
+ * @param dateLib The date library to use for date manipulation.
6133
+ * @returns An array of dropdown options representing the months, or `undefined`
6134
+ * if no months are available.
6135
+ */
6136
+ function getMonthOptions(displayMonth, navStart, navEnd, formatters, dateLib) {
6137
+ const { startOfMonth, startOfYear, endOfYear, eachMonthOfInterval, getMonth, } = dateLib;
6138
+ const months = eachMonthOfInterval({
6139
+ start: startOfYear(displayMonth),
6140
+ end: endOfYear(displayMonth),
6141
+ });
6142
+ const options = months.map((month) => {
6143
+ const label = formatters.formatMonthDropdown(month, dateLib);
6144
+ const value = getMonth(month);
6145
+ const disabled = (navStart && month < startOfMonth(navStart)) ||
6146
+ (navEnd && month > startOfMonth(navEnd)) ||
6147
+ false;
6148
+ return { value, label, disabled };
6149
+ });
6150
+ return options;
6151
+ }
6152
+
6153
+ /**
6154
+ * Returns the computed style for a day based on its modifiers.
6155
+ *
6156
+ * This function merges the base styles for the day with any styles associated
6157
+ * with active modifiers.
6158
+ *
6159
+ * @param dayModifiers The modifiers applied to the day.
6160
+ * @param styles The base styles for the calendar elements.
6161
+ * @param modifiersStyles The styles associated with specific modifiers.
6162
+ * @returns The computed style for the day.
6163
+ */
6164
+ function getStyleForModifiers(dayModifiers, styles = {}, modifiersStyles = {}) {
6165
+ let style = { ...styles?.[UI.Day] };
6166
+ Object.entries(dayModifiers)
6167
+ .filter(([, active]) => active === true)
6168
+ .forEach(([modifier]) => {
6169
+ style = {
6170
+ ...style,
6171
+ ...modifiersStyles?.[modifier],
6172
+ };
6173
+ });
6174
+ return style;
6175
+ }
6176
+
6177
+ /**
6178
+ * Generates a series of 7 days, starting from the beginning of the week, to use
6179
+ * for formatting weekday names (e.g., Monday, Tuesday, etc.).
6180
+ *
6181
+ * @param dateLib The date library to use for date manipulation.
6182
+ * @param ISOWeek Whether to use ISO week numbering (weeks start on Monday).
6183
+ * @param broadcastCalendar Whether to use the broadcast calendar (weeks start
6184
+ * on Monday, but may include adjustments for broadcast-specific rules).
6185
+ * @returns An array of 7 dates representing the weekdays.
6186
+ */
6187
+ function getWeekdays(dateLib, ISOWeek, broadcastCalendar, today) {
6188
+ const referenceToday = today ?? dateLib.today();
6189
+ const start = broadcastCalendar
6190
+ ? dateLib.startOfBroadcastWeek(referenceToday, dateLib)
6191
+ : ISOWeek
6192
+ ? dateLib.startOfISOWeek(referenceToday)
6193
+ : dateLib.startOfWeek(referenceToday);
6194
+ const days = [];
6195
+ for (let i = 0; i < 7; i++) {
6196
+ const day = dateLib.addDays(start, i);
6197
+ days.push(day);
6198
+ }
6199
+ return days;
6200
+ }
6201
+
6202
+ /**
6203
+ * Returns the years to display in the dropdown.
6204
+ *
6205
+ * This function generates a list of years between the navigation start and end
6206
+ * dates, formatted using the provided formatter.
6207
+ *
6208
+ * @param navStart The start date for navigation.
6209
+ * @param navEnd The end date for navigation.
6210
+ * @param formatters The formatters to use for formatting the year labels.
6211
+ * @param dateLib The date library to use for date manipulation.
6212
+ * @param reverse If true, reverses the order of the years (descending).
6213
+ * @returns An array of dropdown options representing the years, or `undefined`
6214
+ * if `navStart` or `navEnd` is not provided.
6215
+ */
6216
+ function getYearOptions(navStart, navEnd, formatters, dateLib, reverse = false) {
6217
+ if (!navStart)
6218
+ return undefined;
6219
+ if (!navEnd)
6220
+ return undefined;
6221
+ const { startOfYear, endOfYear, eachYearOfInterval, getYear } = dateLib;
6222
+ const firstNavYear = startOfYear(navStart);
6223
+ const lastNavYear = endOfYear(navEnd);
6224
+ const years = eachYearOfInterval({ start: firstNavYear, end: lastNavYear });
6225
+ if (reverse)
6226
+ years.reverse();
6227
+ return years.map((year) => {
6228
+ const label = formatters.formatYearDropdown(year, dateLib);
6229
+ return {
6230
+ value: getYear(year),
6231
+ label,
6232
+ disabled: false,
6233
+ };
6234
+ });
6235
+ }
6236
+
6237
+ /**
6238
+ * Creates `dateLib` overrides that keep all calendar math at noon in the target
6239
+ * time zone. This avoids second-level offset changes (e.g., historical zones
6240
+ * with +03:41:12) from pushing dates backward across midnight.
6241
+ */
6242
+ function createNoonOverrides(timeZone, options = {}) {
6243
+ const { weekStartsOn, locale } = options;
6244
+ const fallbackWeekStartsOn = (weekStartsOn ??
6245
+ locale?.options?.weekStartsOn ??
6246
+ 0);
6247
+ // Keep all internal math anchored at noon in the target zone to avoid
6248
+ // historical second-level offsets from crossing midnight.
6249
+ const toNoonTZDate = (date) => {
6250
+ const normalizedDate = typeof date === "number" || typeof date === "string"
6251
+ ? new Date(date)
6252
+ : date;
6253
+ return new TZDate(normalizedDate.getFullYear(), normalizedDate.getMonth(), normalizedDate.getDate(), 12, 0, 0, timeZone);
6254
+ };
6255
+ // Convert a value into a host `Date` that represents the same calendar day
6256
+ // as the target-zone noon. This is useful for helpers (e.g., date-fns week
6257
+ // utilities) that expect local `Date` instances rather than `TZDate`s.
6258
+ const toCalendarDate = (date) => {
6259
+ const zoned = toNoonTZDate(date);
6260
+ return new Date(zoned.getFullYear(), zoned.getMonth(), zoned.getDate(), 0, 0, 0, 0);
6261
+ };
6262
+ return {
6263
+ today: () => {
6264
+ return toNoonTZDate(TZDate.tz(timeZone));
6265
+ },
6266
+ newDate: (year, monthIndex, date) => {
6267
+ return new TZDate(year, monthIndex, date, 12, 0, 0, timeZone);
6268
+ },
6269
+ startOfDay: (date) => {
6270
+ return toNoonTZDate(date);
6271
+ },
6272
+ startOfWeek: (date, options) => {
6273
+ const base = toNoonTZDate(date);
6274
+ const weekStartsOnValue = (options?.weekStartsOn ??
6275
+ fallbackWeekStartsOn);
6276
+ const diff = (base.getDay() - weekStartsOnValue + 7) % 7;
6277
+ base.setDate(base.getDate() - diff);
6278
+ return base;
6279
+ },
6280
+ startOfISOWeek: (date) => {
6281
+ const base = toNoonTZDate(date);
6282
+ const diff = (base.getDay() - 1 + 7) % 7;
6283
+ base.setDate(base.getDate() - diff);
6284
+ return base;
6285
+ },
6286
+ startOfMonth: (date) => {
6287
+ const base = toNoonTZDate(date);
6288
+ base.setDate(1);
6289
+ return base;
6290
+ },
6291
+ startOfYear: (date) => {
6292
+ const base = toNoonTZDate(date);
6293
+ base.setMonth(0, 1);
6294
+ return base;
6295
+ },
6296
+ endOfWeek: (date, options) => {
6297
+ const base = toNoonTZDate(date);
6298
+ const weekStartsOnValue = (options?.weekStartsOn ??
6299
+ fallbackWeekStartsOn);
6300
+ const endDow = (weekStartsOnValue + 6) % 7;
6301
+ const diff = (endDow - base.getDay() + 7) % 7;
6302
+ base.setDate(base.getDate() + diff);
6303
+ return base;
6304
+ },
6305
+ endOfISOWeek: (date) => {
6306
+ const base = toNoonTZDate(date);
6307
+ const diff = (7 - base.getDay()) % 7;
6308
+ base.setDate(base.getDate() + diff);
6309
+ return base;
6310
+ },
6311
+ endOfMonth: (date) => {
6312
+ const base = toNoonTZDate(date);
6313
+ base.setMonth(base.getMonth() + 1, 0);
6314
+ return base;
6315
+ },
6316
+ endOfYear: (date) => {
6317
+ const base = toNoonTZDate(date);
6318
+ base.setMonth(11, 31);
6319
+ return base;
6320
+ },
6321
+ eachMonthOfInterval: (interval) => {
6322
+ const start = toNoonTZDate(interval.start);
6323
+ const end = toNoonTZDate(interval.end);
6324
+ const result = [];
6325
+ const cursor = new TZDate(start.getFullYear(), start.getMonth(), 1, 12, 0, 0, timeZone);
6326
+ const endKey = end.getFullYear() * 12 + end.getMonth();
6327
+ while (cursor.getFullYear() * 12 + cursor.getMonth() <= endKey) {
6328
+ result.push(new TZDate(cursor, timeZone));
6329
+ cursor.setMonth(cursor.getMonth() + 1, 1);
6330
+ }
6331
+ return result;
6332
+ },
6333
+ // Normalize to noon once before arithmetic (avoid DST/midnight edge cases),
6334
+ // mutate the same TZDate, and return it.
6335
+ addDays: (date, amount) => {
6336
+ const base = toNoonTZDate(date);
6337
+ base.setDate(base.getDate() + amount);
6338
+ return base;
6339
+ },
6340
+ addWeeks: (date, amount) => {
6341
+ const base = toNoonTZDate(date);
6342
+ base.setDate(base.getDate() + amount * 7);
6343
+ return base;
6344
+ },
6345
+ addMonths: (date, amount) => {
6346
+ const base = toNoonTZDate(date);
6347
+ base.setMonth(base.getMonth() + amount);
6348
+ return base;
6349
+ },
6350
+ addYears: (date, amount) => {
6351
+ const base = toNoonTZDate(date);
6352
+ base.setFullYear(base.getFullYear() + amount);
6353
+ return base;
6354
+ },
6355
+ eachYearOfInterval: (interval) => {
6356
+ const start = toNoonTZDate(interval.start);
6357
+ const end = toNoonTZDate(interval.end);
6358
+ const years = [];
6359
+ const cursor = new TZDate(start.getFullYear(), 0, 1, 12, 0, 0, timeZone);
6360
+ while (cursor.getFullYear() <= end.getFullYear()) {
6361
+ years.push(new TZDate(cursor, timeZone));
6362
+ cursor.setFullYear(cursor.getFullYear() + 1, 0, 1);
6363
+ }
6364
+ return years;
6365
+ },
6366
+ getWeek: (date, options) => {
6367
+ const base = toCalendarDate(date);
6368
+ return getWeek(base, {
6369
+ weekStartsOn: options?.weekStartsOn ?? fallbackWeekStartsOn,
6370
+ firstWeekContainsDate: options?.firstWeekContainsDate ??
6371
+ locale?.options?.firstWeekContainsDate ??
6372
+ 1,
6373
+ });
6374
+ },
6375
+ getISOWeek: (date) => {
6376
+ const base = toCalendarDate(date);
6377
+ return getISOWeek(base);
6378
+ },
6379
+ differenceInCalendarDays: (dateLeft, dateRight) => {
6380
+ const left = toCalendarDate(dateLeft);
6381
+ const right = toCalendarDate(dateRight);
6382
+ return differenceInCalendarDays(left, right);
6383
+ },
6384
+ differenceInCalendarMonths: (dateLeft, dateRight) => {
6385
+ const left = toCalendarDate(dateLeft);
6386
+ const right = toCalendarDate(dateRight);
6387
+ return differenceInCalendarMonths(left, right);
6388
+ },
6389
+ };
6390
+ }
6391
+
6136
6392
  const asHtmlElement = (element) => {
6137
6393
  if (element instanceof HTMLElement)
6138
6394
  return element;
@@ -7329,15 +7585,18 @@ function toTimeZone(date, timeZone) {
7329
7585
  return new TZDate(date, timeZone);
7330
7586
  }
7331
7587
 
7332
- function convertMatcher(matcher, timeZone) {
7588
+ function toZoneNoon(date, timeZone, noonSafe) {
7589
+ return toTimeZone(date, timeZone);
7590
+ }
7591
+ function convertMatcher(matcher, timeZone, noonSafe) {
7333
7592
  if (typeof matcher === "boolean" || typeof matcher === "function") {
7334
7593
  return matcher;
7335
7594
  }
7336
7595
  if (matcher instanceof Date) {
7337
- return toTimeZone(matcher, timeZone);
7596
+ return toZoneNoon(matcher, timeZone);
7338
7597
  }
7339
7598
  if (Array.isArray(matcher)) {
7340
- return matcher.map((value) => value instanceof Date ? toTimeZone(value, timeZone) : value);
7599
+ return matcher.map((value) => value instanceof Date ? toZoneNoon(value, timeZone) : value);
7341
7600
  }
7342
7601
  if (isDateRange(matcher)) {
7343
7602
  return {
@@ -7348,18 +7607,18 @@ function convertMatcher(matcher, timeZone) {
7348
7607
  }
7349
7608
  if (isDateInterval(matcher)) {
7350
7609
  return {
7351
- before: toTimeZone(matcher.before, timeZone),
7352
- after: toTimeZone(matcher.after, timeZone),
7610
+ before: toZoneNoon(matcher.before, timeZone),
7611
+ after: toZoneNoon(matcher.after, timeZone),
7353
7612
  };
7354
7613
  }
7355
7614
  if (isDateAfterType(matcher)) {
7356
7615
  return {
7357
- after: toTimeZone(matcher.after, timeZone),
7616
+ after: toZoneNoon(matcher.after, timeZone),
7358
7617
  };
7359
7618
  }
7360
7619
  if (isDateBeforeType(matcher)) {
7361
7620
  return {
7362
- before: toTimeZone(matcher.before, timeZone),
7621
+ before: toZoneNoon(matcher.before, timeZone),
7363
7622
  };
7364
7623
  }
7365
7624
  return matcher;
@@ -7372,7 +7631,7 @@ function convertMatcher(matcher, timeZone) {
7372
7631
  * @returns The converted matcher(s).
7373
7632
  * @group Utilities
7374
7633
  */
7375
- function convertMatchersToTimeZone(matchers, timeZone) {
7634
+ function convertMatchersToTimeZone(matchers, timeZone, noonSafe) {
7376
7635
  if (!matchers) {
7377
7636
  return matchers;
7378
7637
  }
@@ -7445,20 +7704,30 @@ function DayPicker(initialProps) {
7445
7704
  }
7446
7705
  const { components, formatters, labels, dateLib, locale, classNames } = useMemo(() => {
7447
7706
  const locale = { ...enUS, ...props.locale };
7707
+ const weekStartsOn = props.broadcastCalendar ? 1 : props.weekStartsOn;
7708
+ const noonOverrides = props.noonSafe && props.timeZone
7709
+ ? createNoonOverrides(props.timeZone, {
7710
+ weekStartsOn,
7711
+ locale,
7712
+ })
7713
+ : undefined;
7714
+ const overrides = props.dateLib && noonOverrides
7715
+ ? { ...noonOverrides, ...props.dateLib }
7716
+ : (props.dateLib ?? noonOverrides);
7448
7717
  const dateLib = new DateLib({
7449
7718
  locale,
7450
- weekStartsOn: props.broadcastCalendar ? 1 : props.weekStartsOn,
7719
+ weekStartsOn,
7451
7720
  firstWeekContainsDate: props.firstWeekContainsDate,
7452
7721
  useAdditionalWeekYearTokens: props.useAdditionalWeekYearTokens,
7453
7722
  useAdditionalDayOfYearTokens: props.useAdditionalDayOfYearTokens,
7454
7723
  timeZone: props.timeZone,
7455
7724
  numerals: props.numerals,
7456
- }, props.dateLib);
7725
+ }, overrides);
7457
7726
  return {
7458
7727
  dateLib,
7459
7728
  components: getComponents(props.components),
7460
7729
  formatters: getFormatters(props.formatters),
7461
- labels: { ...defaultLabels, ...props.labels },
7730
+ labels: getLabels(props.labels, dateLib.options),
7462
7731
  locale,
7463
7732
  classNames: { ...getDefaultClassNames(), ...props.classNames },
7464
7733
  };
@@ -7472,6 +7741,7 @@ function DayPicker(initialProps) {
7472
7741
  props.timeZone,
7473
7742
  props.numerals,
7474
7743
  props.dateLib,
7744
+ props.noonSafe,
7475
7745
  props.components,
7476
7746
  props.formatters,
7477
7747
  props.labels,
@@ -11551,6 +11821,13 @@ function RemoveScrollSideCar(props) {
11551
11821
  if ('touches' in event && moveDirection === 'h' && target.type === 'range') {
11552
11822
  return false;
11553
11823
  }
11824
+ // allow drag selection (iOS); check if selection's anchorNode is the same as target or contains target
11825
+ var selection = window.getSelection();
11826
+ var anchorNode = selection && selection.anchorNode;
11827
+ var isTouchingSelection = anchorNode ? anchorNode === target || anchorNode.contains(target) : false;
11828
+ if (isTouchingSelection) {
11829
+ return false;
11830
+ }
11554
11831
  var canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
11555
11832
  if (!canBeScrolledInMainDirection) {
11556
11833
  return true;