@veeqo/ui 5.8.0 → 5.9.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.
@@ -0,0 +1,3 @@
1
+ import React from 'react';
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;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { SelectOption } from '../../Select/Select';
3
+ export type ComparePreviousPeriodProps = {
4
+ options?: SelectOption[];
5
+ selectedPreviousPeriod: SelectOption | null;
6
+ setSelectedPreviousPeriod: (selected: SelectOption | null) => void;
7
+ };
8
+ export declare const ComparePreviousPeriod: ({ options, selectedPreviousPeriod, setSelectedPreviousPeriod, }: ComparePreviousPeriodProps) => React.JSX.Element;
@@ -0,0 +1 @@
1
+ export declare const Divider: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -0,0 +1,4 @@
1
+ export declare const DEFAULT_PREVIOUS_PERIOD_OPTIONS: {
2
+ label: string;
3
+ value: string;
4
+ }[];
@@ -0,0 +1,25 @@
1
+ import { CalendarDate } from '@internationalized/date';
2
+ import { DateRange } from 'react-aria-components';
3
+ import { SelectOption } from '../Select/Select';
4
+ export declare enum DateRanges {
5
+ TODAY = "TODAY",
6
+ YESTERDAY = "YESTERDAY",
7
+ LAST_7_DAYS = "LAST_7_DAYS",
8
+ LAST_30_DAYS = "LAST_30_DAYS",
9
+ LAST_90_DAYS = "LAST_90_DAYS",
10
+ LAST_MONTH = "LAST_MONTH",
11
+ LAST_12_MONTHS = "LAST_12_MONTHS",
12
+ WEEK_TO_DATE = "WEEK_TO_DATE",
13
+ MONTH_TO_DATE = "MONTH_TO_DATE",
14
+ YEAR_TO_DATE = "YEAR_TO_DATE"
15
+ }
16
+ export declare const timeRangeToDateRange: (range: DateRange) => {
17
+ start: CalendarDate;
18
+ end: CalendarDate;
19
+ };
20
+ export declare const getDateRange: (option: DateRanges) => DateRange | null;
21
+ export declare const DATE_RANGE_OPTIONS: SelectOption[];
22
+ export declare const checkForMatchingPreset: (selectedRange: DateRange) => SelectOption | undefined;
23
+ export declare const DEFAULT_SELECTION = DateRanges.LAST_30_DAYS;
24
+ export declare const DEFAULT_RANGE: DateRange | null;
25
+ export declare const DEFAULT_PRESET: SelectOption;
@@ -0,0 +1,2 @@
1
+ export { DateRangePicker } from './DateRangePicker';
2
+ export { checkIfDateRangeInvalid } from './utils';
@@ -0,0 +1,37 @@
1
+ import { CSSProperties } from 'react';
2
+ import type { DateRange } from 'react-aria-components';
3
+ import { CalendarDate } from '@internationalized/date';
4
+ import { ComparePreviousPeriodProps } from './components/ComparePreviousPeriod';
5
+ import { SelectOption } from '../Select/Select';
6
+ export type DateRangePickerProps = {
7
+ style?: CSSProperties;
8
+ className?: string;
9
+ isDisabled?: boolean;
10
+ isMultiMonth?: boolean;
11
+ showDatePresets?: boolean;
12
+ onReset?: () => void;
13
+ disabledRanges?: CalendarDate[][];
14
+ selectedPreset: SelectOption;
15
+ setSelectedPreset: (selected: SelectOption) => void;
16
+ selectedRange: DateRange | null;
17
+ setSelectedRange: (selected: DateRange | null) => void;
18
+ } & PreviousPeriodProps & RequiredLabel;
19
+ type RequiredLabel = {
20
+ 'aria-describedby': string;
21
+ 'aria-label'?: string;
22
+ } | {
23
+ 'aria-describedby'?: string;
24
+ 'aria-label': string;
25
+ };
26
+ type PreviousPeriodProps = {
27
+ showPreviousPeriod: true;
28
+ previousPeriodOptions?: ComparePreviousPeriodProps['options'];
29
+ selectedPreviousPeriod: ComparePreviousPeriodProps['selectedPreviousPeriod'];
30
+ setSelectedPreviousPeriod: ComparePreviousPeriodProps['setSelectedPreviousPeriod'];
31
+ } | {
32
+ showPreviousPeriod?: false;
33
+ previousPeriodOptions?: ComparePreviousPeriodProps['options'];
34
+ selectedPreviousPeriod?: ComparePreviousPeriodProps['selectedPreviousPeriod'];
35
+ setSelectedPreviousPeriod?: ComparePreviousPeriodProps['setSelectedPreviousPeriod'];
36
+ };
37
+ export {};
@@ -0,0 +1,6 @@
1
+ import { CalendarDate } from '@internationalized/date';
2
+ import { DateRange } from 'react-aria-components';
3
+ export declare const checkIfDateRangeInvalid: ({ disabledRanges, selectedRange, }: {
4
+ disabledRanges?: CalendarDate[][] | undefined;
5
+ selectedRange: DateRange | null;
6
+ }) => boolean;
@@ -0,0 +1 @@
1
+ export {};
@@ -19,12 +19,12 @@ type DefaultHeaderOptions = {
19
19
  headerTitle: string;
20
20
  headerSubtitle?: string;
21
21
  };
