@mindly/ui-components 8.5.1 → 8.5.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,11 +1,15 @@
1
- import { SupportedLocales } from '../types';
2
- type CalendarListProps = {
3
- locale?: SupportedLocales;
4
- lastDate: Date;
5
- };
6
- type CalendarListItem = {
7
- value: Date;
1
+ type SelectionItem<T extends string | number> = {
8
2
  label: string;
3
+ value: T;
4
+ };
5
+ type CalendarSelections = {
6
+ day: SelectionItem<number>[];
7
+ month: SelectionItem<string>[];
8
+ year: SelectionItem<number>[];
9
+ };
10
+ type CalendarListProps = {
11
+ locale?: string;
12
+ lastDate?: Date;
9
13
  };
10
- export declare function useCalendarListData({ locale, lastDate, }: CalendarListProps): CalendarListItem[];
14
+ export declare function useCalendarListData({ locale, lastDate, }: CalendarListProps): CalendarSelections;
11
15
  export {};
@@ -10,7 +10,12 @@ type DatesResultType = {
10
10
  isFutureMonth: boolean;
11
11
  };
12
12
  export declare function getDatePosition(calendarDate: Date): DatesResultType;
13
- export declare function getSelectedFormattedDate(date: Date, locale?: string): string;
13
+ type CalendarDefaults = {
14
+ day: string;
15
+ month: string;
16
+ year: string;
17
+ };
18
+ export declare function getSelectedFormattedDate(selectedDate: Date | null | undefined, locale?: string): CalendarDefaults;
14
19
  type FormattedDateProps = {
15
20
  date: Date;
16
21
  locale?: SupportedLocales;
@@ -7,9 +7,10 @@ type Props = {
7
7
  height?: number;
8
8
  selections: Record<string, SelectionType[]>;
9
9
  defaults?: Record<string, string>;
10
- onChange(value: Record<string, SelectionType>): void;
10
+ onChange(value: Record<string, string>): void;
11
11
  className?: string;
12
12
  compareBy?: 'value' | 'label';
13
+ presentation?: 'date' | 'month' | 'month-year';
13
14
  };
14
- declare const DrumListPicker: ({ height, selections, defaults, onChange, className, compareBy, }: Props) => import("react/jsx-runtime").JSX.Element;
15
+ declare const DrumListPicker: ({ height, selections, defaults, onChange, className, compareBy, presentation, }: Props) => import("react/jsx-runtime").JSX.Element;
15
16
  export default DrumListPicker;
package/dist/index.d.ts CHANGED
@@ -1798,11 +1798,12 @@ type Props$9 = {
1798
1798
  height?: number;
1799
1799
  selections: Record<string, SelectionType$1[]>;
1800
1800
  defaults?: Record<string, string>;
1801
- onChange(value: Record<string, SelectionType$1>): void;
1801
+ onChange(value: Record<string, string>): void;
1802
1802
  className?: string;
1803
1803
  compareBy?: 'value' | 'label';
1804
+ presentation?: 'date' | 'month' | 'month-year';
1804
1805
  };
1805
- declare const DrumListPicker: ({ height, selections, defaults, onChange, className, compareBy, }: Props$9) => react_jsx_runtime.JSX.Element;
1806
+ declare const DrumListPicker: ({ height, selections, defaults, onChange, className, compareBy, presentation, }: Props$9) => react_jsx_runtime.JSX.Element;
1806
1807
 
1807
1808
  type FontWeight = 'Regular' | 'Semi' | 'Bold';
1808
1809
  type CollapsableTextProps = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mindly/ui-components",
3
- "version": "8.5.1",
3
+ "version": "8.5.2",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "clean": "rimraf dist",