@veeqo/ui 6.1.0 → 6.3.0

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.
Files changed (32) hide show
  1. package/dist/components/DateInputField/DateInputField.d.ts +3 -0
  2. package/dist/components/DateInputField/index.d.ts +2 -0
  3. package/dist/components/{DateRangeInput/DateRangeInput.d.ts → DateInputField/types.d.ts} +20 -7
  4. package/dist/components/DateRangePicker/DateRangePicker.d.ts +1 -1
  5. package/dist/components/DateRangePicker/types.d.ts +0 -1
  6. package/dist/components/RangeCalendar/RangeCalendar.d.ts +6 -4
  7. package/dist/components/RangeCalendar/components/CalendarGrid/CalendarGrid.d.ts +10 -0
  8. package/dist/components/RangeCalendar/components/CalendarGrid/index.d.ts +1 -0
  9. package/dist/components/RangeCalendar/components/CalendarGrid/subCalendars/DodecadeCalendar.d.ts +7 -0
  10. package/dist/components/RangeCalendar/components/CalendarGrid/subCalendars/DodecadeCalendar.test.d.ts +1 -0
  11. package/dist/components/RangeCalendar/components/{CalendarGrid.d.ts → CalendarGrid/subCalendars/MonthCalendar.d.ts} +1 -1
  12. package/dist/components/RangeCalendar/components/CalendarGrid/subCalendars/YearCalendar.d.ts +6 -0
  13. package/dist/components/RangeCalendar/components/CalendarGrid/subCalendars/YearCalendar.test.d.ts +1 -0
  14. package/dist/components/RangeCalendar/components/CalendarGrid/subCalendars/index.d.ts +3 -0
  15. package/dist/components/RangeCalendar/components/CalendarGrid/subCalendars/styled.d.ts +1 -0
  16. package/dist/components/RangeCalendar/components/CalendarGrid/subCalendars/utils.d.ts +6 -0
  17. package/dist/components/RangeCalendar/components/CalendarHeader.d.ts +9 -0
  18. package/dist/components/RangeCalendar/components/CalendarHeading.d.ts +7 -0
  19. package/dist/components/RangeCalendar/components/utils.d.ts +6 -0
  20. package/dist/components/RangeCalendar/data/constants.d.ts +4 -0
  21. package/dist/components/RangeCalendar/data/useRangeCalendar.d.ts +14 -0
  22. package/dist/components/RangeCalendar/types.d.ts +5 -0
  23. package/dist/components/index.d.ts +1 -1
  24. package/dist/index.esm.js +1 -1
  25. package/dist/index.esm.js.map +1 -1
  26. package/dist/index.js +1 -1
  27. package/dist/index.js.map +1 -1
  28. package/dist/tempIcons/CalendarIcon.d.ts +1 -1
  29. package/package.json +1 -1
  30. package/dist/components/DateRangeInput/index.d.ts +0 -2
  31. /package/dist/components/{DateRangeInput/DateRangeInput.test.d.ts → DateInputField/DateInputField.test.d.ts} +0 -0
  32. /package/dist/components/{DateRangeInput → DateInputField}/styled.d.ts +0 -0
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { DateInputFieldProps } from './types';
3
+ export declare const DateInputField: ({ id, className, style, shouldForceLeadingZeros, rightAction, minValue, maxvalue, startValue, endValue, isDisabled, isReadOnly, isRangeInput, hasError, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, "aria-labelledby": ariaLabelledBy, onChange, onChangeStartDate, onChangeEndDate, }: DateInputFieldProps) => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const DateInputField: import("react").FC<import("./types").DateInputFieldProps & import("../../hoc/withLabels/withLabels").WithLabelsProps>;
@@ -1,21 +1,34 @@
1
- import React, { CSSProperties } from 'react';
1
+ import { CSSProperties } from 'react';
2
2
  import { DateValue } from 'react-aria-components';
