@zonos/amino 5.1.38 → 5.1.40
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/components/button/RippleGroup.d.ts +3 -3
- package/components/button/useRipple.d.ts +5 -5
- package/components/connection-map/ConnectionMap.d.ts +4 -4
- package/components/filter/filter-date/FilterDate.d.ts +2 -2
- package/components/filter/filter-multi-select/FilterMultiSelect.d.ts +4 -4
- package/components/filter/filter-select/FilterSelect.d.ts +3 -3
- package/components/select/CountryMultiSelect.d.ts +8 -8
- package/components/select/CountryPhoneSelect.d.ts +8 -8
- package/components/select/CountrySelect.d.ts +5 -5
- package/components/select/MultiSelect.d.ts +6 -6
- package/components/select/Select.d.ts +4 -4
- package/components/select/_StyledReactSelect.d.ts +5 -5
- package/components/sortable-list/SortableList.d.ts +2 -2
- package/components/sortable-list/SortableListItem.d.ts +2 -2
- package/components/split-panel/SplitPanel.d.ts +2 -2
- package/components/stack/Stack.d.ts +2 -2
- package/components/tag/Tag.d.ts +2 -2
- package/icons/flag-icon/FlagIcon.d.ts +6 -6
- package/package.json +1 -1
- package/types/BaseProps.d.ts +2 -2
- package/types/{ICountry.d.ts → Country.d.ts} +16 -16
- package/types/FetcherError.d.ts +2 -2
- package/types/{IGeoJsonWorld.d.ts → GeoJsonWorld.d.ts} +5 -5
- package/types/JsonError.d.ts +2 -2
- package/types/{IOption.d.ts → SelectOption.d.ts} +2 -2
- package/types/SwrtParams.d.ts +2 -2
- package/utils/_graphiqlFetcher.d.ts +2 -2
- package/utils/getCountryCodeByName.d.ts +2 -2
- package/utils/prepCountryOptions.d.ts +2 -2
- package/utils/prepRegionCountryOptions.d.ts +3 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { Color } from "../../types";
|
|
3
|
-
export
|
|
3
|
+
export type RippleActions = {
|
|
4
4
|
start: (event: React.SyntheticEvent) => void;
|
|
5
|
-
}
|
|
5
|
+
};
|
|
6
6
|
export type RippleGroupProps = {
|
|
7
7
|
/**
|
|
8
8
|
* @default 'inherit'
|
|
@@ -17,4 +17,4 @@ export type RippleGroupProps = {
|
|
|
17
17
|
*/
|
|
18
18
|
opacity?: number;
|
|
19
19
|
};
|
|
20
|
-
export declare const RippleGroup: React.ForwardRefExoticComponent<RippleGroupProps & React.RefAttributes<
|
|
20
|
+
export declare const RippleGroup: React.ForwardRefExoticComponent<RippleGroupProps & React.RefAttributes<RippleActions>>;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
|
|
2
|
+
import type { RippleActions } from "./RippleGroup";
|
|
3
|
+
type RippleEventHandlers = {
|
|
4
4
|
onMouseDown: React.MouseEventHandler;
|
|
5
|
-
}
|
|
5
|
+
};
|
|
6
6
|
type Props = {
|
|
7
7
|
disabled: boolean;
|
|
8
8
|
rippleEnabled: boolean;
|
|
9
|
-
rippleRef: React.RefObject<
|
|
9
|
+
rippleRef: React.RefObject<RippleActions>;
|
|
10
10
|
};
|
|
11
11
|
type Return = {
|
|
12
12
|
/** Combines event handlers */
|
|
13
|
-
getRippleHandlers(otherEvents: Partial<
|
|
13
|
+
getRippleHandlers(otherEvents: Partial<RippleEventHandlers>): RippleEventHandlers;
|
|
14
14
|
rippleEnabled: boolean;
|
|
15
15
|
};
|
|
16
16
|
export declare const useRipple: ({ disabled, rippleEnabled, rippleRef, }: Props) => Return;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { BaseProps } from "../../types/BaseProps";
|
|
2
|
-
import { type
|
|
3
|
-
import { type
|
|
2
|
+
import { type CountryOption } from "../../types/Country";
|
|
3
|
+
import { type GeoJsonWorld } from "../../types/GeoJsonWorld";
|
|
4
4
|
type Props = BaseProps & {
|
|
5
|
-
countries:
|
|
5
|
+
countries: CountryOption[];
|
|
6
6
|
from: string;
|
|
7
7
|
height?: number;
|
|
8
8
|
to: string;
|
|
9
|
-
worldData:
|
|
9
|
+
worldData: GeoJsonWorld | null;
|
|
10
10
|
};
|
|
11
11
|
export declare const ConnectionMap: ({ className, countries, from, height, to, worldData, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
export {};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { type Dispatch } from 'react';
|
|
2
2
|
import { type FilterDateAction, type FilterDateState } from "./filterDateReducer";
|
|
3
3
|
import { type BaseFilterProps } from "../useFilterWrapper";
|
|
4
|
-
type
|
|
4
|
+
type BadgeFilterDateProps = BaseFilterProps & {
|
|
5
5
|
dispatch: Dispatch<FilterDateAction>;
|
|
6
6
|
filter: FilterDateState;
|
|
7
7
|
};
|
|
8
8
|
/**
|
|
9
9
|
* Assumes exclusive date range. Specific formats/ranges should be handled upstream.
|
|
10
10
|
*/
|
|
11
|
-
export declare const FilterDate: ({ dispatch, dropdownTitle, filter, label, }:
|
|
11
|
+
export declare const FilterDate: ({ dispatch, dropdownTitle, filter, label, }: BadgeFilterDateProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type BaseFilterProps } from "../useFilterWrapper";
|
|
2
|
-
import type {
|
|
2
|
+
import type { SelectOption } from "../../../types/SelectOption";
|
|
3
3
|
type FilterMultiSelectProps<T extends string = string> = BaseFilterProps & {
|
|
4
|
-
options:
|
|
5
|
-
value:
|
|
6
|
-
onChange: (value:
|
|
4
|
+
options: SelectOption<T>[];
|
|
5
|
+
value: SelectOption<T>[];
|
|
6
|
+
onChange: (value: SelectOption<T>[]) => void;
|
|
7
7
|
};
|
|
8
8
|
export declare const FilterMultiSelect: <T extends string = string>({ dropdownTitle, label, onChange, options, value, }: FilterMultiSelectProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type BaseFilterProps } from "../useFilterWrapper";
|
|
2
|
-
import type {
|
|
3
|
-
type FilterSelectProps<T extends string = string, O extends
|
|
2
|
+
import type { SelectOption } from "../../../types/SelectOption";
|
|
3
|
+
type FilterSelectProps<T extends string = string, O extends SelectOption<string> = SelectOption<T>> = BaseFilterProps & {
|
|
4
4
|
options: O[];
|
|
5
5
|
value: O | null;
|
|
6
6
|
onChange: (value: O | null) => void;
|
|
7
7
|
};
|
|
8
|
-
export declare const FilterSelect: <T extends string = string, O extends
|
|
8
|
+
export declare const FilterSelect: <T extends string = string, O extends SelectOption<T> = SelectOption<T>>({ onChange, options, value, ...props }: FilterSelectProps<T, O>) => import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export {};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import { type GroupBase, type MenuListProps, type Props, type SelectComponentsConfig, type StylesConfig } from 'react-select';
|
|
3
3
|
import { type HelpTextProps } from "../help-text/HelpText";
|
|
4
|
-
import { type
|
|
5
|
-
import type {
|
|
6
|
-
export declare const MenuList: <Option extends
|
|
7
|
-
export
|
|
4
|
+
import { type CountryOption, type UnavailableCountry } from "../../types/Country";
|
|
5
|
+
import type { SelectOption } from "../../types/SelectOption";
|
|
6
|
+
export declare const MenuList: <Option extends SelectOption, IsMulti extends boolean, Group extends GroupBase<Option>>({ children, ...props }: MenuListProps<Option, IsMulti, Group>) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export type CountryMultiSelectProps<Option extends SelectOption<string> = SelectOption<string>, IsMulti extends true = true, Group extends GroupBase<Option> = GroupBase<Option>> = {
|
|
8
8
|
components?: SelectComponentsConfig<Option, IsMulti, Group>;
|
|
9
|
-
countryOptions:
|
|
9
|
+
countryOptions: CountryOption<Option['value']>[];
|
|
10
10
|
icon?: ReactNode;
|
|
11
11
|
label?: string;
|
|
12
12
|
styles?: StylesConfig<Option, IsMulti, Group>;
|
|
13
|
-
unavailableCountries:
|
|
13
|
+
unavailableCountries: UnavailableCountry[];
|
|
14
14
|
value: Option['value'][];
|
|
15
15
|
onChange: (countryCodes: Option['value'][]) => void;
|
|
16
|
-
}
|
|
17
|
-
export declare const CountryMultiSelect: <T extends string>({ countryOptions, label, onChange, unavailableCountries, value, ...props }: CountryMultiSelectProps<
|
|
16
|
+
} & Omit<Props<Option, IsMulti, Group>, 'isMulti' | 'onChange' | 'options' | 'value'> & HelpTextProps;
|
|
17
|
+
export declare const CountryMultiSelect: <T extends string>({ countryOptions, label, onChange, unavailableCountries, value, ...props }: CountryMultiSelectProps<SelectOption<T>, true, GroupBase<SelectOption<T>>>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
import { type GroupBase, type Props, type SelectComponentsConfig, type StylesConfig } from 'react-select';
|
|
3
3
|
import type { HelpTextProps } from "../help-text/HelpText";
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
6
|
-
export
|
|
4
|
+
import type { CountryOption } from "../../types/Country";
|
|
5
|
+
import type { SelectOption } from "../../types/SelectOption";
|
|
6
|
+
export type CountryPhoneSelectProps<Option extends SelectOption = SelectOption, IsMulti extends false = false, Group extends GroupBase<Option> = GroupBase<Option>> = {
|
|
7
7
|
components?: SelectComponentsConfig<Option, IsMulti, Group>;
|
|
8
|
-
countryOptions:
|
|
8
|
+
countryOptions: CountryOption[];
|
|
9
9
|
hasGroups?: boolean;
|
|
10
10
|
icon?: ReactNode;
|
|
11
11
|
label?: string;
|
|
12
12
|
phone: string;
|
|
13
|
-
phoneCountry:
|
|
13
|
+
phoneCountry: CountryOption | null;
|
|
14
14
|
styles?: StylesConfig<Option, IsMulti, Group>;
|
|
15
15
|
setPhone: (changed: string) => void;
|
|
16
|
-
setPhoneCountry: (changed:
|
|
17
|
-
}
|
|
18
|
-
export declare const CountryPhoneSelect: ({ countryOptions, icon, label, phone, phoneCountry, setPhone, setPhoneCountry, ...props }: CountryPhoneSelectProps<
|
|
16
|
+
setPhoneCountry: (changed: CountryOption | null) => void;
|
|
17
|
+
} & Omit<Props<Option, IsMulti, Group>, 'isMulti' | 'onChange' | 'value'> & HelpTextProps;
|
|
18
|
+
export declare const CountryPhoneSelect: ({ countryOptions, icon, label, phone, phoneCountry, setPhone, setPhoneCountry, ...props }: CountryPhoneSelectProps<CountryOption>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { type SelectProps } from "./Select";
|
|
2
|
-
import type {
|
|
2
|
+
import type { CountryOption } from "../../types/Country";
|
|
3
3
|
type CountrySelectType<T extends string> = {
|
|
4
4
|
autoFocus?: SelectProps['autoFocus'];
|
|
5
|
-
countryOptions:
|
|
5
|
+
countryOptions: CountryOption<T>[];
|
|
6
6
|
label?: string;
|
|
7
|
-
onChange: SelectProps<
|
|
7
|
+
onChange: SelectProps<CountryOption<T>>['onChange'];
|
|
8
8
|
placeholder?: string;
|
|
9
9
|
value: T | null;
|
|
10
|
-
filter?: (country:
|
|
10
|
+
filter?: (country: CountryOption<T>) => boolean;
|
|
11
11
|
};
|
|
12
|
-
export type CountrySelectProps<T extends string = string> = CountrySelectType<T> & Omit<SelectProps<
|
|
12
|
+
export type CountrySelectProps<T extends string = string> = CountrySelectType<T> & Omit<SelectProps<CountryOption<T>>, keyof CountrySelectType<T> | 'options'>;
|
|
13
13
|
export declare const CountrySelect: <T extends string>({ autoFocus, countryOptions, filter, label, onChange, placeholder, value, ...props }: CountrySelectProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { GroupBase, Props, PropsValue, SelectComponentsConfig, StylesConfig } from 'react-select';
|
|
3
3
|
import { type HelpTextProps } from "../help-text/HelpText";
|
|
4
|
-
import type {
|
|
4
|
+
import type { SelectOption } from "../../types/SelectOption";
|
|
5
5
|
type RequiredProps = 'onChange' | 'options' | 'value';
|
|
6
|
-
export
|
|
6
|
+
export type MultiSelectProps<Option extends SelectOption = SelectOption, IsMulti extends true = true, Group extends GroupBase<Option> = GroupBase<Option>> = {
|
|
7
7
|
components?: SelectComponentsConfig<Option, IsMulti, Group>;
|
|
8
8
|
hasGroups?: boolean;
|
|
9
9
|
icon?: ReactNode;
|
|
@@ -14,13 +14,13 @@ export interface MultiSelectProps<Option extends IOption = IOption, IsMulti exte
|
|
|
14
14
|
* value: { label: string; value: string; }[];
|
|
15
15
|
*/
|
|
16
16
|
value: PropsValue<Option>;
|
|
17
|
-
}
|
|
18
|
-
export type
|
|
17
|
+
} & Omit<Props<Option, IsMulti, Group>, 'isMulti' | RequiredProps> & Required<Pick<Props<Option, IsMulti, Group>, RequiredProps>> & HelpTextProps;
|
|
18
|
+
export type GroupOption<Option extends SelectOption> = {
|
|
19
19
|
data: Option;
|
|
20
20
|
index: 0;
|
|
21
21
|
isDisabled: false;
|
|
22
22
|
isSelected: false;
|
|
23
23
|
type: 'option';
|
|
24
|
-
} &
|
|
25
|
-
export declare const MultiSelect: <Option extends
|
|
24
|
+
} & SelectOption;
|
|
25
|
+
export declare const MultiSelect: <Option extends SelectOption, Group extends GroupBase<Option>>({ closeMenuOnSelect, hideSelectedOptions, ...props }: MultiSelectProps<Option, true, Group>) => import("react/jsx-runtime").JSX.Element;
|
|
26
26
|
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { ActionMeta, GroupBase, Props, SelectComponentsConfig, StylesConfig } from 'react-select';
|
|
3
3
|
import { type HelpTextProps } from "../help-text/HelpText";
|
|
4
|
-
import type {
|
|
4
|
+
import type { SelectOption } from "../../types/SelectOption";
|
|
5
5
|
import type { Size } from "../../types/Size";
|
|
6
6
|
type RequiredProps = 'options' | 'value';
|
|
7
|
-
export
|
|
7
|
+
export type SelectProps<Option extends SelectOption = SelectOption, IsMulti extends false = false, Group extends GroupBase<Option> = GroupBase<Option>> = {
|
|
8
8
|
/** Close the select dropdown menu when scrolling outside of menu to prevent graphical jank */
|
|
9
9
|
closeOnOutsideScroll?: boolean;
|
|
10
10
|
components?: SelectComponentsConfig<Option, IsMulti, Group>;
|
|
@@ -27,6 +27,6 @@ export interface SelectProps<Option extends IOption = IOption, IsMulti extends f
|
|
|
27
27
|
* onChange={changed => setExampleValue(changed?.value || null)}
|
|
28
28
|
*/
|
|
29
29
|
onChange: (changed: Option | null, actionMeta: ActionMeta<Option>) => void;
|
|
30
|
-
}
|
|
31
|
-
export declare const Select: <Option extends
|
|
30
|
+
} & Omit<Props<Option, IsMulti, Group>, 'isMulti' | RequiredProps> & Required<Pick<Props<Option, IsMulti, Group>, RequiredProps>> & HelpTextProps;
|
|
31
|
+
export declare const Select: <Option extends SelectOption, Group extends GroupBase<Option> = GroupBase<Option>>({ isClearable, label, value, ...props }: SelectProps<Option, false, Group>) => import("react/jsx-runtime").JSX.Element;
|
|
32
32
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
import type { GroupBase, OptionProps, Props, SelectComponentsConfig, StylesConfig } from 'react-select';
|
|
3
3
|
import { type HelpTextProps } from "../help-text/HelpText";
|
|
4
|
-
import type {
|
|
4
|
+
import type { SelectOption } from "../../types/SelectOption";
|
|
5
5
|
import type { Size } from "../../types/Size";
|
|
6
6
|
type AdditionalProps<Value> = {
|
|
7
7
|
hasGroups?: boolean;
|
|
@@ -10,12 +10,12 @@ type AdditionalProps<Value> = {
|
|
|
10
10
|
size?: Size;
|
|
11
11
|
customOption?: (value: Value) => ReactNode;
|
|
12
12
|
};
|
|
13
|
-
export declare const CheckboxOptionComponent: <Option extends
|
|
14
|
-
export
|
|
13
|
+
export declare const CheckboxOptionComponent: <Option extends SelectOption, IsMulti extends boolean, Group extends GroupBase<Option>>(props: OptionProps<Option, IsMulti, Group>) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export type StyledReactSelectProps<Option extends SelectOption, IsMulti extends boolean, Group extends GroupBase<Option>> = {
|
|
15
15
|
closeOnOutsideScroll?: boolean;
|
|
16
16
|
components?: SelectComponentsConfig<Option, IsMulti, Group>;
|
|
17
17
|
size?: Size;
|
|
18
18
|
styles?: StylesConfig<Option, IsMulti, Group>;
|
|
19
|
-
}
|
|
20
|
-
export declare const StyledReactSelect: <Option extends
|
|
19
|
+
} & Props<Option, IsMulti, Group> & HelpTextProps & AdditionalProps<Option['value']>;
|
|
20
|
+
export declare const StyledReactSelect: <Option extends SelectOption, IsMulti extends boolean, Group extends GroupBase<Option>>({ closeOnOutsideScroll, components, customOption, error, hasGroups, helpText, icon, label, menuPosition, placeholder, size, styles, ...props }: StyledReactSelectProps<Option, IsMulti, Group>) => import("react/jsx-runtime").JSX.Element;
|
|
21
21
|
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { SortingStrategy } from '@dnd-kit/sortable/dist/types';
|
|
3
3
|
import type { DragEndEvent } from "./SortableListDeps";
|
|
4
|
-
export
|
|
4
|
+
export type SortableListProps = {
|
|
5
5
|
children: ReactNode;
|
|
6
6
|
itemIds: string[];
|
|
7
7
|
sortingStrategy?: SortingStrategy;
|
|
8
8
|
handleDragEnd: (e: DragEndEvent) => void;
|
|
9
|
-
}
|
|
9
|
+
};
|
|
10
10
|
export declare const SortableList: ({ children, handleDragEnd, itemIds, sortingStrategy, }: SortableListProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
export
|
|
2
|
+
export type SortableListItemProps = {
|
|
3
3
|
children: ReactNode;
|
|
4
4
|
handleIconSize?: number;
|
|
5
5
|
id: string;
|
|
6
6
|
useHandle?: boolean;
|
|
7
|
-
}
|
|
7
|
+
};
|
|
8
8
|
/** @description This must be a direct child of SortableList */
|
|
9
9
|
export declare const SortableListItem: ({ children, handleIconSize, id, useHandle, }: SortableListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Dispatch, type SetStateAction } from 'react';
|
|
2
|
-
type
|
|
2
|
+
type SplitPanelProps = {
|
|
3
3
|
children: any;
|
|
4
4
|
className?: string;
|
|
5
5
|
collapseAll?: boolean;
|
|
@@ -26,5 +26,5 @@ type IProps = {
|
|
|
26
26
|
* Split panel component
|
|
27
27
|
* @ref https://greggman.github.io/react-split-it/
|
|
28
28
|
*/
|
|
29
|
-
export declare const SplitPanel: ({ children, className, collapseAll, direction, gutterSize, onSetSizes, sizes, ...props }:
|
|
29
|
+
export declare const SplitPanel: ({ children, className, collapseAll, direction, gutterSize, onSetSizes, sizes, ...props }: SplitPanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
30
30
|
export {};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
import type { GridAlignment, GridSpacing } from "../../types";
|
|
3
3
|
type DivProps = Omit<HTMLAttributes<HTMLDivElement>, 'translate' | 'style' | 'prefix' | 'contentEditable' | 'inputMode' | 'children'>;
|
|
4
|
-
export
|
|
4
|
+
export type StackProps = {
|
|
5
5
|
/** @default 'unset' */
|
|
6
6
|
alignment?: GridAlignment;
|
|
7
7
|
children: ReactNode;
|
|
8
8
|
/** @default 24 */
|
|
9
9
|
spacing?: GridSpacing;
|
|
10
|
-
}
|
|
10
|
+
} & DivProps;
|
|
11
11
|
export declare const Stack: ({ alignment, children, ...otherProps }: StackProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
export {};
|
package/components/tag/Tag.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
type TagSize = 'base' | 'lg';
|
|
3
|
-
export
|
|
3
|
+
export type TagProps = {
|
|
4
4
|
children?: ReactNode | string;
|
|
5
5
|
className?: string;
|
|
6
6
|
icon?: ReactNode;
|
|
@@ -8,6 +8,6 @@ export interface TagProps {
|
|
|
8
8
|
size?: TagSize;
|
|
9
9
|
onClick?: () => void;
|
|
10
10
|
onClose: () => void;
|
|
11
|
-
}
|
|
11
|
+
};
|
|
12
12
|
export declare const Tag: ({ children, className, icon, iconRight, onClick, onClose, size, }: TagProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
export {};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import * as flags from "../flags/FlagIndex";
|
|
3
|
-
export type
|
|
4
|
-
export type
|
|
3
|
+
export type Flag = keyof typeof flags;
|
|
4
|
+
export type FlagScale = 'small' | 'medium' | 'large';
|
|
5
5
|
export type FlagIconProps = {
|
|
6
|
-
iconScale:
|
|
6
|
+
iconScale: FlagScale;
|
|
7
7
|
} & {
|
|
8
|
-
code:
|
|
8
|
+
code: Flag;
|
|
9
9
|
};
|
|
10
10
|
export declare const FlagIcon: import("react").ForwardRefExoticComponent<{
|
|
11
|
-
iconScale:
|
|
11
|
+
iconScale: FlagScale;
|
|
12
12
|
} & {
|
|
13
|
-
code:
|
|
13
|
+
code: Flag;
|
|
14
14
|
} & import("react").RefAttributes<SVGSVGElement>>;
|
package/package.json
CHANGED
package/types/BaseProps.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SelectOption } from "./SelectOption";
|
|
2
2
|
export declare const regions: readonly ["Africa", "Americas", "Asia", "Central America", "Europe", "North America", "Oceania", "South America"];
|
|
3
|
-
type
|
|
3
|
+
type Region = (typeof regions)[number];
|
|
4
4
|
/** @desc /api/address/getCountries */
|
|
5
|
-
export
|
|
5
|
+
export type Country<CountryCode extends string = string> = {
|
|
6
6
|
active: boolean;
|
|
7
7
|
code: CountryCode;
|
|
8
8
|
code3: string | null;
|
|
@@ -11,23 +11,23 @@ export interface ICountry<CountryCode extends string = string> {
|
|
|
11
11
|
fraudRisk: number;
|
|
12
12
|
languageCode: string | null;
|
|
13
13
|
numericCode: string | null;
|
|
14
|
-
region:
|
|
14
|
+
region: Region;
|
|
15
15
|
upsCode: string | null;
|
|
16
16
|
zipRegex: string | null;
|
|
17
|
-
}
|
|
18
|
-
export
|
|
17
|
+
};
|
|
18
|
+
export type CountryOption<CountryCode extends string = string> = {
|
|
19
19
|
phoneCode: string[];
|
|
20
|
-
}
|
|
21
|
-
export
|
|
22
|
-
label:
|
|
23
|
-
options:
|
|
24
|
-
}
|
|
25
|
-
export
|
|
20
|
+
} & Country<CountryCode> & SelectOption<CountryCode>;
|
|
21
|
+
export type RegionCountryOption = {
|
|
22
|
+
label: Region;
|
|
23
|
+
options: CountryOption[];
|
|
24
|
+
};
|
|
25
|
+
export type UnavailableCountry = {
|
|
26
26
|
code: string;
|
|
27
27
|
message: string;
|
|
28
|
-
}
|
|
28
|
+
};
|
|
29
29
|
/** @desc /api/address/getCountries */
|
|
30
|
-
export
|
|
31
|
-
[key: string]:
|
|
32
|
-
}
|
|
30
|
+
export type GetCountriesResponse<CountryCode extends string = string> = {
|
|
31
|
+
[key: string]: Country<CountryCode>;
|
|
32
|
+
};
|
|
33
33
|
export {};
|
package/types/FetcherError.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import type { BBox } from 'geojson';
|
|
2
2
|
import type { Arc, MultiPolygon, Polygon, Transform } from 'topojson-specification';
|
|
3
|
-
type
|
|
3
|
+
type Properties = {
|
|
4
4
|
name: string;
|
|
5
5
|
};
|
|
6
|
-
type
|
|
7
|
-
properties:
|
|
6
|
+
type Geometry = (Polygon | MultiPolygon) & {
|
|
7
|
+
properties: Properties;
|
|
8
8
|
};
|
|
9
|
-
export type
|
|
9
|
+
export type GeoJsonWorld = {
|
|
10
10
|
arcs: Arc[];
|
|
11
11
|
bbox: BBox;
|
|
12
12
|
objects: {
|
|
13
13
|
countries: {
|
|
14
|
-
geometries:
|
|
14
|
+
geometries: Geometry[];
|
|
15
15
|
type: 'GeometryCollection';
|
|
16
16
|
};
|
|
17
17
|
};
|
package/types/JsonError.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
export
|
|
2
|
+
export type SelectOption<V extends string | number = string | number> = {
|
|
3
3
|
icon?: ReactNode;
|
|
4
4
|
isDisabled?: boolean;
|
|
5
5
|
label: string;
|
|
6
6
|
labelDescription?: string;
|
|
7
7
|
value: V;
|
|
8
|
-
}
|
|
8
|
+
};
|
package/types/SwrtParams.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export type GraphiqlFetcher = (graphQLParams: FetcherParams, opts?: FetcherOpts)
|
|
|
19
19
|
export type HandleFetchFetcher = <ResponseBody extends unknown, RequestBody = unknown>(url: string, _opts?: RequestOptions<ResponseBody, RequestBody> & {
|
|
20
20
|
logRequestIfError?: boolean;
|
|
21
21
|
}) => Promise<HandleFetchReturn<ResponseBody>>;
|
|
22
|
-
type
|
|
22
|
+
type Fetcher = (props: {
|
|
23
23
|
customFetcher: HandleFetchFetcher | null;
|
|
24
24
|
url: string | null;
|
|
25
25
|
}) => GraphiqlFetcher;
|
|
@@ -27,5 +27,5 @@ type IFetcher = (props: {
|
|
|
27
27
|
* Graphiql fetcher to send a GraphQl request
|
|
28
28
|
* @param url url to fetch
|
|
29
29
|
*/
|
|
30
|
-
export declare const graphiqlFetcher:
|
|
30
|
+
export declare const graphiqlFetcher: Fetcher;
|
|
31
31
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const getCountryCodeByName: (countryName: string, countries:
|
|
1
|
+
import type { CountryOption } from "../types/Country";
|
|
2
|
+
export declare const getCountryCodeByName: (countryName: string, countries: CountryOption[]) => string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { GetCountriesResponse } from "../types/Country";
|
|
2
2
|
export declare const prepCountryOptions: <CountryCode extends string = string>({ json, }: {
|
|
3
|
-
json:
|
|
3
|
+
json: GetCountriesResponse<CountryCode>;
|
|
4
4
|
}) => {
|
|
5
5
|
label: string;
|
|
6
6
|
phoneCode: string[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
export declare const prepRegionCountryOptions: <T extends string = string>(countries:
|
|
1
|
+
import { type CountryOption } from "../types/Country";
|
|
2
|
+
export declare const prepRegionCountryOptions: <T extends string = string>(countries: CountryOption<T>[]) => {
|
|
3
3
|
label: "Africa" | "Americas" | "Asia" | "Central America" | "Europe" | "North America" | "Oceania" | "South America";
|
|
4
|
-
options:
|
|
4
|
+
options: CountryOption<T>[];
|
|
5
5
|
}[];
|