@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 CHANGED
@@ -1,4 +1,3 @@
1
- import './styles/global.css';
2
1
  export type { ComponentColorPriority, ComponentColorSeverity, ComponentColor, } from './types/colors.js';
3
2
  export type { ComponentRoundness } from './types/roundness.js';
4
3
  export type { ComponentSize } from './types/size.js';
package/dist/index.js CHANGED
@@ -1,4 +1,3 @@
1
- import './styles/global.css';
2
1
  /** developer tools: helpers: logger */
3
2
  export { default as createLogger } from './stories/developer tools/helpers/logger/logger.js';
4
3
  /** developer tools: helpers: Numbers: isValidNumberValue */
@@ -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,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,8 +1,9 @@
1
1
  {
2
2
  "name": "@flightlesslabs/dodo-ui",
3
- "version": "0.16.0",
3
+ "version": "0.17.0-beta-2",
4
4
  "scripts": {
5
- "build": "vite build && pnpm run prepack",
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
@@ -1,5 +1,3 @@
1
- import '$lib/styles/global.css';
2
-
3
1
  export type {
4
2
  ComponentColorPriority,
5
3
  ComponentColorSeverity,
@@ -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);