3
- export type DateRangeInputProps = {
3
+ import { ButtonProps } from '../Button/types';
4
+ type DateInputRangeProps = {
5
+ isRangeInput: true;
6
+ onChangeStartDate: (value: DateValue) => void;
7
+ onChangeEndDate: (value: DateValue) => void;
8
+ onChange?: (value: DateValue) => void;
9
+ };
10
+ type DateInputSingleProps = {
11
+ isRangeInput?: false;
12
+ onChange: (value: DateValue) => void;
13
+ onChangeStartDate?: (value: DateValue) => void;
14
+ onChangeEndDate?: (value: DateValue) => void;
15
+ };
16
+ export type DateInputFieldProps = {
4
17
  id?: string;
5
18
  className?: string;
6
19
  style?: CSSProperties;
7
20
  shouldForceLeadingZeros?: boolean;
8
- hasError?: boolean;
21
+ rightAction?: ButtonProps;
9
22
  startValue?: DateValue | null;
10
23
  endValue?: DateValue | null;
11
24
  minValue?: DateValue;
12
25
  maxvalue?: DateValue;
13
26
  isDisabled?: boolean;
14
27
  isReadOnly?: boolean;
28
+ isRangeInput?: boolean;
29
+ hasError?: boolean;
15
30
  'aria-label'?: string;
16
31
  'aria-labelledby'?: string;
17
32
  'aria-describedby'?: string;
18
- onChangeStartDate: (value: DateValue) => void;
19
- onChangeEndDate: (value: DateValue) => void;
20
- };
21
- export declare const DateRangeInput: ({ id, className, style, shouldForceLeadingZeros, hasError, minValue, maxvalue, startValue, endValue, isDisabled, isReadOnly, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, "aria-labelledby": ariaLabelledBy, onChangeStartDate, onChangeEndDate, }: DateRangeInputProps) => React.JSX.Element;
33
+ } & (DateInputRangeProps | DateInputSingleProps);
34
+ export {};
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
2
  import { DateRangePickerProps } from './types';
