@flightlesslabs/dodo-ui 0.17.0-beta → 0.17.1

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.
@@ -2,7 +2,7 @@
2
2
  </script>
3
3
 
4
4
  <script lang="ts">"use strict";
5
- let { children, type = 'button', size = 'normal', color = 'primary', roundness = 1, variant = 'solid', outline = false, compact = false, fullWidth = false, name, id, title, class: className = '', disabled = false, onclick, before, after, href, download, hreflang, media, ping, rel, target, anchorMediaType, referrerpolicy, ref = $bindable(), } = $props();
5
+ let { children, type = 'button', size = 'normal', color = 'primary', roundness = 1, variant = 'solid', outline = false, compact = false, fullWidth = false, name, id, title, class: className = '', disabled = false, onclick, before, after, 'aria-label': ariaLabel, href, download, hreflang, media, ping, rel, target, anchorMediaType, referrerpolicy, ref = $bindable(), } = $props();
6
6
  </script>
7
7
 
8
8
  {#snippet buttonContent()}
@@ -36,6 +36,7 @@ let { children, type = 'button', size = 'normal', color = 'primary', roundness =
36
36
  {target}
37
37
  type={anchorMediaType}
38
38
  {referrerpolicy}
39
+ aria-label={ariaLabel}
39
40
  class:outline
40
41
  class:compact
41
42
  class:disabled
@@ -57,6 +58,7 @@ let { children, type = 'button', size = 'normal', color = 'primary', roundness =
57
58
  class:outline
58
59
  class:compact
59
60
  class:fullWidth
61
+ aria-label={ariaLabel}
60
62
  class={[
61
63
  'dodo-ui-Button',
62
64
  `size--${size}`,
@@ -48,6 +48,8 @@ export interface ButtonProps {
48
48
  class?: string;
49
49
  /** The onclick event handler */
50
50
  onclick?: MouseEventHandler<HTMLButtonElement>;
51
+ /** Aria label */
52
+ 'aria-label'?: string;
51
53
  /** Turn Button into link */
52
54
  href?: string;
53
55
  /** Link button: download */
@@ -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.1",
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",
@@ -52,15 +52,15 @@
52
52
  "svelte": "^5.0.0"
53
53
  },
54
54
  "devDependencies": {
55
- "@chromatic-com/storybook": "4.0.1",
55
+ "@chromatic-com/storybook": "4.1.0",
56
56
  "@eslint/compat": "^1.3.1",
57
57
  "@eslint/js": "^9.32.0",
58
- "@storybook/addon-docs": "^9.0.18",
58
+ "@storybook/addon-docs": "^9.1.1",
59
59
  "@storybook/addon-svelte-csf": "5.0.7",
60
- "@storybook/addon-vitest": "^9.0.18",
61
- "@storybook/sveltekit": "^9.0.18",
60
+ "@storybook/addon-vitest": "^9.1.1",
61
+ "@storybook/sveltekit": "^9.1.1",
62
62
  "@sveltejs/adapter-static": "^3.0.8",
63
- "@sveltejs/kit": "^2.26.1",
63
+ "@sveltejs/kit": "^2.27.0",
64
64
  "@sveltejs/package": "^2.4.0",
65
65
  "@sveltejs/vite-plugin-svelte": "^6.1.0",
66
66
  "@vitest/browser": "^3.2.4",
@@ -69,20 +69,20 @@
69
69
  "cpy-cli": "^5.0.0",
70
70
  "eslint": "^9.32.0",
71
71
  "eslint-config-prettier": "^10.1.8",
72
- "eslint-plugin-storybook": "9.0.18",
72
+ "eslint-plugin-storybook": "9.1.1",
73
73
  "eslint-plugin-svelte": "^3.11.0",
74
74
  "globals": "^16.3.0",
75
- "playwright": "^1.54.1",
75
+ "playwright": "^1.54.2",
76
76
  "prettier": "^3.6.2",
77
77
  "prettier-plugin-svelte": "^3.4.0",
78
78
  "publint": "^0.3.12",
79
79
  "sass": "^1.89.2",
80
- "storybook": "^9.0.18",
81
- "svelte": "^5.37.1",
82
- "svelte-check": "^4.3.0",
80
+ "storybook": "^9.1.1",
81
+ "svelte": "^5.37.3",
82
+ "svelte-check": "^4.3.1",
83
83
  "svelte-preprocess": "^6.0.3",
84
- "typescript": "^5.8.3",
85
- "typescript-eslint": "^8.38.0",
84
+ "typescript": "^5.9.2",
85
+ "typescript-eslint": "^8.39.0",
86
86
  "vite": "^7.0.6",
87
87
  "vitest": "^3.2.4"
88
88
  },
@@ -60,6 +60,8 @@
60
60
  class?: string;
61
61
  /** The onclick event handler */
62
62
  onclick?: MouseEventHandler<HTMLButtonElement>;
63
+ /** Aria label */
64
+ 'aria-label'?: string;
63
65
  /** Turn Button into link */
64
66
  href?: string;
65
67
  /** Link button: download */
@@ -101,6 +103,7 @@
101
103
  onclick,
102
104
  before,
103
105
  after,
106
+ 'aria-label': ariaLabel,
104
107
  href,
105
108
  download,
106
109
  hreflang,
@@ -145,6 +148,7 @@
145
148
  {target}
146
149
  type={anchorMediaType}
147
150
  {referrerpolicy}
151
+ aria-label={ariaLabel}
148
152
  class:outline
149
153
  class:compact
150
154
  class:disabled
@@ -166,6 +170,7 @@
166
170
  class:outline
167
171
  class:compact
168
172
  class:fullWidth
173
+ aria-label={ariaLabel}
169
174
  class={[
170
175
  'dodo-ui-Button',
171
176
  `size--${size}`,
@@ -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);