@flightlesslabs/dodo-ui 0.17.0-beta → 0.17.0-beta-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.
@@ -1,4 +1,5 @@
1
1
  import getMoment from '../../../../../developer tools/helpers/Time/getMoment/getMoment.js';
2
+ import dayjsLib from 'dayjs'; // Only needed for types
2
3
  /**
3
4
  * Creates a moment object from a Date with optional timezone and UTC settings.
4
5
  */
@@ -1,5 +1,6 @@
1
1
  import type { ConfigType, OptionType } from 'dayjs';
2
- import { Dayjs } from 'dayjs';
2
+ import dayjs from 'dayjs';
3
+ type Dayjs = ReturnType<typeof dayjs>;
3
4
  /**
4
5
  * Acceptable input types for the `getMoment` function, compatible with dayjs.
5
6
  */
@@ -35,3 +36,4 @@ export interface GetMomentSettings {
35
36
  * getMoment('01-01-2025', 'DD-MM-YYYY', { timezone: 'Asia/Kolkata' }).format()
36
37
  */
37
38
  export default function getMoment(date?: GetMomentDate, format?: GetMomentFormat, settings?: GetMomentSettings): Dayjs;
39
+ export {};
@@ -1,4 +1,4 @@
1
- import dayjs, { Dayjs } from 'dayjs';
1
+ import dayjs from 'dayjs';
2
2
  import utc from 'dayjs/plugin/utc.js';
3
3
  import timezone from 'dayjs/plugin/timezone.js';
4
4
  import customParseFormat from 'dayjs/plugin/customParseFormat.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flightlesslabs/dodo-ui",
3
- "version": "0.17.0-beta",
3
+ "version": "0.17.0-beta-2",
4
4
  "scripts": {
5
5
  "copy-css": "cpy src/lib/styles/global.css dist/styles --parents",
6
6
  "build": "vite build && pnpm copy-css && pnpm run prepack",
@@ -1,7 +1,9 @@
1
1
  import getMoment from '$lib/stories/developer tools/helpers/Time/getMoment/getMoment.js';
2
- import type dayjs from 'dayjs';
3
2
  import type { DateOfMonth } from '../types.js';
4
3
  import type { CalendarWeekNames } from '$lib/index.js';
4
+ import dayjsLib from 'dayjs'; // Only needed for types
5
+
6
+ type Dayjs = ReturnType<typeof dayjsLib>;
5
7
 
6
8
  /** Settings for generating calendar dates */
7
9
  export interface CreateDatesOfMonthSettings {
@@ -35,7 +37,7 @@ function dateMoment(
35
37
  /**
36
38
  * Determines if the given day matches "today" (manual or actual).
37
39
  */
38
- function getIsToday(dayMoment: dayjs.Dayjs, todayDate: string, todayManual?: string): boolean {
40
+ function getIsToday(dayMoment: Dayjs, todayDate: string, todayManual?: string): boolean {
39
41
  const dayDateFormat = dayMoment.format('DD-MM-YYYY');
40
42
  return todayManual === dayDateFormat || todayDate === dayDateFormat;
41
43
  }
@@ -44,9 +46,9 @@ function getIsToday(dayMoment: dayjs.Dayjs, todayDate: string, todayManual?: str
44
46
  * Determines if a date should be disabled based on limits and included/excluded lists.
45
47
  */
46
48
  function getIsDateDisabled(
47
- dayMoment: dayjs.Dayjs,
48
- minDate?: dayjs.Dayjs,
49
- maxDate?: dayjs.Dayjs,
49
+ dayMoment: Dayjs,
50
+ minDate?: Dayjs,
51
+ maxDate?: Dayjs,
50
52
  excludeDates?: string[],
51
53
  includeDates?: string[],
52
54
  ): boolean {
@@ -1,9 +1,11 @@
1
1
  import type { ConfigType, OptionType } from 'dayjs';
2
- import dayjs, { Dayjs } from 'dayjs';
2
+ import dayjs from 'dayjs';
3
3
  import utc from 'dayjs/plugin/utc.js';
4
4
  import timezone from 'dayjs/plugin/timezone.js';
5
5
  import customParseFormat from 'dayjs/plugin/customParseFormat.js';
6
6
 
7
+ type Dayjs = ReturnType<typeof dayjs>;
8
+
7
9
  dayjs.extend(utc);
8
10
  dayjs.extend(timezone);
9
11
  dayjs.extend(customParseFormat);