@flightlesslabs/dodo-ui 0.16.0 → 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.
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/stories/Home.mdx +12 -0
- package/dist/stories/components/Info/Calendar/utils/createDateOfMonth/createDateOfMonth.js +1 -0
- package/dist/stories/developer tools/helpers/Time/getMoment/getMoment.d.ts +3 -1
- package/dist/stories/developer tools/helpers/Time/getMoment/getMoment.js +1 -1
- package/package.json +6 -3
- package/src/lib/index.ts +0 -2
- package/src/lib/stories/components/Info/Calendar/utils/createDateOfMonth/createDateOfMonth.ts +7 -5
- package/src/lib/stories/developer tools/helpers/Time/getMoment/getMoment.ts +3 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/stories/Home.mdx
CHANGED
|
@@ -40,6 +40,18 @@ npm i @flightlesslabs/dodo-ui
|
|
|
40
40
|
`}
|
|
41
41
|
/>
|
|
42
42
|
|
|
43
|
+
## Add css
|
|
44
|
+
|
|
45
|
+
Add global css in your `+layout.svelte` file
|
|
46
|
+
|
|
47
|
+
<Source
|
|
48
|
+
dark
|
|
49
|
+
language="js"
|
|
50
|
+
code={`
|
|
51
|
+
import '@flightlesslabs/dodo-ui/styles/global.css';
|
|
52
|
+
`}
|
|
53
|
+
/>
|
|
54
|
+
|
|
43
55
|
## Use it!
|
|
44
56
|
|
|
45
57
|
Lets import [Button](?path=/docs/components-form-button--docs) component. Checkout documentation for [Button](?path=/docs/components-form-button--docs)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ConfigType, OptionType } from 'dayjs';
|
|
2
|
-
import
|
|
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 {};
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flightlesslabs/dodo-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0-beta-2",
|
|
4
4
|
"scripts": {
|
|
5
|
-
"
|
|
5
|
+
"copy-css": "cpy src/lib/styles/global.css dist/styles --parents",
|
|
6
|
+
"build": "vite build && pnpm copy-css && pnpm run prepack",
|
|
6
7
|
"preview": "vite preview",
|
|
7
8
|
"prepare": "svelte-kit sync || echo ''",
|
|
8
9
|
"prepack": "svelte-kit sync && svelte-package && publint",
|
|
@@ -44,7 +45,8 @@
|
|
|
44
45
|
"types": "./dist/index.d.ts",
|
|
45
46
|
"svelte": "./dist/index.js",
|
|
46
47
|
"scss": "./dist/styles/scss/index.scss"
|
|
47
|
-
}
|
|
48
|
+
},
|
|
49
|
+
"./styles/global.css": "./dist/styles/global.css"
|
|
48
50
|
},
|
|
49
51
|
"peerDependencies": {
|
|
50
52
|
"svelte": "^5.0.0"
|
|
@@ -64,6 +66,7 @@
|
|
|
64
66
|
"@vitest/browser": "^3.2.4",
|
|
65
67
|
"@vitest/coverage-v8": "^3.2.4",
|
|
66
68
|
"@vueless/storybook-dark-mode": "^9.0.6",
|
|
69
|
+
"cpy-cli": "^5.0.0",
|
|
67
70
|
"eslint": "^9.32.0",
|
|
68
71
|
"eslint-config-prettier": "^10.1.8",
|
|
69
72
|
"eslint-plugin-storybook": "9.0.18",
|
package/src/lib/index.ts
CHANGED
package/src/lib/stories/components/Info/Calendar/utils/createDateOfMonth/createDateOfMonth.ts
CHANGED
|
@@ -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:
|
|
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:
|
|
48
|
-
minDate?:
|
|
49
|
-
maxDate?:
|
|
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
|
|
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);
|