22
- type ModalAction = {
22
+ export type Action = {
23
23
  label: string;
24
24
  } & ButtonProps;
25
25
  type DefaultFooterOptions = {
26
- leftActions?: ModalAction[];
27
- rightActions?: ModalAction[];
26
+ leftActions?: Action[];
27
+ rightActions?: Action[];
28
28
  };
29
29
  type HeaderOptions = WithHeaderSlot | DefaultHeaderOptions;
30
30
  type FooterOptions = WithFooterSlot | DefaultFooterOptions;
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
2
  import { PopoverProps } from './types';
3
- export declare const Popover: ({ id: passedId, children, zIndex, placement, anchorElement, rootElementRef, onShouldClose, style, disableFocusLock, removeBackdrop, ...dialogProps }: PopoverProps) => React.JSX.Element;
3
+ export declare const Popover: ({ id: passedId, children, zIndex, placement, anchorElement, rootElementRef, onShouldClose, style, disableFocusLock, removeBackdrop, useAnchorWidth, ...dialogProps }: PopoverProps) => React.JSX.Element;
@@ -5,6 +5,7 @@ export type PopoverProps = DialogHTMLAttributes<HTMLDialogElement> & {
5
5
  zIndex?: number;
6
6
  placement?: Placement;
7
7
  anchorElement: HTMLElement | null;
8
+ useAnchorWidth?: boolean;
8
9
  rootElementRef?: HTMLElement;
9
10
  /**
10
11
  * Will disable the focus lock if set to true, use only if taking manual control of focus.
@@ -1,11 +1,10 @@
1
1
  import React from 'react';
2
2
  import { CalendarDate } from '@internationalized/date';
3
3
  import type { DateValue, RangeCalendarProps } from 'react-aria-components';
4
- type CalendarProps = RangeCalendarProps<DateValue> & React.RefAttributes<HTMLDivElement> & {
4
+ export type CalendarProps = RangeCalendarProps<DateValue> & React.RefAttributes<HTMLDivElement> & {
5
5
  'aria-label': string;
6
6
  isMultiMonth?: boolean;
7
7
  disabledRanges?: CalendarDate[][];
8
8
  disallowWeekends?: boolean;
9
9
  };
10
10
  export declare const RangeCalendar: ({ disabledRanges, disallowWeekends, isMultiMonth, ...props }: CalendarProps) => React.JSX.Element;
11
- export {};
@@ -1,8 +1,9 @@
1
1
  import React from 'react';
2
- type SelectOption = {
2
+ export type SelectOption = {
3
3
  label: string;
4
4
  value: string;
5
5
  disabled?: boolean;
6
+ hidden?: boolean;
6
7
  };
7
8
  export interface SelectProps {
8
9
  id?: string;
@@ -15,4 +16,3 @@ export interface SelectProps {
15
16
  onChange?: (value: string) => void;
16
17
  }
17
18
  export declare const Select: React.FC<SelectProps & React.RefAttributes<HTMLSelectElement> & import("../../hoc/withLabels/withLabels").WithLabelsProps>;
18
- export {};
@@ -4,7 +4,7 @@ declare const Slider: import("styled-components").StyledComponent<"span", any, {
4
4
  disabled?: boolean | undefined;
5
5
  }, never>;
6
6
  declare const Input: import("styled-components").StyledComponent<"input", any, {}, never>;
7
- declare const Switch: import("styled-components").StyledComponent<"label", any, ToggleProps, never>;
7
+ declare const Switch: import("styled-components").StyledComponent<"span", any, ToggleProps, never>;
8
8
  declare const Wrapper: import("styled-components").StyledComponent<"div", any, {
9
9
  disabled?: boolean | undefined;
10
10
  }, never>;
@@ -16,6 +16,7 @@ export { Choice } from './Choice';
16
16
  export { ChoiceList } from './ChoiceList';
17
17
  export { CopyToClipboard } from './CopyToClipboard';
18
18
  export { DateRangeInput } from './DateRangeInput';
19
+ export { DateRangePicker, checkIfDateRangeInvalid } from './DateRangePicker';
19
20
  export { DataTable, useCellWidths, useColumns, useDragToScroll, useNested, useScrollPosition, useSelection, } from './DataTable';
20
21
  export { DescriptionList } from './DescriptionList';
21
22
  export { DetailPage } from './DetailPage';