gantri-components 2.132.2 → 2.133.0-beta.10
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/dist/components/file-uploader/components/configured-custom-content/configured-custom-content.types.d.ts +1 -1
- package/dist/components/file-uploader/file-uploader.styles.d.ts +2 -2
- package/dist/components/file-uploader/file-uploader.types.d.ts +13 -3
- package/dist/components/file-uploader/helpers/get-valid-files/get-valid-files.types.d.ts +1 -1
- package/dist/components/file-uploader/helpers/index.d.ts +1 -0
- package/dist/components/file-uploader/helpers/validate-file-extension/index.d.ts +1 -0
- package/dist/components/file-uploader/helpers/validate-file-extension/validate-file-extension.d.ts +3 -0
- package/dist/components/file-uploader/helpers/validate-file-extension/validate-file-extension.types.d.ts +4 -0
- package/dist/components/file-uploader/helpers/validate-image-dimensions/validate-image-dimensions.d.ts +3 -3
- package/dist/components/file-uploader/helpers/validate-image-dimensions/validate-image-dimensions.types.d.ts +8 -1
- package/dist/components/file-uploader/hooks/use-drag-and-drop-files/use-drag-and-drop-files.d.ts +6 -1
- package/dist/components/file-uploader/hooks/use-drag-and-drop-files/use-drag-and-drop-files.types.d.ts +3 -3
- package/dist/components/file-uploader/hooks/use-uploader-actions/hooks/use-handle-selected-files/use-handle-selected-files.types.d.ts +1 -1
- package/dist/components/file-uploader/hooks/use-uploader-actions/use-uploader-actions.types.d.ts +1 -1
- package/dist/components/filter-button/filter-button.types.d.ts +0 -1
- package/dist/components/pills/components/pill/pill.types.d.ts +0 -1
- package/dist/components/table/components/selectable-row-checkbox-wrapper/selectable-row-checkbox-wrapper.types.d.ts +0 -1
- package/dist/components/table/components/table-draggable-row/table-draggable-row.styles.d.ts +0 -3
- package/dist/components/table/hooks/use-selectable-table-rows/components/clear-selected-rows/clear-selected-rows.d.ts +2 -0
- package/dist/components/table/hooks/use-selectable-table-rows/components/clear-selected-rows/clear-selected-rows.styles.d.ts +2 -0
- package/dist/components/table/hooks/use-selectable-table-rows/components/clear-selected-rows/index.d.ts +1 -0
- package/dist/components/table/hooks/use-selectable-table-rows/components/selectable-row-cell/index.d.ts +1 -0
- package/dist/components/table/hooks/use-selectable-table-rows/components/selectable-row-cell/selectable-row-cell.d.ts +4 -0
- package/dist/components/table/hooks/use-selectable-table-rows/components/selectable-row-cell/selectable-row-cell.styles.d.ts +2 -0
- package/dist/components/table/hooks/use-selectable-table-rows/components/selectable-row-cell/selectable-row-cell.types.d.ts +6 -0
- package/dist/components/table/hooks/use-selectable-table-rows/components/selectable-table-row-footer/index.d.ts +1 -0
- package/dist/components/table/hooks/use-selectable-table-rows/components/selectable-table-row-footer/selectable-table-row-footer.d.ts +3 -0
- package/dist/components/table/hooks/use-selectable-table-rows/components/selectable-table-row-footer/selectable-table-row-footer.types.d.ts +3 -0
- package/dist/components/table/hooks/use-selectable-table-rows/components/selectable-table-row-header/index.d.ts +1 -0
- package/dist/components/table/hooks/use-selectable-table-rows/components/selectable-table-row-header/selectable-table-row-header.d.ts +4 -0
- package/dist/components/table/hooks/use-selectable-table-rows/components/selectable-table-row-header/selectable-table-row-header.types.d.ts +5 -0
- package/dist/components/table/hooks/use-selectable-table-rows/helpers/get-row-range/get-row-range.d.ts +3 -0
- package/dist/components/table/hooks/use-selectable-table-rows/helpers/get-row-range/get-row-range.types.d.ts +6 -0
- package/dist/components/table/hooks/use-selectable-table-rows/helpers/get-row-range/index.d.ts +1 -0
- package/dist/components/table/hooks/use-selectable-table-rows/index.d.ts +1 -0
- package/dist/components/table/hooks/use-selectable-table-rows/use-selectable-table-rows.constants.d.ts +6 -0
- package/dist/components/table/hooks/use-selectable-table-rows/use-selectable-table-rows.d.ts +10 -0
- package/dist/components/table/hooks/use-selectable-table-rows/use-selectable-table-rows.types.d.ts +9 -0
- package/dist/global/context/index.d.ts +1 -0
- package/dist/global/context/translation/index.d.ts +1 -0
- package/dist/global/context/translation/translation.context.d.ts +11 -0
- package/dist/global/context/translation-name-space/index.d.ts +1 -0
- package/dist/global/context/translation-name-space/translation-name-space.context.d.ts +11 -0
- package/dist/helpers/generate-skus-functions/get-colors-by-product-id/__tests__/get-colors-by-product-id.test.d.ts +1 -0
- package/dist/helpers/generate-skus-functions/get-colors-by-product-id/get-colors-by-product-id.d.ts +9 -0
- package/dist/helpers/generate-skus-functions/get-colors-by-product-id/index.d.ts +1 -0
- package/dist/helpers/generate-skus-functions/get-sku-selectors/get-sku-selectors.d.ts +13 -0
- package/dist/helpers/generate-skus-functions/get-sku-selectors/get-sku-selectors.types.d.ts +8 -0
- package/dist/helpers/generate-skus-functions/get-sku-selectors/index.d.ts +1 -0
- package/dist/helpers/generate-skus-functions/helpers/generate-skus-from-options/generate-skus-from-options.types.d.ts +0 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/use-provider/index.d.ts +1 -0
- package/dist/hooks/use-provider/use-provider.d.ts +33 -0
- package/dist/hooks/use-provider/use-provider.types.d.ts +2 -0
- package/dist/index.cjs.js +2 -1
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.esm.js +2 -1
- package/dist/index.esm.js.map +1 -0
- package/dist/index.umd.js +2 -1
- package/dist/index.umd.js.map +1 -0
- package/package.json +5 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FileUploaderProps } from '../../file-uploader.types';
|
|
2
2
|
import { OptionalValues } from '../../../../types/common';
|
|
3
|
-
export type ConfiguredCustomContentProps = OptionalValues<Pick<FileUploaderProps, 'CustomContent' | 'enableCopyUrl' | 'fileName' | 'fileUrl' | 'isDraggable' | 'isReplaceable' | 'processing' | 'SortableDragHandleWrapper'
|
|
3
|
+
export type ConfiguredCustomContentProps = OptionalValues<Required<Pick<FileUploaderProps, 'CustomContent' | 'enableCopyUrl' | 'fileName' | 'fileUrl' | 'isDisabled' | 'isDraggable' | 'isReplaceable' | 'processing' | 'SortableDragHandleWrapper'>>> & {
|
|
4
4
|
deleteFile: () => Promise<void>;
|
|
5
5
|
handleOpenFileSelect: () => void;
|
|
6
6
|
isDraggingOver: boolean;
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
import { OptionalValues } from '../../types/common';
|
|
3
3
|
export declare const StyledFileInput: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, OptionalValues<{
|
|
4
4
|
$fileUrl: string;
|
|
5
|
-
$
|
|
6
|
-
|
|
5
|
+
$isDropZone: boolean;
|
|
6
|
+
disabled: boolean;
|
|
7
7
|
}, undefined>>> & string;
|
|
@@ -12,16 +12,19 @@ export type FileUploaderProps = {
|
|
|
12
12
|
fileUrl: string;
|
|
13
13
|
/** This function should delete the record from the database, ***then*** delete the file. */
|
|
14
14
|
handleDeleteFile: HandleDeleteFile;
|
|
15
|
-
/** Provide this if supporting multiple uploads to prevent multiple calls to update the database. */
|
|
16
|
-
handleUploadsComplete: HandleUploadsComplete;
|
|
17
15
|
inputName?: string;
|
|
18
16
|
isActive?: boolean;
|
|
19
17
|
isDisabled?: boolean;
|
|
18
|
+
/** Updates the input to be used as a file drop zone. */
|
|
19
|
+
isDropZone?: boolean;
|
|
20
20
|
/** Use with variant `'thumbnail'` to always show the uploader view. */
|
|
21
21
|
isUploaderOnly?: boolean;
|
|
22
22
|
onBlur?: FocusEventHandler<HTMLInputElement>;
|
|
23
23
|
onClick?: BoxProps['onClick'];
|
|
24
24
|
onError: OnFileUploaderError;
|
|
25
|
+
onValidationCompleted?: () => void;
|
|
26
|
+
onValidationStarted?: () => void;
|
|
27
|
+
onlyUseCustomValidationFn?: boolean;
|
|
25
28
|
/** Used to show loading indicator for `'thumbnail'` variant. For the `'button'` variant, it can be passed here or as part of `buttonProps`. */
|
|
26
29
|
processing: boolean;
|
|
27
30
|
purifyFileName?: boolean;
|
|
@@ -30,6 +33,7 @@ export type FileUploaderProps = {
|
|
|
30
33
|
transformThumbnailSrc?: TransformThumbnailSrc;
|
|
31
34
|
/** If invalid, return the error message to display. */
|
|
32
35
|
validateFile?: ValidateFile;
|
|
36
|
+
validateSequentially?: boolean;
|
|
33
37
|
/** The 'link' and 'plain' variants will show the 'button' variant if nothing has been uploaded yet. */
|
|
34
38
|
variant: FileUploaderVariant;
|
|
35
39
|
} & Partial<FileUploaderDefaultProps> & (WithDraggableProps | WithoutDraggableProps) & (WithReplaceableProps | WithoutReplaceableProps) & (ImmediatelyUploadProps | DelayUploadProps) & (WithCustomContent | WithoutCustomContent);
|
|
@@ -57,12 +61,13 @@ export interface FileMetaData {
|
|
|
57
61
|
}
|
|
58
62
|
export interface SelectedFileDetails {
|
|
59
63
|
fileBlob: Blob;
|
|
64
|
+
fileExtension: string;
|
|
60
65
|
fileName: string;
|
|
61
66
|
fileSize: number;
|
|
62
67
|
metadata: FileMetaData;
|
|
63
68
|
}
|
|
64
69
|
/** If invalid, return the error message to display. */
|
|
65
|
-
export type ValidateFile = (file: SelectedFileDetails) => string | undefined | void;
|
|
70
|
+
export type ValidateFile = (file: SelectedFileDetails) => Promise<string | undefined | void> | string | undefined | void;
|
|
66
71
|
export type HandleFileSelected = (props: SelectedFileDetails) => Promise<any>;
|
|
67
72
|
export type FileUploaderCustomContent = (props: {
|
|
68
73
|
IconCopyUrl: () => JSX.Element;
|
|
@@ -73,6 +78,7 @@ export type FileUploaderCustomContent = (props: {
|
|
|
73
78
|
fileName: string;
|
|
74
79
|
fileUrl: string;
|
|
75
80
|
handleOpenFileSelect: () => void;
|
|
81
|
+
isDisabled: boolean | undefined;
|
|
76
82
|
isDraggingOver: boolean;
|
|
77
83
|
processing: boolean;
|
|
78
84
|
}) => JSX.Element;
|
|
@@ -87,10 +93,14 @@ export type TransformThumbnailSrc = (props: {
|
|
|
87
93
|
type ImmediatelyUploadProps = {
|
|
88
94
|
handleFileSelected?: never;
|
|
89
95
|
handleUploadFile: HandleUploadFile;
|
|
96
|
+
/** Use this if supporting multiple uploads to prevent multiple calls to update the database. */
|
|
97
|
+
handleUploadsComplete: HandleUploadsComplete;
|
|
90
98
|
};
|
|
91
99
|
type DelayUploadProps = {
|
|
92
100
|
handleFileSelected: HandleFileSelected;
|
|
93
101
|
handleUploadFile?: never;
|
|
102
|
+
/** Use this if supporting multiple uploads to prevent multiple calls to update the database. */
|
|
103
|
+
handleUploadsComplete?: never;
|
|
94
104
|
};
|
|
95
105
|
type WithDraggableProps = {
|
|
96
106
|
SortableDragHandleWrapper: (props: PropsWithChildren<HTMLAttributes<HTMLElement>>) => JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FileUploaderProps } from '../../file-uploader.types';
|
|
2
2
|
import { OptionalValues } from '../../../../types/common';
|
|
3
|
-
export type GetValidFilesProps = OptionalValues<Pick<FileUploaderProps, 'expectedExtensions' | 'maxFileSizeMB' | 'maxUploadsAllowed' | 'minImageHeight' | 'minImageWidth' | 'onError' | 'transformFileName' | 'validateFile'
|
|
3
|
+
export type GetValidFilesProps = OptionalValues<Required<Pick<FileUploaderProps, 'expectedExtensions' | 'maxFileSizeMB' | 'maxUploadsAllowed' | 'minImageHeight' | 'minImageWidth' | 'onError' | 'onlyUseCustomValidationFn' | 'transformFileName' | 'validateFile' | 'validateSequentially'>>> & {
|
|
4
4
|
files: File[];
|
|
5
5
|
};
|
|
@@ -2,5 +2,6 @@ export * from './get-base-64-from-blob';
|
|
|
2
2
|
export * from './get-purified-file-name';
|
|
3
3
|
export * from './get-valid-files';
|
|
4
4
|
export * from './transform-file-name';
|
|
5
|
+
export * from './validate-file-extension';
|
|
5
6
|
export * from './validate-file-size';
|
|
6
7
|
export * from './validate-image-dimensions';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './validate-file-extension';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
/** Returns
|
|
3
|
-
export declare const validateImageDimensions: (props:
|
|
1
|
+
import { ValidateImageDimensionsProps } from './validate-image-dimensions.types';
|
|
2
|
+
/** Returns error message if invalid. */
|
|
3
|
+
export declare const validateImageDimensions: (props: ValidateImageDimensionsProps) => Promise<string | undefined>;
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
export type
|
|
1
|
+
export type ValidateDimensionsProps = {
|
|
2
2
|
fileName: string;
|
|
3
3
|
img: HTMLImageElement;
|
|
4
4
|
minHeight: number;
|
|
5
5
|
minWidth: number;
|
|
6
6
|
};
|
|
7
|
+
export interface ValidateImageDimensionsProps {
|
|
8
|
+
fileName: string;
|
|
9
|
+
minHeight: number;
|
|
10
|
+
minWidth: number;
|
|
11
|
+
/** If file is a `Blob`, convert to base64 `src` using `getBase64FromBlob`. */
|
|
12
|
+
src: string;
|
|
13
|
+
}
|
package/dist/components/file-uploader/hooks/use-drag-and-drop-files/use-drag-and-drop-files.d.ts
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { DragEvent } from 'react';
|
|
2
2
|
import { UseDragAndDropFilesProps } from './use-drag-and-drop-files.types';
|
|
3
3
|
export declare const useDragAndDropFiles: (props: UseDragAndDropFilesProps) => {
|
|
4
|
-
isDraggingOver: boolean;
|
|
5
4
|
onDragEnter: (event: DragEvent<HTMLInputElement>) => void;
|
|
6
5
|
onDragLeave: (event: DragEvent<HTMLInputElement>) => void;
|
|
7
6
|
onDrop: (event: DragEvent<HTMLInputElement>) => Promise<void>;
|
|
7
|
+
isDraggingOver: boolean;
|
|
8
|
+
} | {
|
|
9
|
+
onDragEnter?: undefined;
|
|
10
|
+
onDragLeave?: undefined;
|
|
11
|
+
onDrop?: undefined;
|
|
12
|
+
isDraggingOver: boolean;
|
|
8
13
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export interface UseDragAndDropFilesProps {
|
|
2
|
+
enable: boolean;
|
|
3
3
|
handleSelectedFiles: (files: File[]) => Promise<void>;
|
|
4
|
-
}
|
|
4
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Dispatch, SetStateAction } from 'react';
|
|
2
2
|
import { SelectedFileDetails, FileUploaderProps } from '../../../../file-uploader.types';
|
|
3
3
|
import { OptionalValues } from '../../../../../../types/common';
|
|
4
|
-
export type UseHandleSelectedFilesProps = OptionalValues<Required<Pick<FileUploaderProps, 'expectedExtensions' | 'fileUrl' | 'handleFileSelected' | 'handleUploadsComplete' | 'isUploaderOnly' | 'maxFileSizeMB' | 'maxUploadsAllowed' | 'minImageHeight' | 'minImageWidth' | 'onError' | 'transformFileName' | 'validateFile'>>> & {
|
|
4
|
+
export type UseHandleSelectedFilesProps = OptionalValues<Required<Pick<FileUploaderProps, 'expectedExtensions' | 'fileUrl' | 'handleFileSelected' | 'handleUploadsComplete' | 'isUploaderOnly' | 'maxFileSizeMB' | 'maxUploadsAllowed' | 'minImageHeight' | 'minImageWidth' | 'onError' | 'onValidationCompleted' | 'onValidationStarted' | 'onlyUseCustomValidationFn' | 'transformFileName' | 'validateFile' | 'validateSequentially'>>> & {
|
|
5
5
|
purgeInput: () => void;
|
|
6
6
|
setFileName: Dispatch<SetStateAction<string>>;
|
|
7
7
|
setFileUrl: Dispatch<SetStateAction<string>>;
|
package/dist/components/file-uploader/hooks/use-uploader-actions/use-uploader-actions.types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FileUploaderProps } from '../../file-uploader.types';
|
|
2
2
|
import { OptionalValues } from '../../../../types/common';
|
|
3
|
-
export type UseUploadActionsProps = OptionalValues<Required<Pick<FileUploaderProps, 'expectedExtensions' | 'fileName' | 'fileUrl' | 'handleDeleteFile' | 'handleFileSelected' | 'handleUploadsComplete' | 'handleUploadFile' | 'isUploaderOnly' | 'maxUploadsAllowed' | 'onError' | 'purifyFileName' | 'transformFileName' | 'validateFile'>>> & Partial<Pick<FileUploaderProps, 'maxFileSizeMB' | 'minImageHeight' | 'minImageWidth'>> & {
|
|
3
|
+
export type UseUploadActionsProps = OptionalValues<Required<Pick<FileUploaderProps, 'expectedExtensions' | 'fileName' | 'fileUrl' | 'handleDeleteFile' | 'handleFileSelected' | 'handleUploadsComplete' | 'handleUploadFile' | 'isUploaderOnly' | 'maxUploadsAllowed' | 'onError' | 'onValidationCompleted' | 'onValidationStarted' | 'onlyUseCustomValidationFn' | 'purifyFileName' | 'transformFileName' | 'validateFile' | 'validateSequentially'>>> & Partial<Pick<FileUploaderProps, 'maxFileSizeMB' | 'minImageHeight' | 'minImageWidth'>> & {
|
|
4
4
|
purgeInput: () => void;
|
|
5
5
|
};
|
package/dist/components/table/components/table-draggable-row/table-draggable-row.styles.d.ts
CHANGED
|
@@ -1,4 +1 @@
|
|
|
1
|
-
export declare const StyledDraggableRowTr: import("styled-components").StyledComponent<"tr", import("styled-components").DefaultTheme, {
|
|
2
|
-
reorderEnabled: boolean;
|
|
3
|
-
}, never>;
|
|
4
1
|
export declare const StyledDraggableRowWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const StyledPointerFlex: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../../../../../flex/flex.types").FlexProps & import("react").RefAttributes<import("../../../../../flex/flex.types").FlexProps>>, import("styled-components").DefaultTheme, {}, never>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './clear-selected-rows';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './selectable-row-cell';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
|
+
import { RowData } from '@tanstack/react-table';
|
|
3
|
+
import { SelectableRowCellProps } from './selectable-row-cell.types';
|
|
4
|
+
export declare const SelectableRowCell: <TData extends RowData<import("../../../..").CustomTData>>(props: React.PropsWithChildren<SelectableRowCellProps<TData>>) => JSX.Element;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const StyledCheckboxCell: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../../../../../cell/cell.types").CellProps & import("react").RefAttributes<import("../../../../../cell/cell.types").CellProps>>, import("styled-components").DefaultTheme, {}, never>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './selectable-table-row-footer';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './selectable-table-row-header';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
|
+
import { RowData } from '@tanstack/react-table';
|
|
3
|
+
import { SelectableRowHeaderProps } from './selectable-table-row-header.types';
|
|
4
|
+
export declare const SelectableRowHeader: <TData extends RowData<import("../../../..").CustomTData>>(props: React.PropsWithChildren<SelectableRowHeaderProps<TData>>) => JSX.Element;
|
package/dist/components/table/hooks/use-selectable-table-rows/helpers/get-row-range/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './get-row-range';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './use-selectable-table-rows';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RowData } from '@tanstack/react-table';
|
|
2
|
+
export declare const useSelectableTableRows: <TData extends RowData<import("../..").CustomTData>>() => {
|
|
3
|
+
deselectRows: (rowIds: (string | number)[]) => void;
|
|
4
|
+
getIsRowSelected: (rowId: number | string) => boolean;
|
|
5
|
+
getSelectedRowData: (props: {
|
|
6
|
+
idProperty: keyof TData;
|
|
7
|
+
records: TData[];
|
|
8
|
+
}) => (TData | undefined)[];
|
|
9
|
+
selectRows: (rowIds: (string | number)[]) => void;
|
|
10
|
+
};
|
package/dist/components/table/hooks/use-selectable-table-rows/use-selectable-table-rows.types.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { RowData } from '@tanstack/react-table';
|
|
2
|
+
import { rowSelectionTypes } from './use-selectable-table-rows.constants';
|
|
3
|
+
export interface RowSelection<TData extends RowData> {
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
idProperty?: keyof TData;
|
|
6
|
+
onSelect?: (selectedRecords: TData[]) => void;
|
|
7
|
+
type: RowSelectionType;
|
|
8
|
+
}
|
|
9
|
+
export type RowSelectionType = typeof rowSelectionTypes[keyof typeof rowSelectionTypes];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './translation';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './translation.context';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
|
+
type TranslationNameSpaceState = string[] | string;
|
|
3
|
+
export declare const defaultTranslationNameSpace: TranslationNameSpaceState;
|
|
4
|
+
export declare const TranslationContext: React.Context<TranslationNameSpaceState>;
|
|
5
|
+
export declare const useTranslationContext: () => {
|
|
6
|
+
nameSpace: TranslationNameSpaceState;
|
|
7
|
+
};
|
|
8
|
+
export declare const TranslationProvider: (props: React.PropsWithChildren<{
|
|
9
|
+
nameSpace: TranslationNameSpaceState;
|
|
10
|
+
}>) => React.JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './translation-name-space.context';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
|
+
type TranslationNameSpaceState = string[] | string;
|
|
3
|
+
export declare const defaultTranslationNameSpace: TranslationNameSpaceState;
|
|
4
|
+
export declare const TranslationContext: React.Context<TranslationNameSpaceState>;
|
|
5
|
+
export declare const useTranslationContext: () => {
|
|
6
|
+
nameSpace: TranslationNameSpaceState;
|
|
7
|
+
};
|
|
8
|
+
export declare const TranslationProvider: (props: React.PropsWithChildren<{
|
|
9
|
+
nameSpace: TranslationNameSpaceState;
|
|
10
|
+
}>) => React.JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/helpers/generate-skus-functions/get-colors-by-product-id/get-colors-by-product-id.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ProductColorCode } from '../../../styles/theme';
|
|
2
|
+
/**
|
|
3
|
+
* Returns an array of colors that are available for a particular product ID.
|
|
4
|
+
*/
|
|
5
|
+
export declare const getColorsByProductId: (productId: number) => {
|
|
6
|
+
code: ProductColorCode;
|
|
7
|
+
hexColor: string;
|
|
8
|
+
shortColorName: string;
|
|
9
|
+
}[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './get-colors-by-product-id';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { GetSkuSelectorsProps } from './get-sku-selectors.types';
|
|
2
|
+
/**
|
|
3
|
+
* Provide a sku and the variant options and get all the product option codes back.
|
|
4
|
+
*
|
|
5
|
+
* *`variantOptions` must be input in the same index order they were provided in!*
|
|
6
|
+
*/
|
|
7
|
+
export declare const getSkuSelectors: (props: GetSkuSelectorsProps) => {
|
|
8
|
+
colorCode: string;
|
|
9
|
+
productId: number;
|
|
10
|
+
sizeCode: string;
|
|
11
|
+
variantCompleteCodes: string[];
|
|
12
|
+
variantPartialCodes: string[][];
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './get-sku-selectors';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './use-provider';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './use-provider';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
|
+
import { GenericContextValue } from './use-provider.types';
|
|
3
|
+
export declare const createGenericContext: <Type>(defaultValue: Type) => React.Context<GenericContextValue<Type>>;
|
|
4
|
+
/**
|
|
5
|
+
* ```
|
|
6
|
+
* const defaultMyValue = 'foo';
|
|
7
|
+
*
|
|
8
|
+
* const MyContext = createGenericContext(defaultMyValue);
|
|
9
|
+
*
|
|
10
|
+
* const OuterWrapper = () => {
|
|
11
|
+
* const MyProvider = useProvider({
|
|
12
|
+
* Context: MyContext,
|
|
13
|
+
* defaultValue: defaultMyValue,
|
|
14
|
+
* });
|
|
15
|
+
*
|
|
16
|
+
* return (
|
|
17
|
+
* <MyProvider>
|
|
18
|
+
* <InnerComponent />
|
|
19
|
+
* </MyProvider>
|
|
20
|
+
* );
|
|
21
|
+
* }
|
|
22
|
+
*
|
|
23
|
+
* const InnerComponent = () => {
|
|
24
|
+
* const [myValue, setMyValue] = useContext(MyContext);
|
|
25
|
+
*
|
|
26
|
+
* // ...
|
|
27
|
+
* }
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare const useProvider: <Type>(props: {
|
|
31
|
+
Context: React.Context<GenericContextValue<Type>>;
|
|
32
|
+
defaultValue: Type;
|
|
33
|
+
}) => React.MemoExoticComponent<({ children }: PropsWithChildren<Record<never, never>>) => JSX.Element>;
|