3
- export declare const DateRangePicker: ({ className, style, isDisabled, isMultiMonth, showDatePresets, onReset, disabledRanges, selectedPreset, setSelectedPreset, selectedRange, setSelectedRange, "aria-describedby": ariaDescribedBy, "aria-label": ariaLabel, ...previousPeriodProps }: DateRangePickerProps) => React.JSX.Element;
3
+ export declare const DateRangePicker: ({ className, style, isDisabled, showDatePresets, onReset, disabledRanges, selectedPreset, setSelectedPreset, selectedRange, setSelectedRange, "aria-describedby": ariaDescribedBy, "aria-label": ariaLabel, ...previousPeriodProps }: DateRangePickerProps) => React.JSX.Element;
@@ -7,7 +7,6 @@ export type DateRangePickerProps = {
7
7
  style?: CSSProperties;
8
8
  className?: string;
9
9
  isDisabled?: boolean;
10
- isMultiMonth?: boolean;
11
10
  showDatePresets?: boolean;
12
11
  onReset?: () => void;
13
12
  disabledRanges?: CalendarDate[][];
@@ -1,10 +1,12 @@
1
1
  import React from 'react';
2
+ import type { DateRange, DateValue, RangeCalendarProps } from 'react-aria-components';
2
3
  import { CalendarDate } from '@internationalized/date';
3
- import type { DateValue, RangeCalendarProps } from 'react-aria-components';
4
- export type CalendarProps = RangeCalendarProps<DateValue> & React.RefAttributes<HTMLDivElement> & {
4
+ export type CalendarProps = RangeCalendarProps<DateValue> & {
5
+ value: DateRange | null | undefined;
6
+ onChange?: RangeCalendarProps<DateValue>['onChange'];
7
+ } & React.RefAttributes<HTMLDivElement> & {
5
8
  'aria-label': string;
6
- isMultiMonth?: boolean;
7
9
  disabledRanges?: CalendarDate[][];
8
10
  disallowWeekends?: boolean;
9
11
  };
10
- export declare const RangeCalendar: ({ disabledRanges, disallowWeekends, isMultiMonth, ...props }: CalendarProps) => React.JSX.Element;
12
+ export declare const RangeCalendar: ({ disabledRanges, disallowWeekends, value, onChange, ...props }: CalendarProps) => React.JSX.Element;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { CalendarLevel } from '../../types';
3
+ type CalendarGridProps = {
4
+ level: CalendarLevel;
5
+ currentYear: number;
6
+ onFocusYear: (year: number) => () => void;
7
+ onFocusMonth: (month: number) => () => void;
8
+ };
9
+ export declare const CalendarGrid: ({ level, currentYear, onFocusMonth, onFocusYear, }: CalendarGridProps) => React.JSX.Element;
10
+ export {};
@@ -0,0 +1 @@
1
+ export { CalendarGrid } from './CalendarGrid';
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ type DodecadeCalendarProps = {
3
+ currentYear: number;
4
+ onFocusYear: (year: number) => () => void;
5
+ };
6
+ export declare const DodecadeCalendar: ({ currentYear, onFocusYear }: DodecadeCalendarProps) => React.JSX.Element;
7
+ export {};
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
2
  import { CalendarGridProps } from 'react-aria-components';
3
- export declare const CalendarGrid: (props: CalendarGridProps) => React.JSX.Element;
3
+ export declare const MonthCalendar: (props: CalendarGridProps) => React.JSX.Element;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ type MonthCalendarProps = {
3
+ onFocusMonth: (monthIndex: number) => () => void;
4
+ };
5
+ export declare const YearCalendar: ({ onFocusMonth }: MonthCalendarProps) => React.JSX.Element;
6
+ export {};
@@ -0,0 +1,3 @@
1
+ export { DodecadeCalendar } from './DodecadeCalendar';
2
+ export { YearCalendar } from './YearCalendar';
3
+ export { MonthCalendar } from './MonthCalendar';
@@ -0,0 +1 @@
1
+ export declare const SubCalendarOption: import("styled-components").StyledComponent<"button", any, {}, never>;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Gets a range of years around a given year.
3
+ * @param year The year to get the range around.
4
+ * @returns An array of years around the given year.
5
+ */
6
+ export declare const getYearsAround: (year: number) => number[];
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { CalendarLevel } from '../types';
3
+ type CalendarHeaderProps = {
4
+ level: CalendarLevel;
5
+ currentYear: number;
6
+ handleSwitchLevel: () => void;
7
+ };
8
+ export declare const CalendarHeader: ({ level, currentYear, handleSwitchLevel }: CalendarHeaderProps) => React.JSX.Element;
9
+ export {};
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import type { HeadingProps } from 'react-aria-components';
3
+ import { CalendarLevel } from '../types';
4
+ export declare const CalendarHeading: React.ForwardRefExoticComponent<HeadingProps & {
5
+ level: CalendarLevel;
6
+ currentYear: number;
7
+ } & React.RefAttributes<HTMLHeadingElement>>;
@@ -1,2 +1,8 @@
1
1
  import type { TextStyles } from '../../../theme/modules/text';
2
2
  export declare const getTextStyles: (textTheme: TextStyles) => string;
3
+ /**
4
+ * Replaces all words with the first three letter of that word. All numbers are left alone.
5
+ *
6
+ * @example "January 2023" => "Jan 2023"
7
+ */
8
+ export declare const trimMonths: (dateString: string) => string;
@@ -0,0 +1,4 @@
1
+ import { DateDuration } from '@internationalized/date';
2
+ import { CalendarLevel } from '../types';
3
+ export declare const visibleDurationMap: Record<CalendarLevel, DateDuration>;
4
+ export declare const levelMoveLabelMap: Record<CalendarLevel, string>;
@@ -0,0 +1,14 @@
1
+ /// <reference types="react" />
2
+ import { CalendarDate } from '@internationalized/date';
3
+ import { DateRange, DateValue } from 'react-aria-components';
4
+ import { CalendarLevel } from '../types';
5
+ export declare const useRangeCalendarState: (initialValue: DateRange | null | undefined, disabledRanges: CalendarDate[][], disallowWeekends: boolean) => {
6
+ level: CalendarLevel;
7
+ focusedDate: CalendarDate | import("@internationalized/date").CalendarDateTime | import("@internationalized/date").ZonedDateTime;
8
+ setFocusedDate: import("react").Dispatch<import("react").SetStateAction<CalendarDate | import("@internationalized/date").CalendarDateTime | import("@internationalized/date").ZonedDateTime>>;
9
+ currentYear: number;
10
+ isDateUnavailable: (date: DateValue) => boolean;
11
+ onFocusMonth: (monthIndex: number) => () => void;
12
+ onFocusYear: (year: number) => () => void;
13
+ handleSwitchLevel: () => void;
14
+ };
@@ -0,0 +1,5 @@
1
+ export declare enum CalendarLevel {
2
+ DODECADE = 0,
3
+ YEAR = 1,
4
+ MONTH = 2
5
+ }
@@ -16,7 +16,7 @@ export { Checkbox } from './Checkbox';
16
16
  export { Choice } from './Choice';
17
17
  export { ChoiceList } from './ChoiceList';
18
18
  export { CopyToClipboard } from './CopyToClipboard';
19
- export { DateRangeInput } from './DateRangeInput';
19
+ export { DateInputField } from './DateInputField';
20
20
  export { DateRangePicker, DATE_RANGE_OPTIONS, DEFAULT_PRESET, DEFAULT_RANGE, DateRanges, checkIfDateRangeInvalid, getDateRange, } from './DateRangePicker';
21
21
  export { DataTable, useCellWidths, useColumns, useDragToScroll, useNested, useScrollPosition, useSelection, } from './DataTable';
22
22
  export { DescriptionList } from './DescriptionList';